Regarding Face Recognation Project

after getting my facial image pixels from the image or frame which will be a numpy 3d Matrix as it is a coloured image how can i reshape the size of the matrix ?? in the video by prateek bhaiya he has done something like this

face_section=frame[y-offset:y+h+offset ,x-offset:x+w+offset]

got my face_section pixels

face_section=cv2.resize(face_section,(100,100))

how can we resize this 3d matrix into (100,100) 2d matrix and what if there were more pixels than 100*100 or less

plz help me with this

Hey @amankharb, cv2.resize function is used for resizing the images, so when you are specifying,

face_section=cv2.resize(face_section,(100,100))

Than cv2.resize will only change the height and width of the face_section. If the face_section contains three channels than the resultant image will also contain 3 channels. means face_section.shape after this command will be ( 100,100,3) only. So keep in mind that resize function will only change height and width and it keeps number of channels same.

Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section. :blush:

does this resizing to (100,100) reduces the quality of the image

i mean originally there were some 375*499 pixels and now we reduce it to (100,100) what effect does it have on the image??

Hey @amankharb, yes of course, the quality of image will get reduces. Its just like, watching a video in 144px on youtube and watching same video on 360px.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.