News for hackers. Stuff that matters.
Re:Edge Detection for Image Processing by idorosen on Friday January 12, 2024 @02:41AM (#38965198)
Canny edge detection is optimal in some settings. Often, though, edge detection is in service of another goal, such as segmentation. Nowadays, computers are big/fast enough (GPUs) that building models that learn edge detection implicitly and do segmentation or the end task directly is feasible.

Still fun to learn about Hough transforms, canny edge detection, and all that 1990s computer vision though!

Re:Edge Detection for Image Processing by eurekin on Friday January 12, 2024 @04:22AM (#38965887)
To be fair, I have no idea how I could use modern techniques instead of the Hough Transform. One use case is the speed and RPM car dials recognition. Using the Hough Transform, it's trivial to reliably detect the slope with a high degree of accuracy.

Have vision models started offering better alternatives for such use cases? It's a genuine question; it's been a while since I last looked.

Re:Edge Detection for Image Processing by chintler on Friday January 12, 2024 @05:47AM (#38966482)
You can pretty much solve this using modern DL models. There are options depending on how accurate you want your model and how much compute you have.

There is an entire spectrum of models, from something like Mask-RCNN, U-Net family upto something like Meta's SAM, which you can use without even training.

Re:Edge Detection for Image Processing by eurekin on Friday January 12, 2024 @05:57AM (#38966567)
Thanks! Would they also help with reading the exact rpm and speed values?
Re:Edge Detection for Image Processing by sgu999 on Friday January 12, 2024 @06:55AM (#38967058)
In this kind of cases I'd probably use the Hough-based algo as ground truth to see if you can indeed fine-tune a DNN on that regression task. If it does with reasonable accuracy, then you have a baseline that could be improved in multiple ways to surpass the original.

That said, there are not that many shapes of speedometer and wheels, and the view point is likely controlled, so your old school method is probably the better way ;)

Re:Edge Detection for Image Processing by eurekin on Friday January 12, 2024 @07:27AM (#38967252)
For the purpose of learning, would you recommend some tutorials, articles or videos that help achieve that? Accuracy aside, this would make a great learning experience!

Is it better to look in the PyTorch community, or that's where some Tensorflow approaches shine? (CUDA is ok)

Re:Edge Detection for Image Processing by sgu999 on Friday January 12, 2024 @07:51AM (#38967382)
PyTorch is much nicer to play with in my opinion. Maybe start with their official tutorial, I've also heard good things about Karpathy's YouTube channel from beginners.
Re:Edge Detection for Image Processing by litlogit on Friday January 12, 2024 @04:19AM (#38965865)
What if these filters are explicitly used as preprocessing steps when training a segmentation model? Would that at least save some epochs, if not increase accuracy?
Re:Edge Detection for Image Processing by eurekin on Friday January 12, 2024 @04:41AM (#38966017)
I'm suspecting it could be similar to the learned vs. predefined positional embeddings in GPTs. That is, the learned version is a "warped and distorted" version of the exact predefined pattern, and yet somehow it performs a bit better, and no one knows exactly why.
Re:Edge Detection for Image Processing by jocoda on Friday January 12, 2024 @02:52AM (#38965286)
What's the practical accuracy achievable using models?
Re:Edge Detection for Image Processing by eurekin on Friday January 12, 2024 @04:33AM (#38965958)
Just a single anecdotal data point, how good the result can be:

https://www.youtube.com/watch?v=Nnpm-rJfFjQ

The accuracy is probably quite bad, when looked at individual manipulations, but the overall result is jaw dropping - even, if it's only a demonstration

Re:Edge Detection for Image Processing by TacticalCoder on Friday January 12, 2024 @07:56AM (#38967414)
> Nowadays, computers are big/fast enough (GPUs) that building models that learn edge detection implicitly and do segmentation or the end task directly is feasible.

Wouldn't re-using Meta's SAM (Segment Anything Model) be sufficient here? (which is freely available and, I think, free to use?) Or do you think you need to build your own model specifically for detection bills/sheets of paper?

Re:Edge Detection for Image Processing by idorosen on Saturday January 13, 2024 @12:32AM (#38977600)
Yeah, where licensing allows it, reusing existing model weights (possibly continuing to train on your specific task) is reasonable. I was just pointing out that these methods aren’t SOTA anymore.
Re:Edge Detection for Image Processing by nomel on Friday January 12, 2024 @04:15PM (#38974189)
> Still fun to learn about Hough transforms, canny edge detection, and all that 1990s computer vision though!

In my domain of metrology, this part isn't acceptable:

> you will get a model that can predict the exact edges of every input image.

Prediction is a nice way to limit the space I have to consider for a proper edge detection, but usually it's better to just go straight to something more deterministic.