How do we detect points from a picture with a particular color on those points

前端 未结 2 874
梦如初夏
梦如初夏 2020-12-22 12:14

I have a series of images. I am posting a sample image here. I need to extract features from the image as the coordinates of 60 markers painted on each image. Then from a sp

2条回答
  •  北海茫月
    2020-12-22 12:53

    For a problem like this, there could be multiple solutions to accomplish what you want to do. You could use OpenCV to help you implement the functions yourself. Some suggestions on how to handle this type of problem:

    1. Segment the blue markers from the image. Possibly using a threshold on the blue channel to get the those points. They should have a pretty high value in the blue channel.
    2. Since the markers appear to more than one pixel, you could treat the nearby neighbors pixels that are blue as a cluster and find the centroid of each cluster(marker).
    3. From the centroid on the nose tip, computer the distance to each cluster centroid on the face.

    It also depends on a few things. It looks like the shirt in this image has quite a bit of blue, so it would probably get segmented in with the markers. To remove this you could use OpenCV's face detection to find the face then only worry about the found face region.

    Also it depends on if you know where the nose marker is. If you can manually select it (can use OpenCV to do this), you can set a seed on the nose marker, then do the previous steps.

    If you can't manually select it, based on this image it appears the nose marker is close to the center of the image (if you are using the nose tip). You may be able to find the centroid closest to the image center and use this. Doing this would be dependent on the rest of the images that you would be testing on though. Also, this automatic method of determining the nose marker, may not work as there are other markers that are pretty close. You may pick one of those up instead of the actual nose tip.

    As I said this is a pretty subjective problem, there could be many solutions to solve it. These are just a couple of suggestions to maybe help point you in the right direction.

提交回复
热议问题