Книга: OpenMV Development Workshop
Назад: 9.2 Finding Objects
Дальше: Source Code

9.3 Face Detection

In this section, we try Haar Cascade to apply face detection on OpenMV. We load frontalface for data. Then, we call find_features() to find face objects. If found, we draw rectangles using draw_rectangle().

For demo, open OpenMV IDE and write the complete codes.

import sensor, image  sensor.reset()  sensor.set_contrast(1) sensor.set_gainceiling(16) sensor.set_framesize(sensor.HQVGA) sensor.set_pixformat(sensor.GRAYSCALE)  # Load Haar Cascade face_cascade = image.HaarCascade("frontalface", stages=25) print(face_cascade)   while (True):      img = sensor.snapshot()     objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.25)      # Draw objects     for r in objects:         img.draw_rectangle(r) 


Save this program as face_detection.py.

Run this program to OpenMV IDE. Shot your face or people picture.

Based on my experience, it's good performance to detect face detection even I have tested on picture on smartphone.

o9-4










Назад: 9.2 Finding Objects
Дальше: Source Code

Kirajes
Здесь можно Suninat 50mg (Сунитиниб) - Сунинат (Sunitinib) - аналог Сутент купить. Лекарство назначают больным, страдающим от онкологии желудка, кишечника, поджелудочной железы, полипов толстой кишки, новообразований в почке и прочих злокачественных опухолей, связанных с желудочно-кишечным трактом. сутент купить +в москве