i want to get a sub-image (the one bounded by the red box below) from an image (Mat format). how do i do this with opencv4 android ?
You can do the following,
Convert to gray scale .
Threshold the gray.
Using the boundbox crop the ROI like
Rect R; //bounding box for contour Mat src;//source image Mat cropped=src(R); //Crop the image
Note: You should convert all these to Java or Use JNI to use C++ directly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.