0
$\begingroup$

I am implementing A No-Reference Perceptual Blur Metric paper.

Somewhere in the prep steps they mention the use of vertical Sobel filter for finding vertical edges.

The algorithm is summarized in Fig. 1. First we apply an edge detector (e.g. vertical Sobel filter) in order to find vertical edges in the image. We then scan each row of the image1.

I am using scipy.ndimage.sobel(y, axis=1) on Y component of the image as suggested in the paper. But to be honest I don't know how should I interpret this output to decide if there is an edge in this area or not.

Basic idea of the solution from the paper is summarised in this graph:

enter image description here

So I think I understand how to calculate the edge width using the algorithm but to be able to do that I need to know the location for the green dashed line. I think this is what Sobel filter gave them or interpreting the results of scipy.ndimage.sobel(y, axis=1) will give me.

How will I be able to identify the locations of green dased lines from the output of scipy.ndimage.sobel(y, axis=1).

$\endgroup$

2 Answers 2

0
$\begingroup$

I might be wrong, but I think the red line is actually discrete line segments, and it looks like the green dashed lines are placed two red segments away from a local max or local min. Otherwise, I think the idea is that you take two equidistant lines, some distance away from the local min or max.

$\endgroup$
2
  • $\begingroup$ The way how I see it is that the X axis is the position of pixel from selected row of the image after applying Sobel filter. You are looking at section of that row from 140 to 180 pixels. Y axis is just value of that pixel from 0 to 255. So red line is just a function of pixel position in a row and pixel color value. There are many minima and maxima indicating change of the gradient in that section but there are only few positions marked as possible edges. I dont think the edges are marked by some equidistance logic. Maybe there are some thresholds involved. But I might be wrong. $\endgroup$ Commented Jun 18, 2022 at 19:19
  • $\begingroup$ The main idea of the algorithm is that blurred images result in wider edges, when you calculate average width off the edges in the image. $\endgroup$ Commented Jun 18, 2022 at 19:23
0
$\begingroup$

The paper does not describe how the edge location is chosen ("vertical Sobel filter" is not sufficient), but it seems that only the edge width is used (distance between extrema). So it could be that the green annotation was made by hand. You should not worry.

$\endgroup$
1
  • $\begingroup$ Makes sense. I actually finished the project and it works pretty well. At the end I introduced the "edge detection" into it by taking absolute value of Sobel filter result in y direction and thresholding the edge on .95 percentile. So I consider edge being and edge if absolute value of its derivative in y deirection lies above .95 percentile. For my use case it works and it cuts down number of required calculations a lot. $\endgroup$ Commented Jul 19, 2022 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.