I am utilizing OpenCV and Python to located the positions of the 96-well plates in order to automate a detection process. However, I encounter an issue that the camera is builded with a wide angle lens resulting in an image which is not ideal for Hough Transform to detect and locate circles, in this case wells, as the function detects the inside of the wells as a circle. I have include a sample well-image and an image of what was detected by the wells.
This is the original image.
This is the image that is detected by the Hough Transfrom in the OpenCV.
To tackle this issue, I have tried using gray scale image before using the Hough Transform function.
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# blurred_image = cv2.GaussianBlur(gray_img, (9, 9), 2)
# gray_img = cv2.blur(gray_img, (4,4)) # blur to reduce noise?
detected_circles = cv2.HoughCircles(gray_img, # image for detection
cv2.HOUGH_GRADIENT, # detection method
1, # inverse ration of resolution
img_height/64, # Not sure need adjustment
param1 = 200,
param2 = 10,
minRadius = 14, # If unknown input 0
maxRadius = 15 # If unknown input 0
)
Also, I haved tried using Canny Edge detection through this Edge detection opencv. However, through this tutorial the inner edges are still prevalent, resulting in the same result.
Any recommendations or advice would be greatly appreciated!