iBot
iBot

Reputation: 1

OpenCV: Single face detection

Would like to know how can I limit the for loop to work only with the first face, that is faces[0]

#faces here is rectangular co-ordinates. Example
#[((113, 18, 394, 358), 33)] for a single face
    if faces:
         for i in faces:
         #Detection Code here

Upvotes: 0

Views: 513

Answers (1)

spalac24
spalac24

Reputation: 1116

Just do

i = faces[0]

That way you shouldn't have to modify any code after it.

Upvotes: 1

Related Questions