I need to focus in on the wheel of a car image. My thinking is that the wheel hub would be the closest thing to an actual circle or ellipse but I'm not sure how I could isolate it.
I'm using OpenCV to draw the contours but I'm not really sure where to go next.
Ultimately, I am trying to take the first image and then crop out just the wheel and add some padding. See the last image for an example.
Here's my code.
img = cv2.imread(path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
ret,th = cv2.threshold(gray,127,255, 0)
contours, hierarchy = cv2.findContours(th,2,1)
for i in contours:
cv2.drawContours(img, i, -1, (0,255,0), 3)