accessing pixels on an ofxCvGrayScaleImage

hi all! I am still fairly new to OF and ofxOpenCv (and opencv as a matter of fact), so excuse my lack of knowledge.

what I need to do is create a border window on a ofxCvGrayScaleImage, much like cropping out the areas surrounding a rectangle region of interest.

I have seen that the class have a member called “setRoiFromPixels()”, but since its 1st argument is an unsigned char, how do I tell it that I want as an origin for my ROI a point x,y? (Ie I would expect for it to ask for arguments (x,y,w,h) with obvious meanings…

if I am to use this member how does it work afterwards? say I do:

setRoiFromPixels( myKinectDepthImage::getPixels() , roiWidth , roiHeight ) ;

how should I later on I access the ROI in this image? I mean how does the execution engine separate between the full image and the ROI on the image… ?

I could of course tamper with the pixels directly on my own, using the “getPixels()” member. How do I traverse the image in that case? I have seen in the ofxKinect example, that it just traverses all the pixels as if they are in a 1D array. But since I want to apply a bounding rectangle of which I know the 4 corners, I am not sure how to go do that in a 1D array…

Any pointers to tutorials, guides books forum posts (I failed in my searching ) are more than welcome!

thank you for your help!

hey synth

take a look at my last post (just now), I’m cycling through a bounding box of pixels, using getPixel and sampling the colour that is there. Works and would do what you are after I think