logo

openmv4H7无法运行人脸识别官方例程

2025-06-24 10:25
J
rdco

import sensor

import time

import image

# Reset sensor

sensor.reset()

# Sensor settings

sensor.set_contrast(3)

sensor.set_gainceiling(16)

# HQVGA and GRAYSCALE are the best for face tracking.

sensor.set_framesize(sensor.HQVGA)

sensor.set_pixformat(sensor.GRAYSCALE)

# Load Haar Cascade

# By default this will use all stages, lower satges is faster but less accurate.

face_cascade = image.HaarCascade("/rom/haarcascade_frontalface.cascade", 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)

# Print FPS.

# Note: Actual FPS is higher, streaming the FB makes it slower.

print(clock.fps())

这一行

face_cascade = image.HaarCascade("/rom/haarcascade_frontalface.cascade", stages=25)报错,OSError: [Errno 19] ENODEV。

2025-06-24 18:10
I
网红小智智 星瞳科技

固件升级到最新版本4.7.0

2025-06-24 18:17
J
rdco

已经是v4.7.0版本了

J
rdco

@kidswong999 就是v4.7.0固件版本,还是报同一个错误

2025-06-24 19:23
I
网红小智智 星瞳科技

我测试了,没问题。

3f19726e-97d6-4a93-b4fe-a443c2b8d822.PNG
I
网红小智智 星瞳科技

升级必须要连着bootloader都升级才行,IDE升级有提示的。

2025-06-24 21:41
J
rdco
83db868d-afc0-4fae-8a06-aaa7b3a94e9d.png
2025-07-03 15:37
J
a4cd

我也是这样报错,请问解决了吗?

2025-07-05 23:15
J
rdco

@a4cd 解决了把固件烧回到4.6.0版本,就好了

2025-07-07 11:58
J
nedw
6c1e76b7-0af4-48c0-959a-e40ecc6c3a9d.png
2025-07-10 14:52
Z
星小瞳xs

更新到最新固件,实测H7 plus在4.7.0下不会出错:https://singtown.com/cn/learn/49997

2025-09-10 15:27
2
2mj7srr6gw8z

最新固件H7 plus也是会出错

2025-09-12 17:45
Z
星小瞳xs

问题已经解决:打开OPENMV IDE,点击固件版本重新安装固件,或者使用DFU的方式,选择擦除FLASH后烧录。 实测在重新烧录固件后可以正常使用。烧录前和烧录后都是4.7.0,重新烧录前的会报错,重新烧录后的不会报错 意思是使用最新的历程:

https://book.openmv.cc/example/03-Machine-Learning/02-Haar-Cascade/face_detection.html

image
image