Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Bounding box For characters

$
0
0
Hi, I am currently using [this](http://docs.opencv.org/2.4/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.html) program provided by OpenCV to get the bounding box for my characters. The problem is the largest bounding box rectangle surrounds the entire image so when I do CV_RETR_EXTERNAL only the largest rectangle shows. I want to know how to remove the largest bounding box so I can get a bounding box for each character. I also want the bounding box to be in order in x axis from left to right so I can analyze them. I know for( int i = 0; i< contours.size(); i++ ) { Scalar color = Scalar( rng.uniform(0, 255), rng.uniform(0,255), rng.uniform(0,255) ); rectangle( drawing, boundRect[i].tl(), boundRect[i].br(), color, 2, 8, 0 ); } Is supposed to loop through all the boundRect but most of them is showing -1 in my case so I am not sure how to group them by x axis. Below is an image of my output and I want to remove the largest blue bounding box rectangle. ![image description](/upfiles/14472920044576201.png)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



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