luoyetx / face-alignment-at-3000fps

C++ implementation of Face Alignment at 3000 FPS via Regressing Local Binary Features
BSD 3-Clause "New" or "Revised" License
197 stars 120 forks source link

SimilarityTransform returning identity #4

Open HY1WDW1W opened 8 years ago

HY1WDW1W commented 8 years ago

Hi,

I see that the calcSimilarityTransform() function always returns identity matrix for rotation and only the scale is computed which is also close to 1 in almost all the cases. Is this a bug in the function or is it how it should be ? (Mean face landmarks are always vertical because of the flipped shapes.)

Because, if you use lfpw/afw/helen datasets, there are many cases where the face is not vertical but tilted up to some degrees. It returns identity rotation in these cases as well.

Could you help me with this problem ? Thanks

luoyetx commented 8 years ago
  1. scale and rotate can differ very much, and won't always be identity or close to 1 unless your shape is similar to mean shape.
  2. you can calculate the mean_shape before any data augment which will avoid the vertical problem you mentioned.
mariolew commented 8 years ago

Actually, I wonder why we need such a function i.e. calcSimilarityTransform(), I don't know why we should get a relative delta_shapes for predicting target. Sorry for my silly question.

I can't understand why we need to get a relative delta_shapes for predicting target. I think we can use absolute delta_shape directly for target. // Get relative delta_shapes for predicting target vector getDeltaShapes(vector &gt_shapes, vector &current_shapes

luoyetx commented 8 years ago

@mariolew SimilarityTransform is needed for some reason that other papers are already said.

And for relative delta shapes, it should be relative not absolute. Imagine that you have a face for different size (100x100, 400x400, 600x600 for example). Every face has a shape on it, with extracted features, if delta shape is relative, this three faces will be given the same delta shape which is what we want, but if delta shape is absolute, delta shape can not fit to three different scale unless the feature from these faces are very different which is not what we want to see.

Of course, if you resize all face (training data and test data) to the same size, relative or absolute delta shape doesn't matter I think :)

fourk-ty commented 7 years ago

About the necessity of similarity transform, can you please provide the name of the related papers?