Sobel Edge Detection Threshold value single vs uint8 image
显示 更早的评论
I have a Simulink model that does edge detection using the Edge Detection Block with the Sobel algorithm. I have found a good Threshold to get the level of detection that I want. For the application, my image source will change from single to unit8. I can not find a Threshold in uint8 that gives me the equivalent result as the one I use in single.
I made an example Simulink file and attached it here to show what I mean. On the top is my current solution, using an image in datatype single and Sobel Threshold 0.1 that gives me a good edge detection. On the bottom is my future solution where the image datatype has changed to uint8. I tried many different values for the Sobel Threshold but I can not find one that gives me a similar result as in the top path.

In the following screenshot, I show the images and detected edges:

I am aware that converting the image to datatype single would probably enable me to get the current performance, but I want to avoid that step due to memory/processing power constraints.
4 个评论
The documentation says that the threshold and image must match in class. I wouldn't be surprised if it were treating the uint32 input as most tools treat any other image array. That is, values are expected to be given with respect to the interval [intmin intmax].
If that's the case, then the threshold would only be 26 if it were uint8. If it's uint32, it would be (2^32-1)*0.1.
I don't have this toolbox, so I can't prove any of this.
Matthias von Andrian
2023-4-20
DGM
2023-4-20
Yes, but the threshold value is uint32, not uint8.
Matthias von Andrian
2023-4-20
采纳的回答
更多回答(1 个)
Image Analyst
2023-4-20
0 个投票
I don't know Simulink but Sobel has a fixed filter size that may not scale well with the size/width of the edges in your particular image. It would be better to use a DOG filter (difference of Gaussians). You can tailor the width of the Gaussians to optimize for the size and sharpness of edges in your image.
类别
在 帮助中心 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

