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

How to use connectedComponentsWithStats in android/java?

$
0
0
Hello, i want to find object from mat(blim) with use of connectedComponentsWithStats.but i dont know how to use this in java so please help me .. C++ code:- Mat labels, stats, centroids; int numObjects = connectedComponentsWithStats(blIm, labels, stats, centroids); // Draw bounding boxes for objects in the original image // exclude background = 0 int i; for(i=1; i(i, CC_STAT_LEFT); int top = stats.at(i, CC_STAT_TOP); int width = stats.at(i, CC_STAT_WIDTH); int height = stats.at(i, CC_STAT_HEIGHT); // draw rectangle rectangle(image, Rect(left, top, width, height), Scalar(0,255,0), 2); } thanks

Viewing all articles
Browse latest Browse all 19555

Trending Articles



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