logo

OpenMV IDE重置功能导致软件崩溃故障报告

2025-12-02 21:07
I
igbb059ni4e6

OpenMV IDE重置功能导致软件崩溃故障报告

用户在使用OpenMV IDE时遇到了软件崩溃的问题,具体是在保存人脸图片后执行重置OpenMV Cam操作时发生的。

故障详细描述:

  • 故障现象:保存人脸图片之后,重置openmv cam,软件就崩溃了
  • 故障类型:其他
  • 硬件型号:OpenMV4 H7 Plus
  • 固件版本:4.7.0
  • 连接方式:USB连接到PC
  • 参考文章:分辨不同人脸 · OpenMV中文入门教程 (https://book.openmv.cc/image/face.html)

故障代码:

import sensor
import time
import machine
import os

sensor.reset()  # 初始化sensor
sensor.set_pixformat(sensor.RGB565)  # 设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种
sensor.set_framesize(sensor.QVGA)  # 设置图像像素大小 QVGA (320x240)
sensor.skip_frames(time=2000)  # 让新的设置生效

led = machine.LED("LED_BLUE")

start = time.ticks_ms()
while time.ticks_diff(time.ticks_ms(), start) < 3000:
    sensor.snapshot()
    led.toggle()

led.off()


n=5

while(n):
    img = sensor.snapshot()
    img.save("singtown/s3/%s.jpg"%(n))  # or "example.bmp" (or others)
    os.sync()  # 刷新文件系统缓存,强制写入硬件
    time.sleep_ms(200)
    n -= 1

raise (Exception("Please reset the camera to see the new file."))