我在 Windows 8 中使用 opencv 2.4.1 和 Visual Studio 11。
我为我的窗口提供了清晰易读的名称,如下所示:
namedWindow( "canny_src");
imshow( "canny_src", canny_src );
namedWindow( "canny_other_image");
imshow( "canny_other_image", canny_other );
namedWindow( "RESULT");
imshow( "RESULT", result );
但是当窗户打开时,我得到了非常罕见的名字,你自己看:
有人可以帮我解决吗
编辑!!!整个代码在这里。
#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
#include "opencv2\imgproc\imgproc.hpp"
using namespace cv;
Mat src;
Mat other;
int thresh_src = 100;
int thresh_other = 100;
int max_thresh = 255;
void thresh_callback(int, void* );
int main(int argc, _TCHAR* argv[])
{
IplImage *_img = cvLoadImage("C:\\Users\\Eric\\Desktop\\lena.jpg", 0);
IplImage *_img_other = cvLoadImage("C:\\Users\\Eric\\Desktop\\lena.jpg", 0);
src = Mat(_img);
other = Mat(_img_other);
namedWindow("image");
imshow("image", src);
createTrackbar("Tracking src: ", "image", &thresh_src, max_thresh, thresh_callback);
createTrackbar("Tracking other: ", "image", &thresh_other, max_thresh, thresh_callback);
waitKey(0);
}
void thresh_callback(int, void*)
{
Mat canny_src;
Mat canny_other;
Mat result;
Canny(src, canny_src, thresh_src, thresh_src * 2, 3);
Canny(other, canny_other, thresh_other, thresh_other * 2, 3);
bitwise_and(canny_src, canny_other, result);
namedWindow( "canny_src");
imshow( "canny_src", canny_src );
namedWindow( "canny_other_image");
imshow( "canny_other_image", canny_other );
namedWindow( "RESULT");
imshow( "RESULT", result );
}