View Single Post
  #1   Spotlight this post!  
Unread 24-02-2012, 17:18
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Image Cropping/Mask?

Hi-

I am trying to crop out a certain part of an image to process.
I am able to create a region of interest, but when i try to crop out the rest of the picture, I can't seem to do it.

This is the relevant part of my code:

Code:
ROI* roi;
roi = imaqCreateROI();
imaqAddRectContour(roi,imaqMakeRect(0,0,220,640));
It is at this point I get stuck. I plan on using the imaqROIToMask function, but I can't get it to work.

This is what I am doing-
Code:
ROI* roi;
roi = imaqCreateROI();
imaqAddRectContour(roi,imaqMakeRect(0,0,220,640)); //top of image
ColorImage* origImage = camera.GetImage();
ColorImage* croppedImage;
imaqROIToMask(????????);
At the imaqROIToMask line I get errors no matter what I try to do.

Basically I just want the camera tracking/processing code to only look in a certain portion of the image. Sadly I couldn't find a "crop" function in the nivision.h library.

Thanks!
Reply With Quote