shaoguangcheng / faceFrontalization

Align a face in profile to front view
56 stars 37 forks source link

Points #1

Open maxsombra opened 9 years ago

maxsombra commented 9 years ago

hi

what is the minimal LandMarks of the face that the shystem need?

shaoguangcheng commented 9 years ago

Hi! I implemented this system according to paper "Effective Face Frontalization in Unconstrained Images" and I used 49 facial feature points (detected by SDM detector which suggested in the paper) which were included in 'data/facialFeaturePoints.yml'. The facial feature points were used to calculate the parameters of the camera. I didn't try to test the minimal landmarks number. But I think the number of landmarks can not be too small.
Hope this can help you.

shaoguangcheng commented 9 years ago

Thank you for your information about my C++ code.

I test again the code on my computer and it runs well. You can see the snapshot in the attached file.

Before running the code, you should modify the "refU.txt" path in 3DModel/model3D.yml according to your settings. Do you do that ? (otherwise, you will see "line: 73, file: ../frontalUtil.cpp, message: open /home/cheng/workshop/github/faceFrontalization/3DModel/refU.txt error")

If you have some other questions, please leave a message.

Best

2015-07-15 9:53 GMT+08:00 YorkLeeSIAT notifications@github.com:

Hi thanks for your code! But the C++ code running result is not the same as your example, you can view those comment in the link: http://www.thinkface.cn/thread-3740-1-1.html

— Reply to this email directly or view it on GitHub https://github.com/shaoguangcheng/faceFrontalization/issues/1#issuecomment-121454804 .

tabsun commented 9 years ago

I create a VS2012 project and get the correct result. So the code is correct, the most possible reason for @YorkLeeSIAT is refU file path as the author pointed out.

tabsun commented 9 years ago

OK,I got the answer. If you see this error like @YorkLeeSIAT ,it's because of difference of variables' initialization under Debug/Release or Windows/Linux environment or different compile tools. Edit the following code in calib.cpp:

double distortion[4]; int calibFlags; imagePoints = 0; You should init the 'distortion' to 0 like I do,then it will be correct !

shaoguangcheng commented 9 years ago

Thank you for the discussion @YorkLeeSIAT @tabsun.

I will fix this bug in original code.

shaoguangcheng commented 9 years ago

@YorkLeeSIAT Very thanks for your carefulness! I have corrected the error you pointed out.

2015-07-27 12:16 GMT+08:00 YorkLeeSIAT notifications@github.com:

@shaoguangcheng https://github.com/shaoguangcheng hi ,during debugging my project,I found another mistake.function "frontalizeWithoutSymmetry" in your file "frontalization.cpp" should be modified like this:

// if the projection point is out of plane, record it
if(std::min(tmpProjectionPtr2[0], tmpProjectionPtr2[1]) < 1.0 ||
        tmpProjectionPtr2[0] >= (queryWidth-1) ||
        tmpProjectionPtr2[1] >= (queryHeight-1))
    badPoint.insert(i);

if not, code will be coprrupted for at this location: tmp1 = src.at(x, y); tmp2 = src.at(x, y+1); tmp3 = src.at(x+1, y); tmp4 = src.at(x+1, y+1);

— Reply to this email directly or view it on GitHub https://github.com/shaoguangcheng/faceFrontalization/issues/1#issuecomment-125080771 .

kyw920 commented 9 years ago

Hello, I downloaded the whole project, and it seems to be working well (with your test picture).

But how can I make it work on general pictures?

Do I need facialPointsFile(yml) and 3DModelFile for each queryImage?

If so, how can I do it?

I cant find a usable SDM library...

ddrun commented 8 years ago

@kyw920 SDM should be the algorithm of paper--Supervised Descent Method and its Applications to Face Alignment, already achieved like https://github.com/patrikhuber/superviseddescent

hyer commented 8 years ago

Work well on Linux. Thx!

zhanlv600 commented 7 years ago

您好,想问一下49个点是怎么来的,我用的landmark检测得到的都是68个点。