-2

I have a number of lobster images as shown in the photo. My goal is to identify the edge between the carapace and the body and its coordinates. However, it seems like the methods of finding contours based on HSV thresholds or Canny edge detection output didn't work well when I applied to these images.

My idea is to find a way to 'amplify' the color difference between two areas of an image to make it easier for finding mask/contours based on color threshold?

For example, if I can make the yellow of the edge in the image stronger, then I can easily find the mask of this area using color threshold, can we do that?

Thanks.enter image description here

Son Vo
  • 21
  • 8
  • You mean something like "contrast"? – Jongware Feb 25 '18 at 13:22
  • I think it's similar like that. But in this case, I don't want to increase the contrast of the whole image. I see the edge is yellow compared with other areas around it. I don't know how to increase the degree of this yellow only so it's easier to use color threshold method to find mask/contours. By the way, why this question is voted down? anyone please advise me so I can avoid 'bad questions'. – Son Vo Feb 25 '18 at 13:56

1 Answers1

0

This color is closer to the rest of the picture than one think (in the HLS space).

IMO, the best way to enhance it is by means of the Euclidean distance to that particular orange in RGB space.

For instance, the pixels at distance 32√3:

enter image description here

  • Thanks Yves for the advice. I'm going to try this way. Actually, currently, I'm using HSV color thresholding (lower = np.array([21,150,250]), upper = np.array([255,255,255]) to find some points at the edge. But I will try your suggestion to see whether I can get better result. – Son Vo Feb 27 '18 at 00:50
  • Hi Yves, I have tested the technique that compares two colors based on Euclidean distance. Before doing comparison, I increase the contrast of the edge area and then compare it with red. It meets my demand. So, I accept your answer. Thank you Yves. – Son Vo Mar 04 '18 at 02:05