ishwarrimal / faceRegconition

Its a project on OpenCV for automatic attendance updating using face recognition with python.
33 stars 18 forks source link

#Error #4

Open gangubai opened 5 years ago

gangubai commented 5 years ago

attendance-management-using-face-recognition$ python3 firstpage.py Exception in Tkinter callback Traceback (most recent call last): File "/home/ankitakulkarni/anaconda3/lib/python3.6/tkinter/init.py", line 1699, in call return self.func(*args) File "captureimage.py", line 92, in enter_the_value main_program(usn) File "captureimage.py", line 41, in main_program cv.imshow('image',img) TypeError: mat is not a numerical tuple

initially showImage was not working so instead of that I used cv.imshow which is used normally in all codes..Also I didn't get any info about usn error..here is the snippet of the code ..

def main_program(usn):

cap = cv.VideoCapture(0)

while(True):

    img=cv.VideoCapture.read(cap)    
    cv.imshow('image',img)
    k=cv.WaitKey(10)
    if k==27:

        break
    elif k==ord('c'):

        time=datetime.now()

        cv.SaveImage("/home/ankitakulkarni/Documents/faceRegconition-master/attendance-management-using-face-recognition/face/database/image.png",img)

        cv.DestroyAllWindows()

        os.system("python3 face.py")

        path="/home/ankitakulkarni/Documents/faceRegconition-master/attendance-management-using-face-recognition/face/database/image.png"

        if os.path.exists(path):

    #renaming the file with the usn along with the current date stmp for making it unique
            newPath="/home/ankitakulkarni/Documents/faceRegconition-master/attendance-management-using-face-recognition/face/database"+usn+str(time.month)+str(time.day)+str(time.hour)+str(time.minute)+str(time.second)+str(time.microsecond)+".png"

            #path1="c:python27/face/database/"+usn+".png"

            cmd=os.rename(path,newPath)

            print ("image captured, resized and renamed successfully")

            #cv.ShowImage("image","face/database"+usn+exp+".png")

        else:

            print ("no face detected......image deleted")
gangubai commented 5 years ago

Also how training and testing is done in your project as usually it requires a lot of time for training so how after updatation of database like after adding new entries in it??In short what is the flow of your project??