开发者

Two sucessive ImageShow showing the same image

开发者 https://www.devze.com 2023-03-25 15:04 出处:网络
I\'m trying to visualize 2 successive images using OpenCV Here are the 3 matrices I am computing: projectionResult_img_debug = cvReshape( projectionResult_line, &row_header_temp, 0,rect_list[9].

I'm trying to visualize 2 successive images using OpenCV

Here are the 3 matrices I am computing:

projectionResult_img_debug = cvReshape( projectionResult_line, &row_header_temp, 0,    rect_list[9].height );
projectionResult_img_debug2 = cvReshape( AverageImg_line, &row_header_temp2, 0, rect_list[9].height );
projectionResult_img = cvReshape( projectionResult_line2, &row_header_temp3, 0, rect_list[9].height );


//debug:                                printMatrixValues(projectionResult_line, 1200, 1250);
printMatrixValues(Ave开发者_高级运维rageImg_line, 1200, 1250);
printMatrixValues(projectionResult_line2, 1200, 1250);

IplImage img_t;
IplImage* img_t2 = cvGetImage( projectionResult_img_debug,  &img_t );


IplImage img_t_2;
IplImage* img_t2_2 = cvGetImage( projectionResult_img,  &img_t );

My problem is that the 2 images that are displayed are the same, and are ALWAYS displaying the last matrix that I have computed (in this case it's the one on line 3).

Any idea of where the problem is?


Like @karlphillip says, your code sample is incomplete. But it looks like the second argument in IplImage* img_t2_2 = cvGetImage( projectionResult_img, &img_t ); should probably be img_t_2.


Assuming that you are using the most recent version of OpenCV, instead of displaying the images I would write them on disk using cvSaveImage(). If they are still equal, then there's a problem on your logic/code and it's not related to OpenCV displaying images.

Your code as it is, its incomplete and I can't help you any further. There's no call to cvShowImage() on this code.

0

精彩评论

暂无评论...
验证码 换一张
取 消