Hi, I’m trying to crop the image captured from my firewire camera but I can’t get it working.
I’ve searched the forum but didn’t find anything that worked for me.
I found this:
http://www.openframeworks.cc/forum/view-…-light=crop
but I can’t get the Ipllmage class to work and I didn’t find anywahere that shows how to work with this class.
I tried to do a cropping function myself, but it doen’st work:
void crop(unsigned char *img1, unsigned char *img2, int x0, int y0, int w, int h){
int x, y, i;
ofImage aux;
unsigned char* newImg;
aux.allocate(w, h, OF_IMAGE_GRAYSCALE);
newImg = new unsigned char[w*h];
for(x=x0; x<w; x++){
for(y=y0; y<h; y++){
i = y*320 + x;
newImg[i] = img1[i];
}
}
aux.setFromPixels(newImg, w, h, OF_IMAGE_GRAYSCALE);
aux.resize(320, 240);
img2 = aux.getPixels();
}
Can Anyone help me ?
Is there a tutorial or guide for cropping ?
It is a very simple and basic feature in Processing an Max/MSP/Jitter , it shouldn’t be that hard to get it working with OF
Thanks