Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is not an easy problem to give a generic solution. But for the given image and bounding boxes I can think of two approaches:

  1. Find features which can distinguish between the bounding boxes, such as color. You could calculate the color histogram (assuming you could also use a color image) for the patch in each bounding box, and make a comparison to select the one you need. Example code: http://docs.opencv.org/doc/tutorials/imgproc/histograms/histogram_calculation/histogram_calculation.html

  2. Assuming that you only want to detect the bounding box with some alphanumerics inside, you could consider applying Optical Character Recognition for each patch, and select the one which has letters and numbers. Note however that, you may get false positives if there are other patches satisfying this criteria. Example Python code to get started: http://stackoverflow.com/questions/9413216/simple-digit-recognition-ocr-in-opencv-python

This is really a very specific problem, and you need to use your domain knowledge to think of features that can help to select the required patch.