Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to create an ROI (Region-Of-Interest or submat) from a contour?

$
0
0
Given an image `Mat`, and a contour (which is a `MatOfPoint`) in it, how can I create a ROI (Region Of Interest)/submat? I can see three interesting methods on docs of Mat, > **Mat submat(int rowStart, int rowEnd,> int colStart, int colEnd)** Extracts a> rectangular submatrix.>> **Mat submat(Range rowRange, Range> colRange)** Extracts a rectangular> submatrix.>> **Mat submat(Rect roi)** Extracts a> rectangular submatrix. - Is there a way to find out `rowStart`, `rowEnd`, `colStart` and `colEnd` from the contour? or - Is there a way to get `rowRange` and `colRange` from the contour? or - Can I make a `Rect` from the contour?

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>