2

I have a bitmap image like this

enter image description here My requirement is to create a GUI to load the image and for changing the contrast and other things on the image and algorithm to mark the particular area in silver colour as shown in the fig using C++ or C#.I am new to image processing and through my search I have found out that I can use the Histogram of the image for finding the required area.These are the steps.

  • Get the histogram
  • Search for intensity difference
  • Search for break in the line

Can someone suggest me how can I proceed from here.Can I use Opencv for this or any other efficient methods are available..?

NOTE:

enter image description here This image have many bright points and the blob algorithm is not successful. Any other suggestions to retrieve the correct coordinates of the rectangle like object.

Thanks

ShivShambo
  • 523
  • 12
  • 29

3 Answers3

3

OpenCV should work.

  1. Convert your input image to greyscale.
  2. adaptiveThreshold converts it to black and white
  3. Feature detection has a whole list of OpenCV feature detectors; choose one depending on the exact feature that you're trying to detect.

E.g. have a look at the Simple Blob Detector which lists the basic steps needed. Your silver rectangle certainly qualifies as "simple blob" (no holes or other hard bits)

MSalters
  • 173,980
  • 10
  • 155
  • 350
  • @MSalters.. I have successfully used the blob detection and adaptive threshold for the dark image..But I am having a day light image similar to that. But there I am having some problems using the blob algorithm.. – ShivShambo May 14 '12 at 03:45
  • I posted my image in the question – ShivShambo May 14 '12 at 03:45
  • @lakshmikant: Oh, that's just noise. `bilateralFilter` should remove that. – MSalters May 14 '12 at 07:47
  • Thanks. I tried this before but I am getting an unhandled exception.I used the cvSmooth(pic1,pic2,CV_Bilateral). – ShivShambo May 14 '12 at 08:32
  • `IplImage* frame1 = cvLoadImage("EFilter_Day_I1p8_1.bmp",-1);' 'cvAdaptiveThreshold(frame1, imgPicThres,255,CV_ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY,15,-5);` – ShivShambo May 14 '12 at 08:34
1

If all of your pictures look like that, it seems to me not complicate to segment the silver area and find its centre. Basically you will need to apply these algorithms in the sequence below:

  1. I would suggest binaryze the image using Otsu adaptive threshold algorithm
  2. Apply a labelling (blob) algorithm
  3. If you have some problem with noise you can use an opening filter or median before the blob algorithm
  4. If you end up with only one blob (with the biggest area I guess) use moment algorithm to find its centre of mass. Then you have the X,Y coordinate you are looking for

These algorithms are classical image processing, I guess it wouldn't be hard to find then. In any case, I may have they implemented in C# and I can post here latter in case you think they solve your problem.

Andres
  • 3,324
  • 6
  • 27
  • 32
0

May be a research on Directshow, a multi media framework from Microsoft will help you to accomplish your task.

MACMAN
  • 1,883
  • 1
  • 21
  • 35
  • @Gijo.. Thanks . I want to find the coordinates(x,y) of the centre of the region. Is there any other way that I can implement by visual studio 2010 alone. – ShivShambo May 07 '12 at 04:05