c - 两个连续的图像显示显示相同的图像

标签 c opencv

我正在尝试使用 OpenCV 可视化 2 个连续图像

这是我正在计算的 3 个矩阵:

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(AverageImg_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 );

我的问题是显示的 2 个图像是相同的,并且始终显示我计算的最后一个矩阵(在本例中是第 3 行的矩阵)。

知道问题出在哪里吗?

最佳答案

就像 @karlphillip 所说,您的代码示例不完整。但看起来 IplImage* img_t2_2 = cvGetImage(projectionResult_img, &img_t ); 中的第二个参数可能应该是 img_t_2

关于c - 两个连续的图像显示显示相同的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6917164/

相关文章:

c - C中void指针的指针运算

c - 中断的系统调用

无法输入全天数据并累计总计

c - '=' token 之前的预期符号

c - 为什么在使用 setenv( ) 后环境变量未设置

c++ - 有没有办法在opencv c++中检查矩阵中的数据

opencv - OpenCV凸度缺陷图

c++ - 如何在不运行 'make install' 的情况下使用 OpenCV?

python - Python-OpenCV中的本地规范化

python - opencv如何在屏幕录像机上使用级联