Marking an interest point in an image using c++

跟風遠走 提交于 2019-12-24 02:15:10

问题


I have a bitmap image like this

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:

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


回答1:


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)




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/10476416/marking-an-interest-point-in-an-image-using-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!