Commit 7f642f78 authored by klorydryk's avatar klorydryk
Browse files

Add log for new face detection with given name

parent f67528be
......@@ -380,7 +380,7 @@ class facetracker:
for fid in self.faceTrackers.keys():
trackingQuality = self.faceTrackers[ fid ].update( resultImage )
#If the tracking quality is good enough, we must delete
#If the tracking quality is not good enough, we must delete
#this tracker
if trackingQuality < 7:
fidsToDelete.append( fid )
......@@ -452,6 +452,13 @@ class facetracker:
( y <= t_y_bar <= (y + h ))):
matchedFid = fid
#We calculate distance between previous and new center of the tracker, to evaluate if the tracker move
#Not working with this method
#centerDistance = ((x_bar - t_x_bar) ** 2 + (y_bar - t_y_bar) ** 2) ** 0.5
#print("Distance : " + str(centerDistance))
#if(centerDistance>8):
#print("Target " + self.faceNames[ matchedFid ] + " is moving")
#If no matched fid, then we have to create a new tracker
if matchedFid is None:
......@@ -474,7 +481,9 @@ class facetracker:
# Directly add name + pass a charset to which name must belong
# "Person " + str(fid)
self.faceNames[ self.currentFaceID ] = randomnames.rand_name_statistic("letters")
randomName = randomnames.rand_name_statistic("letters")
print("New target detected: " + randomName)
self.faceNames[ self.currentFaceID ] = randomName
self.calculateAverageSuspicious(self.faceSuspicion)
......@@ -559,15 +568,7 @@ class facetracker:
if __name__ == '__main__':
# root = tk.Tk()
# screen_width = root.winfo_screenwidth()
# screen_height = root.winfo_screenheight()
# print("Taille écran: " + str(screen_width) + "x" + str(screen_height) )
camera_list = list_available_cameras()
# if screen_width>screen_height:
# if len(camera_list) == 1:
# window_height = screen_height
facetrackerList = []
for camera_id in camera_list:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment