12-26-2011 02:11 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 05:48 PM
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
12-28-2011 01:04 AM
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.
12-29-2011 04:10 PM
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.