Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential_Bug_ACC_CONST #14

Open
braca51e opened this issue May 4, 2017 · 3 comments
Open

Potential_Bug_ACC_CONST #14

braca51e opened this issue May 4, 2017 · 3 comments

Comments

@braca51e
Copy link

braca51e commented May 4, 2017

First I'd like to thank you sharing the code.

I have been reviewing and when I tested a near-frontal image I got a very ugly result. After checking the code I realized that if the occlusion between both sides does not exceed 800 then the returned images are the sames. If the occlusion is bigger than 800 in the if statement, line 93 frontalize.py, there is a check for values bigger than 255 which is not the case for else. Do not if somebody already mentioned it.

Thanks.

@dougsouza
Copy link
Owner

dougsouza commented May 4, 2017

@braca51e, this constant is used to choose whether to apply soft symmetry or not (hard frontalization is performed anyway). Line 94-95 and 97-98 are used just to clip pixels outside of the boundaries (< 0 or > 255), otherwise you might see glitches in the resulting image.

@braca51e
Copy link
Author

braca51e commented May 4, 2017

Thanks @dougsouza, yes that is actually what I saw when I was using an image that was not exceeding the value ACC_CONST. In the else statement you are not doing the clipping and the output is just glitches. However, I do admit the name of the thread is a little bit misleading.

@dougsouza
Copy link
Owner

@braca51e, yes, you are correct. Clipping should performed in both cases, the clipping lines should be placed after if-else statement and before returning both images. A nice way to do clip is to use np.clip(...):

np.clip(frontal_raw, 0, 255)
np.clip(frontal_sym, 0, 255)

I'll try to fix this later, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants