Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqLearnP​attern

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 8
(3,545 Views)

Hello,

 

Would it be possible for you to post the rest of your code?  The rest of the code might helpful shed some light on the problem.  In the past I've seen some similar behavior when I was using the area outside of a ROI that I had set when I had intended to use the area inside.

Michael B.
Applications Engineer
0 Kudos
Message 2 of 8
(3,525 Views)

Hi. Thanks for reply. Here is the software.

 

 

0 Kudos
Message 3 of 8
(3,521 Views)

Hello ReuvenGershon,

 

Thanks for the additional information.  Try investigating your palette type and make sure it is set to the one you want (whether it is binary, grayscale, etc..).  Also, make sure that you are using a consistent image type.  Obviously, strange things can happen if a RGB, U8, or U16 image is displayed as another type.

 

Also, I noticed that there is a duplicate discussion forum thread in which you're discussing this identical problem with a colleague of mine.  I've spoken with David and we agreed that in order to simplify our communication we'd keep our communication with you limited to this thread.

Michael B.
Applications Engineer
0 Kudos
Message 4 of 8
(3,493 Views)

Thanks.

I have already solved it. It was roi.

Now i can chose the piece of the video and save it. Now i have problem with searchpattern. I don't know how to use it...  I save the cropped image as tempimage. What do i need to use for RGB?

Thanks.

0 Kudos
Message 5 of 8
(3,478 Views)

Hi ReuvenGershon,

 

If you're looking for a good resource on how to use specific functions, check out the help files in C:\Program Files\National Instruments\Vision\Documentation.  There you can find detailed descriptions on different IMAQ functions.

Michael B.
Applications Engineer
0 Kudos
Message 6 of 8
(3,462 Views)

Thanks to everybody.

I solved everything.

0 Kudos
Message 7 of 8
(3,454 Views)

Great!  I'm glad it's working properly now.

Michael B.
Applications Engineer
0 Kudos
Message 8 of 8
(3,452 Views)