Find local maximum and minimum of each edge in an edge map (row-wise)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi everyone!
I'll start off by saying I'm new to MATLAB, and this is the first time I'm trying an application related to image processing.
What I'm trying to achieve is building an application that measures the quality of an image. I'm following the method proposed by Marziliano et al in their paper "A no-reference perceptual blur metric".
Here, they first convert the original image to a gray-scale image, then use an edge detector to generate the edge map (I'm using the Canny edge detector). The resultant binary map is traversed row-wise, looking for a pixel corresponding to an edge. If found, the local min and max are searched for. Then the edge width is calculated (localMax - localMin) and numOfEdges is incremented by one. Then the search continues to the next pixel, until the final pixel is reached. At this point the totalEdgeWidth is divided by the total numOfEdges. This is the quality measurement.
I have, so far got the edge map using the Canny edge detector. I need to know; 1. How to traverse the binary image pixel-wise and row-wise looking for an edge. 2. Find the local min and max for the edge found.
Appreciate any help. Thanks in advance :)
0 commentaires
Réponses (1)
Image Analyst
le 15 Mai 2014
I'd think you just multiply your edge map by what you get from rangefilt().
rangeImage = rangefilt(grayImage);
out = cannyEdgeMap .* rangeImage;
In out, at each pixel, you'll have the (localMax - localMin). If you need max and min separately, you'll have to do the same thing but with imdilate() and imerode() instead of rangefilt().
5 commentaires
Image Analyst
le 17 Mai 2014
Let's say your image around some particular pixel is this
2 3 8
4 8 9
2 8 9
Let's say you ran rangefilt on that. The min is 2 and the max is 9, so the range is 7. So the center pixel in the output image would be 7. But since you ran rangefilt over the whole image, the other output pixels will also have values, I just showed you how ONE of them was arrived at. So let's say rangefilt output at that location looked like
6 8 9
4 7 3
4 9 8
Notice the 7 at the center, which is the one I showed you how it was calculated. The others were computed with a similar process, just with the window centered on those other pixels and considering other pixels not shown since I was just showing a small chunk of the image.
Now let's say that you have an edge image and at that location it looked like
0 0 1
0 1 0
0 1 0
So to get the range (max-min) at only the edge pixels (the pixels that are 1) you want to multiply
6 8 9 0 0 1 0 0 9
4 7 3 * 0 1 0 = 0 7 0
4 9 8 0 1 0 0 9 0
So now you're getting the range values only where the edges are and nowhere else.
Kushal Virupakshappa
le 10 Jan 2023
I dont think he is asking for the range of local value rather the pixel location where max and min are
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!