0

I have some flat material on which I make a mark with a laser cutter - currently I'm marking a "plus"-sign. I would then like to take a picture and automatically find the mark so that I can calibrate the position of the laser to the material. Here is an example of such an image:

enter image description here

I have then tried to construct convolution kernels to pick out the marks. In the example below I have a kernel where the green dots are positive and the dark-red dots are negative and gray is not counted. I can easily change the desity and shape of the points:

enter image description here

I figured that this would pick out plusses and only plusses, where the center yields the highest convolution signal to the kernel - like this:

enter image description here

But it turns out that if there is dark or white noise of any shape they will get picked instead of the plusses if the colors are darker or lighter than the mark color (which is not that dark compared to the background). In the image below the black doodles are just much more black and thus give a higher signal for the kernel regardless of the non-plus shape. This could be an actual issue if there is dirt, stains, glarring etc. on the material.

enter image description here

I have tried edge detection first but here too the black color gives stronger edges and still gives a stronger signal when the plus-kernal is applied. I can tweek carefully filters to pick out the plusses, but this seems suprisingly delicate and I doubt it will pick out marks from all different types of noise.

Am I not sure if I am going about this all wrong or if there is a smart sequence of convolutions, normalizing, clustering etc. that could reliably get the shapes. I could easily change shape as well (maybe circles) if that helps. Any ideas or thoughts would be greatly appriciated.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
DrDress
  • 144
  • 5
  • There might be a mismatch between your kernel and the size of your crosses. What is the width of the lines of the crosses in pixels? Also, how did you manage to highlight the crosses if they appear to be darker than the background? – Flow Dec 16 '22 at 12:03
  • yes, it's a scale mismatch. make sure your "template" has the same scale, or scale it to expected size/resolution. -- where's the code? what language? what libraries? [mre], [ask], [tour] – Christoph Rackwitz Dec 16 '22 at 14:58
  • It is not a scale mismatch. I have tried many kernels other than the one I included in the question. As I said I could find one to pick out the cross and ignore certain noise, but would then choose different noise over the cross instead. The code is in c# and I'm not using any libs. – DrDress Dec 16 '22 at 21:18

0 Answers0