I went through couple of template matching tutorials and I had noticed that most of the tutorials try to match the template which crop from original image. But I would like to know whether is it possible to identify similar objects with different widths and heights ?
In my project I have following type of image which I generated.
and I need to identify following components from it.
How can I archive this using opencv or javacv?? Is it possible to use template matching for this? Because this objects can be in different sizes so is it possible to use it? Please can some one give simple code example to identify this objects ?
I'm not sure that it helps you in real situation, but simple threshold did the trick on your input image:
Code:
Mat src = imread("input.jpg"), tmp;
cvtColor(src, tmp, CV_BGR2GRAY);
threshold(tmp, tmp, 200, 255, THRESH_BINARY);