Question

I am following the instructions of the following paper (basically just page 2):

http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=05649943

As described in the paper, I want to do the following:

  1. I have an image --> Extract face rectangles
  2. Create edge images (using Canny)
  3. Create distance images (using bwdist in MatLab)
  4. Create angle image

The process looks like the following:

enter image description here

And described here:

enter image description here

And I am stuck at step 4: creating the angle image.

I am using Matlab to create the angle image:

im = imread(['face_images/faces/' ims(i).name]);

I = rgb2gray(im);

[Gmag, Gdir]=imgradient(I);
GdirI=(Gdir+180)*(255/360);

imwrite(GdirI, ims(i).name);

end

But I am not getting the images that are presented in the last row in the paper. Do I have to give the edge images as input or the original images? Because I am using the original images right now...

Was it helpful?

Solution

When the gradients magnitude is small the edge angles are poorly defined. I would normally set a threshold on the magnitude and only calculate the angles for the pixels above the threshold. In your case it maybe that you only calculate the angles at the pixels that the cannny filter finds an edge.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top