Skip to content

Add code to remove black part of faceAligned#38

Open
jae-yong-2 wants to merge 1 commit intoriya-17:masterfrom
jae-yong-2:master
Open

Add code to remove black part of faceAligned#38
jae-yong-2 wants to merge 1 commit intoriya-17:masterfrom
jae-yong-2:master

Conversation

@jae-yong-2
Copy link

@jae-yong-2 jae-yong-2 commented Nov 25, 2020

The black part of the 'faceAligned' img looks bad, so I added a code in FaceRecognizer.py because I wanted to remove it.

@jae-yong-2
Copy link
Author

Hi, @riya-17 ! I want you to check my code once. :)

@riya-17
Copy link
Owner

riya-17 commented Dec 3, 2020

yeah sure @jae-yong-2 give me some time. will try this on weekend. please use the request rewiew option on the right if you want me to review a PR.

Copy link
Author

@jae-yong-2 jae-yong-2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a description of the code I added.

Copy link
Author

@jae-yong-2 jae-yong-2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's my first time doing PR, so please give me good feedback. :)

"shape_predictor": "C:/Users/ljy89/Desktop/FaceRecognition-master/shape_predictor_68_face_landmarks.dat",
"image": "C:/Users/ljy89/Desktop/FaceRecognition-master/input_image.jpg",
"encodings": "C:/Users/ljy89/Desktop/FaceRecognition-master/encodings/encodings.pickle",
"detection_method": "cnn"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed the address my way. I'll put it back if you want.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah please as it will create confusion for other people

area=cv2.boundingRect(gray)
faceAligned = faceAligned[area[1]:area[1] + area[3], area[0]:area[0] + area[2]]

cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 2)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FaceAligned Img had an empty space.
I changed it to gray to find the coordinates of the empty space.

cv2.boundingRect() method found maximum minimum coordinates of the colored part.
and Leave only the colored part.
area[1]=> min row area[0]=>min col
area[3]=> max row area[2]=>max col

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a 'gray= cv2.cvtColor (faceAligned, cv2.COLOR_BGR2GRAY)' code, right above it.

@jae-yong-2
Copy link
Author

hi @riya-17 Can I get some feedback? If you don't like the issue, please tell me.

@riya-17
Copy link
Owner

riya-17 commented Dec 11, 2020

Hey @jae-yong-2 I was planning to look into it on weekend.. So will surely look on it tonight or tomorrow.. sorry for delay.

@riya-17
Copy link
Owner

riya-17 commented Dec 13, 2020

Hey @jae-yong-2 I am facing some errors trying to debug it will update you as soon as possible.

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

Successfully merging this pull request may close these issues.

2 participants