Algorithm for vertical curved detection

Hi all,

I’m trying to come up with an approach to find and mark the orange and green curved (Edges of a static and moving metal object). the goal is to measure the distance\angles between the two objects in real time.

I have already made a script that crops out the top & bottom 50 pixels and searches for the first “drastic” drop in darkness from left and right size but the result is not rubust enought for changing lighting conditions, the result is the bottom two images. The eyes can simply see the curved border all the time but my algo fails when lighting changes.

Any suggestion for a better way to find those edges?
(tried blur+canny but it fails misserably)

Why did blur + canny fail miserably? Show some images of the results / intermediate processing.

You said “moving objects” and “real time” - canny might be helpful for prototyping, but I think you will find that it is too slow for your use case. You will probably have better luck (from a runtime performance perspective, at least) by using lower level edge detection functions.

In some of your images the edge is fairly apparent (at least to a human) but in others it is less distinct. If you have control over your lighting I would suggest experimenting with different lighting positions - position/direction of lighting can dramatically affect how the object edges are imaged.

this looks like severe lens distortion. perhaps you should deal with that.

I also can’t make out much of particular interest. looks like a groove in a metal cylinder or flat piece (impossible to say with this lens distortion).

I don’t see what’s supposed to be measured. just “marking” some “curves” isn’t a proper goal. you’ve got to share with us the reason these “curves” are of any interest at all… and iterate on the “why” once or twice.

consider that you’re stuck in an approach that doesn’t work, yet you’re asking us to fix it anyway. maybe it’s not worth making work. maybe a different approach, to the real problem, is better. this is often the case.

lighting in these pictures is bad, for whatever you’re trying to measure. “computers” aren’t a magical solution for bad pictures. you have to light the thing properly to make your life easier.

undeclared crosspost: