LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqLearnPattern

Hi. I am trying to select a part of an image ( video ) and display it a new window in order to search it in video image.

After i open the camera a new window pops up to see the video image than i choose a part of it with toolbox than a new window pops up but instead of the part of the image i see green image at the size of the part that i chose.

 

/* Create images that will be used within this program */

            searchImage = imaqCreateImage (IMAQ_IMAGE_RGB, 2);

            templateImage = imaqCreateImage (IMAQ_IMAGE_RGB, 2);

 

 

                                                                                  etc. etc. etc. etc.

 

 

            switch (event)

                        {

                        case IMAQ_DRAW_EVENT:

                       

                                    userRect = rect;

                                    imaqSetImageSize(templateImage, userRect.width, userRect.height);

                                    imaqCopyRect (templateImage, searchImage, userRect,

                                                                          imaqMakePoint(0,0));

                                    imaqMoveWindow (1, MakePoint(410,350));

                                    imaqDisplayImage (templateImage, 1, 1);

                                    

                                    break;

                        }

}

 

 Please help.

Thanks

0 Kudos
Message 1 of 4
(3,073 Views)

Hello ReuvenGershon,

 

If I interpret you correctly you are acquiring video from a camera, and you want to crop out a certain portion of the image leaving only a specified rectangle of the orignal image behind.  Is this correct?  If so, I'm uncertain which portion you are having difficulty with.  Does the code you post produce a green image that isn't supposed to be green?  Or does it not resize the image as it is intended to be resized? 

 

David A

0 Kudos
Message 2 of 4
(3,052 Views)

Thanks for reply.

 

You are right. The thing is i want to choose an object and track it ; lets say ball. Size of the image correct but it always pop up in green. Doesn't matter what i chose it is always green.

0 Kudos
Message 3 of 4
(3,048 Views)

Hello ReuvenGershon,

 

It looks like this is a duplicate thread.  I've spoken with Michael B. and we've decided to close this thread and post responses in the other thread.

 

David A.

0 Kudos
Message 4 of 4
(3,016 Views)