12-26-2011 04:37 AM
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
12-27-2011 04:50 PM
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.
12-28-2011 05:10 AM
Hi. Thanks for reply. Here is the software.
12-29-2011 03:42 PM
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.
12-30-2011 06:08 PM
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.
01-03-2012 11:32 AM
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.
01-04-2012 01:23 AM
Thanks to everybody.
I solved everything.
01-04-2012 08:46 AM
Great! I'm glad it's working properly now.