# How to measure the distance between two circle-like-lines over 360 degree

I am looking for a slim and with that quickly programmable image processing strategy to measure the distance between two circles over 360°. It is important to notice that the circles are not perfect, see Fig. 1.

Fig. 1: Sketch of the circles

The application of this, so you can imagine the question a bit better, is: I have a cylindrical specimen with an radius r1(alpha) over the 360°, lets call the angle alpha. In the sketch it is the black circle. Now I would like to measure the thikness "delta r" over alpha of a slim layer on this specimen. In the sketch the thin layer is painted in blue.

I draw the circles in kind of paint style on purpose as in the real image I would draw the line where I think both rings would be and would then start with calculating/image processing. I know that it would be possible to detect the edge with some kind of edge detection algo. (eg. Canny), but I am looking for a slim and fast way of getting to my result.

The perfect result could look like this: A function which is an approximation of the black line over alpha and then another function for the blue line.

Here a slim idea I had: Drawing two perfect circles over both cirles and substract them -> delta r, but the made error might be big.

So my question (1) is: How would you solve this to get delta r over alpha? Thinking outside the box is welcome of course!

Question (2) is: I know that the circles I drew are - from a mathematical point of view - not described at each alpha -> so I guess an approximation of the circle is somehow needed. Any ideas how to approximate?

Edit 1: Here you can see a real pictures. For now I don't have the optical system set up, so I just took a photo with my smartphone. Assume the length of the picture in x direction as 40 mm so you have a reference.

Fig. 2: Picture of the real specimen.

• There is a number of techniques available to do this but without a sample image it is difficult to provide an accurate suggestion. Is it possible to post a sample image?
– A_A
Commented Jul 11, 2018 at 8:39
• Yeah, pretty straightforward problem. Are you going to have access to the optical system soon? If an image is available from that one then you will also get practical results, otherwise it will be something like "You can try this or maybe this" with examples on this image which is not the best. Your biggest problem is data acquisition here. Hopefully, the optical system will not be producing so many shadows.
– A_A
Commented Jul 11, 2018 at 13:00
• No worries. In addition to Marcus' accurate answer, there are a few more things you can do which might be "easier" / less complex than a Hough Transform but it depends very much on the image quality. So, if you are interested, I would be willing to provide a response, complementary to the accepted answer.
– A_A
Commented Jul 11, 2018 at 16:38
• Sure, why not. Go for it.
– KLJ
Commented Jul 20, 2018 at 13:31
• ...do you have an image from the optical system (?)
– A_A
Commented Jul 20, 2018 at 14:27