Ask Your Question

Revision history [back]

I would suggest using the properties of the region of interest parameter, instead of resizing, since you don't want your original image to be resized and stored each time. It will only slurp your memory.

Some sample code which will guide you:

Mat original; imread('location', original);
//use info to calculate your roi based on current location of mouse pointer
Rect roi(0,0,50,50); 
Mat temp = original(roi);
imshow('temp', temp);

I would suggest using the properties of the region of interest parameter, instead before the step of resizing, since you don't want your original image to be resized and stored each time. It will only slurp your memory.resizing.

Some sample code which will guide you:

Mat original; imread('location', original);
//use info to calculate your roi based on current location of mouse pointer
Rect roi(0,0,50,50); 
Mat temp = original(roi);
imshow('temp', temp);