Connect lcd to Face_Detection

General discussion about topics related to OpenMV.
DavidMactavish
Posts: 14
Joined: Tue Sep 26, 2017 7:43 pm

Connect lcd to Face_Detection

Postby DavidMactavish » Tue Sep 26, 2017 7:53 pm

hi
Please help me Connect LCD to Face_Detection . :!: :?:
please Source code
:roll: :roll: :roll: :roll: :roll:
User avatar
iabdalkader
Posts: 380
Joined: Sun May 24, 2015 3:53 pm

Re: Connect lcd to Face_Detection

Postby iabdalkader » Tue Sep 26, 2017 8:23 pm

Hi, you just need to add the following to the face detection example:

Code: Select all

import lcd

lcd.init() # Initialize the lcd screen. (before loop)
And send images to LCD:

Code: Select all

lcd.display(img) # display the image.
Full script:

Code: Select all

import sensor, time, image, lcd

# Reset sensor
sensor.reset()

# Sensor settings
sensor.set_contrast(1)
sensor.set_gainceiling(16)
# HQVGA and GRAYSCALE are the best for face tracking.
sensor.set_framesize(sensor.HQVGA)
sensor.set_pixformat(sensor.GRAYSCALE)
lcd.init()


# Load Haar Cascade
# By default this will use all stages, lower satges is faster but less accurate.
face_cascade = image.HaarCascade("frontalface", stages=25)
print(face_cascade)

# FPS clock
clock = time.clock()

while (True):
    clock.tick()

    # Capture snapshot
    img = sensor.snapshot()

    # Find objects.
    # Note: Lower scale factor scales-down the image more and detects smaller objects.
    # Higher threshold results in a higher detection rate, with more false positives.
    objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.25)

    # Draw objects
    for r in objects:
        img.draw_rectangle(r)

    lcd.display(img)
    # print FPS
    print(clock.fps())
DavidMactavish
Posts: 14
Joined: Tue Sep 26, 2017 7:43 pm

Re: Connect lcd to Face_Detection

Postby DavidMactavish » Tue Sep 26, 2017 8:51 pm

Thank you very much.

Return to “General Topics”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests