Dimensional Analysis of Screw

In this image I aim to estimate the outer and inner diameter of screw.

Regarding outer diameter estimation, I was thinking of coming up with some method to hop from one peak of teeth to next peak… storing the pixel positions of peaks. Then regressing a line on those points. Then fitting a circle with max diameter between the regressed lines to estimate the outer diameter of pixel…

I could not get it to the shape of an algorithm to achieve the task. Please help me out in using OpenCV to complete the task.

Thanks in advance!!

crosspost:

https://stackoverflow.com/staging-ground/79109578

Getting 404 error in shared link

yes, because that links to the Stack Overflow “staging ground” that not everyone can access. specifically, logged out SO users can’t see those pages.

I just asked it on multiple platforms to get some insight quickly from somewhere… U just did time-pass stuff of sharing link of my own question on stackoverflow…

AWESOME