Ideally the result would look like a black background with (thick) white lines.
I’ve tried canny, sobel, denoising, opening, closing, erosion, dilation, blurring, … and various combinations. But no luck. Can someone please give me some advice on this.
The Hough transform makes the assumption that there are straight lines, which is fin in this picture. However, I want a more general solution. For instance squiggly lines.
Interesting problem. Might you be able to generate an image that is more uniform in focus and more evenly lit? With that, some combo of what you have tried might work. I would add contrast enhancement to your list of things to try and then see if you can quant down to something like 2 or 3 color values. With a more uniform image erode/dilate ought to get you what you want. In particular, the upper left corner is relatively out of focus and the lower left corner is considerably darker. This causes you to have first try rectifying those issues before you even get to your primary question. Good luck.
none of those will work, especially not Canny or Hough. those are newbie traps anyway. “denoising” is a goal, not an operation. blurring is one way to “denoise”. a blur alone won’t solve this though.
you need a bandpass filter. that would be a difference of gaussians (one gaussian may be the untouched source too), or any of the “adaptive” thresholding provided by OpenCV.
Then I can fit some sort of periodic regression on it and look at the difference for the location of the anomaly. Which works for this synthetic image.
you are talking of automated optical inspection. a snapshot taken any which way won’t cut it.
I suspect a solution is worth money or a thesis so I’ll leave it at that. just a few days ago I saw someone get a bachelor’s from half a semester’s worth of one course’s homework assignments.