Under the Standard Window window, display the OpenCV handle

xiaoxiao2021-03-06  24

When I learned OpenCV, I want to display pictures under the Standard Window window. After learning, I can display it in the dialog box.

But the problem has occurred, when the OpenCV is handled, the OpenCV function is called:

Cvcvtcolor (imgtemp, cv_bgr2gray);

The processed picture exists in imgtemp, which is IPLIMAGE, and the processing is CVARR. Cvvimage's dra wtohdc () cannot be used. I think it may be that the constructor of the CVVImage class is not enough, so I inherited the CVVImage class.

Class MyImg: Public Cvivage {public: MyImg (iPlimage * IMG): cvvimage () {m_img = CVCloneImage (IMG);}};

The processing statement is as follows:

ImgTemp = CvcreateImage (cvsize (img.width (), IMG.HEIGHT ()), IPL_DEPTH_8U, 1);

Cvcvtcolor (img.getimage (), imgTemp, cv_bgr2gray); // rgb × × »ª» ò¶è CRECT Rect (img.width () * 0.5 10, Img.width () 10, IMG. Height () * 0.5); MyIMG IMG1 (IMGTEMP);

Img1.drawtohdc (dc.getsafehdc (), rect);

转载请注明原文地址:https://www.9cbs.com/read-40459.html

New Post(0)