Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

if you have a Rect, e.g. from Imgproc.boundingBox() you can can use submat:

Mat roi = image.submat(rect);

operations, which don't change the depth or type of the image, can be done in-place:

Imgproc.equalizeHist(roi,roi);

else you need a new Mat for the output:

Mat hsv = new Mat();
Imgproc.cvtColor(roi, hsv, COLOR_BGR2HSV);

if you have a Rect, e.g. from Imgproc.boundingBox() you can can use submat:

Mat roi = image.submat(rect);

operations, which don't change the depth or type of the image, can be done in-place:

Imgproc.equalizeHist(roi,roi);

else you need a new Mat for the output:

Mat hsv gray = new Mat();
Imgproc.cvtColor(roi, hsv, COLOR_BGR2HSV);
gray, COLOR_BGR2GRAY);

if you have a Rect, e.g. from Imgproc.boundingBox() you can can use submat:

Mat roi = image.submat(rect);

operations, which don't change the depth or type of the image, can be done in-place:

Imgproc.equalizeHist(roi,roi);

else you need a new Mat for the output:

Mat gray = new Mat();
Imgproc.cvtColor(roi, gray, COLOR_BGR2GRAY);

if you have a Rect, e.g. from Imgproc.boundingBox() you can can use submat:

Mat roi = image.submat(rect);

operations, which don't change the depth or type of the image, can be done in-place:

Imgproc.equalizeHist(roi,roi);

else you need a new Mat for the output:

Mat gray = new Mat();
Imgproc.cvtColor(roi, gray, COLOR_BGR2GRAY);