akshitagupta15june / Face-X

Demonstration of different algorithms and operations on faces. Star the repo⭐
https://discord.gg/QapWBRZbVe
MIT License
732 stars 597 forks source link

Facial recognition using SURF #228

Closed akshitagupta15june closed 3 years ago

akshitagupta15june commented 3 years ago

SURF is another robust algortihm used for robust classification of 3d constructions.

We should try out this algorithm as well for recognising facial expressions

Reference : https://people.ee.ethz.ch/~timofter/publications/Knopp-ECCV-2010.pdf

Preeti2095 commented 3 years ago

I want to work on this issue under gssoc'21.

akshitagupta15june commented 3 years ago

Ok assigning you

Preeti2095 commented 3 years ago

I am getting an error on following code:-

gray=cv2.cvtcolor(img,cv2.COLOR BGR2GRAY)

error

Traceback (most recent call last) error: OpenCV(3.4.2) c: \miniconda3\conda-bld\opencv- suite 1533649848492\work\modules\imgproc\src\color.hpp:253: error: (-215:As sertion failed) vscn::contains(scn) && VDCN::contains(dcn) && VDepth : contains(depth) in function "cu::cvtHelperestruct ev::Set <3,4,-1), struct cv::Set<1,-1,-1), struct ev:Set<0,2,5>,2::cvtHelper

How to resolve this?

akshitagupta15june commented 3 years ago

it should be like this gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

Preeti2095 commented 3 years ago

Nothing happened, same error. ![Uploading IMG_20210305_181917.jpg…]()

akshitagupta15june commented 3 years ago

have you added all modules which are required in this task.

Preeti2095 commented 3 years ago

I have imported cv2 module and I have checked I have opencv and opencv_contrib both. Do I have to add something else also?

akshitagupta15june commented 3 years ago

you should add OpenCV-python

akshitagupta15june commented 3 years ago

are you taking any reference from somewhere?

Preeti2095 commented 3 years ago

I saw a github issue same as mine but unable to figure it out how to solve. Can I share that github issue link?

akshitagupta15june commented 3 years ago

yes please share

Preeti2095 commented 3 years ago

https://github.com/llSourcell/Object_Detection_demo_LIVE/issues/6

akshitagupta15june commented 3 years ago

yes so have you given the correct image name? or have you tried this use x = np.asarray(x, dtype=np.uint8) before do the conversion

Preeti2095 commented 3 years ago

Yes image name is correct but didn't tried this solution. Let me do this and then I will come back to you.

Preeti2095 commented 3 years ago

Nothing happened and my img is already in uint8... this didn't helped me and according to that github issue it said that all the img array values should be between 0-1 range and I have all 0-255 range. So that might be creating the problem and if so then I am unable to figure out how to do that.

Preeti2095 commented 3 years ago

So for converting the range from 0-255 to 0-1, I divided the array with 255 but still no improvement.

akshitagupta15june commented 3 years ago

can you send me full code what you are writing

Preeti2095 commented 3 years ago

import cv2 import matplotlib.pyplot as plt import numpy as np

img=cv2.imread('G:/butterfly.jpg',0) surf=cv2.xfeatures2d.SURF_create() gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

Preeti2095 commented 3 years ago

I wrote the codes in wrong order that's why values were changing and cvtColor() was not taking the values correctly and hence the error. Correction:- np.uint8 line should come after imread () and then cvtColor() line. Now it is working. Thank you.

akshitagupta15june commented 3 years ago

Great you debugged it yourself well done!

Preeti2095 commented 3 years ago

Thank you😊 and do I have only 1 week to submit the PR??

Hamza3226 commented 3 years ago

Hello, I am a GSSOC'21 participant and would like to contribute to this project.

Preeti2095 commented 3 years ago

I have created the surf project but I am not getting the desired result. What should I do? @akshitagupta15june