Skip to content Skip to sidebar Skip to footer

Python Opencv Optimal Thresholding

I am trying to detect roi in my image dataset using Otsu thresholding. While in some cases results are on the point, some cases are not that good. I'm using the code below. import

Solution 1:

I suggest using the GRIP software to implement two image processing pipelines: One that performs thresholding to find the center point and another to find all the other circles.
These pipelines can then be generated to Python OpenCV code and you can import them into your code (which I have already done for you).

Here is the center point pipeline: It performs a simle HSV threshold followed by a find blob command
Center_Pipeline


Here is the circle pipeline:
It performs a Laplacian transform (which is a one-sided Fourier Transform to detects the contrast changes which represent the edges of the circles), then Canny edge detection to find the edges of the circles, and then finds and filters the contours of the circles. To find the number of circle, you can divide the number of contours by 2 (inner and outer circle associated with each Laplacian ring) Ring_Pipeline


Here is the link to download the GRIP software

Here is a link to all my files (including the auto-generated Python image processing pipeline)


Post a Comment for "Python Opencv Optimal Thresholding"