--- In
[hidden email], "satish_kodavali2000" <kodavali.satish@...> wrote:
>
> Thank you for the response.
>
> I have some questions here about the logic.
> You have created the 4 headers in the beginning right. And there you
> are using im1->imageData=combined->imageData+
> combined->width->Step+combined->nChannels;
Some basics.
They are described in the book. I strongly recommend. (Gary Gradsky and Adrian
Kaehler. Learning OpenCV, published by O'Reilly).
I have read this method in the book.
In OpenCV, an image is represented with a structure, describing its width, height,
colorspace, bit depth, etc - a header ( IplImage ).
This structure also contains the pointer to the actual image data (IplImage::imageData).
Image is stored pixel after pixel, each pixel is represented with 3 bytes: for red, green
and blue components of a color (in case of color image).
OpenCV also allows separate allocation of the structure parts. You can create a header
only and attach already allocated data to it. This is happening here.
I have suggested you to allocate one large data array with attached header with
cvCreateImage.
Then I have suggested you to create four more headers and attach them to the parts of
that data array.
> But at this point combined->imageData has got nothing in it. So should
> we do it in the loop after reading the frames?
I have referred to the info about cvQueryFrame.
It appears, all is a bit more complicated in case of video.
You should use cvCopyImage.
Again.
Initially, you call cvCreateFileCapture four times for your files.
It gives you four capture structures.
Then you call in a loop
frame=cvQueryFrame(capture1);
cvCopyImage(im1,frame);
im2=cvQueryFrame(capture2);
cvCopyImage(im2,frame);
im3=cvQueryFrame(capture3);
cvCopyImage(im3,frame);
im4=cvQueryFrame(capture4);
cvCopyImage(im4,frame);
And hopefully, this will give you all images, combined in one large image.
> And I didn't understand "Then save combined image to a video frame" in
> the loop.
> Where are we actually combining images. We just have four image
> headers with required coordinates.
>
> Thanks again. Awaiting reply.
>