0

I want to better segment the round part in my pictures(use Segment Anything),and i try many ways to improve the effect,including threshholding(OTSU/adaptive....),OpenCV edge detection(Sobel/Scharr/Laplacian/Canny).

The original image is here:

Original Image

After trying a lot of combinations,now the temporary best one is:Laplacian operator(edge detection) + Gaussian Filter + OTSU,like this: Laplacian operator + Gaussian Filter + OTSU thresholding

The segment after preprocessing is here:

Segment Anything

You can see that the edge is not complete, but at least it splits the circle part, other methods have the following effect: Use Canny operator to detect the edge

How can I make it better?What can i do to remove the curve above the round part?

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
  • 2
    Perhaps use HoughCircle to fit to the large circle? The just draw a (filled?) circle on a black background to make a mask or your result depending upon your goals. – fmw42 Jun 14 '23 at 18:19
  • Fitting a cercle equation is probably a better idea. – Lelouch Jun 14 '23 at 18:44
  • There is no fitCircle function in OpenCV. Only fitEllipse. One would have to do one's own least square computation. – fmw42 Jun 14 '23 at 23:53
  • this must be fixed before the picture is taken. change the lighting. all your efforts are wasted on this picture. btw, SAM is trained on common object categories, not on "this weird shape I have here". it can't solve this without retraining. – Christoph Rackwitz Jun 15 '23 at 07:26

0 Answers0