ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

It sounds like you just want to crop down the image to a certain Region of Interest. This should be fairly straightforward to do by chaining together different pieces of the OpenCV library.

You probably already have an image with the Mat type.

You can then create a region of interest (ROI) using the () Operator

So, something like:

Mat myImage;
Mat croppedImage = myImage(Range(50,100), Range(50,100));

Or, you could use a "Rect"

Mat myImage;
Rect myROI = Rect(50,100,50,100);
Mat croppedImage = myImage(myROI);