0

There is a scenario that I have to identify round/oval marks that are placed on the tiled floor. I tried to use the following background subtraction algorithms that are inbuild with OpenCV separately.

filter1 = cv.bgsegm.createBackgroundSubtractorMOG()
filter2 = cv.createBackgroundSubtractorMOG2()
filter3 = cv.bgsegm.createBackgroundSubtractorGMG()

The result came as following respectively (the first image is the original image and rest are resultant images)

enter image description here

As you can see the black circle that I want to identify is not identified. So I used following thresholding command to identify the mark.

ret, thresh = cv.threshold(img, 75, 255, cv.THRESH_BINARY_INV)

Which gives the following result.

enter image description here

It identifies the mark but I am not sure the thresholding method will work efficiency in different lighting and background.

So what I seek is a better solution, that I can identify the mark more accurately.

Gert Arnold
  • 105,341
  • 31
  • 202
  • 291
Vikum Dheemantha
  • 764
  • 8
  • 24
  • 1
    Not python, but you can try to bind. https://github.com/Smorodov/ellipseDetector it is my port of MATLAB ellipse detector from here: https://github.com/AlanLuSun/High-quality-ellipse-detection it not realtime (0.3 sec per frame, bur works rather robust. – Andrey Smorodov Oct 24 '20 at 09:46
  • 1
    the general background subtraction methods assume that you have a mostly static scene with changing foreground, like a static camera with a static scene and a dynamic object. You are looking dor foreground extraction. Try Otsu Thresholding – Micka Oct 24 '20 at 09:53
  • 1
    Please always post separate original images without the scales. Use cv2.imwrite rather than Mathplotpy. That way other uses can demonstrate solutions. – fmw42 Oct 24 '20 at 16:42
  • @Micka I was completed as you suggest and with your guide, I understand the issue is I am trying to use a method that is suitable for the video to the static image. could you post the idea in your comment as an answer. So, I could mark it as a correct answer. – Vikum Dheemantha Jan 05 '21 at 05:46

0 Answers0