Marking an interest point in an image using c++

2019-07-17 03:34发布

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

3条回答
相关推荐>>
2楼-- · 2019-07-17 03:41

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)

查看更多
萌系小妹纸
3楼-- · 2019-07-17 03:50

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.

查看更多
狗以群分
4楼-- · 2019-07-17 03:55

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

查看更多
登录 后发表回答