Windows 8のVisual Studio 11でopencv 2.4.1を使用しています。
次のような完全に読みやすい名前をウィンドウに付けます。
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 );
}