logo

为什么openmv会把二维码识别成人脸??

2021-02-17 19:28
U
hugx

把二维码和人脸检测代码结合了下,结果二维码被识别成人脸了??

2021-02-19 14:59
I
网红小智智 星瞳科技

你的代码是什么?我测试一下。

2021-02-28 11:11
U
hugx
import sensor, image, time

sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # use RGB565.
sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
sensor.skip_frames(10) # Let new settings take affect.
sensor.set_auto_whitebal(False) # turn this off.
clock = time.clock() # Tracks FPS.

face_cascade = image.HaarCascade("frontalface", stages=25)



while(True):


    clock.tick() # Track elapsed milliseconds between snapshots().
    img = sensor.snapshot() # Take a picture and return the image.
    
    objects = sensor.snapshot().to_grayscale().find_features(face_cascade, threshold=0.75, scale=1.35)
   
    if objects:
        print("检测到人脸")
    
    for code in img.find_qrcodes():
        message = code.payload()
        print(message)
    
    
   

麻烦看下
U
hugx

@kidswong999

import sensor, image, time

sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # use RGB565.
sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
sensor.skip_frames(10) # Let new settings take affect.
sensor.set_auto_whitebal(False) # turn this off.
clock = time.clock() # Tracks FPS.

face_cascade = image.HaarCascade("frontalface", stages=25)



while(True):


    clock.tick() # Track elapsed milliseconds between snapshots().
    img = sensor.snapshot() # Take a picture and return the image.
    
    objects = sensor.snapshot().to_grayscale().find_features(face_cascade, threshold=0.75, scale=1.35)
   
    if objects:
        print("检测到人脸")
    
    for code in img.find_qrcodes():
        message = code.payload()
        print(message)
2021-03-02 10:16
U
hugx

您好,代码已经在前一楼附上,可否快些回复我,谢谢

2021-03-02 16:33
I
网红小智智 星瞳科技

应该是误判了,haar有时候会误判。

2021-03-02 17:10
U
hugx

@kidswong999 好吧,有什么办法补救吗