# 画面与程序卡在第一帧，有时运行几秒后卡住

**URL:** <https://forums.openmv.io/t/topic/11555>\
**Category:** Chinese 中文\
**Created:** [March 16, 2026, 6:58am UTC](https://forums.openmv.io/t/topic/11555 "2026-03-16T06:58:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrrrrr](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@lrrrrr](https://forums.openmv.io/u/lrrrrr)\
**Post date:** [March 16, 2026, 6:58am UTC](https://forums.openmv.io/t/topic/11555/1 "2026-03-16T06:58:30Z")

</div>

程序是新建文件自带的，点击左下角开始后画面出现第一帧（有时甚至不会出现）就停止，有时运行几秒后停止，程序运行结果也随之停止。我再次点击左下角希望结束程序却显示忙碌中。我使用的是h7p lu s

 ![IMG_2669](https://canada1.discourse-cdn.com/flex029/uploads/openmv1/original/2X/1/1c32cf7c367e331047022ffecf79e930b7fc1d35.jpeg)x

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 16, 2026, 9:18am UTC](https://forums.openmv.io/t/topic/11555/2 "2026-03-16T09:18:39Z")

</div>

> [@lrrrrr](#):
>
> 程序是新建文件自带的，点击左下角开始后画面出现第一帧（有时甚至不会出现）就停止，有时运行几秒后停止，程序运行结果也随之停止。我再次点击左下角希望结束程序却显示忙碌中。我使用的是h7p lu s

Hi, can you update your firmware to the latest? Do Tools→Install Latest Development Firmware. Also, please use the latest version of OpenMV IDE v4.8.7.

---

<div class="post-metadata">

**Author:** ![lrrrrr](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@lrrrrr](https://forums.openmv.io/u/lrrrrr)\
**Post date:** [March 16, 2026, 11:04am UTC](https://forums.openmv.io/t/topic/11555/3 "2026-03-16T11:04:29Z")

</div>

Thank you for your reply, but it’s still not working. The current situation is that when I click the bottom left corner, the device disconnects.

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 16, 2026, 2:15pm UTC](https://forums.openmv.io/t/topic/11555/4 "2026-03-16T14:15:57Z")

</div>

Can you post a video showing what is happening? The H7 plus is extremely solid. This type of failure likely has some weird cause.

---

<div class="post-metadata">

**Author:** ![lrrrrr](https://avatars.discourse-cdn.com/v4/letter/l/d26b3c/32.png) [@lrrrrr](https://forums.openmv.io/u/lrrrrr)\
**Post date:** [March 20, 2026, 11:07am UTC](https://forums.openmv.io/t/topic/11555/5 "2026-03-20T11:07:06Z")

</div>

sorry, i’m a new user,i can’t post video

i will show you my code

```auto
import sensor
import time

import image

sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QQVGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time=2000) # Wait for settings take effect.ssekuaig
clock = time.clock() # Create a clock object to track the FPS.

白色阈值 = (245, 82)
上一帧坐标 = None
上一帧时间 = None
x方向速度 = 0
y方向速度 = 0

def 主循环():
global 上一帧坐标, 上一帧时间, x方向速度, y方向速度
clock = time.clock()

while True:
    clock.tick()
    当前时间 = time.ticks_ms()

    img = sensor.snapshot()
    白色色块们 = img.find_blobs([白色阈值], merge=False)

    x_str, y_str = "0", "0"
    vx_str, vy_str = "0.00", "0.00"

    if 白色色块们:
        小球 = max(白色色块们, key=lambda b: b.area())
        当前坐标 = (小球.cx(), 小球.cy())
        if 上一帧坐标 is not None and 上一帧时间 is not None:
            时间差 = time.ticks_diff(当前时间, 上一帧时间)
            if 时间差 > 0:
                位移x = 当前坐标[0] - 上一帧坐标[0]
                位移y = 当前坐标[1] - 上一帧坐标[1]
                x方向速度 = 位移x*100/时间差
                y方向速度 = 位移y*100/时间差
                上一帧坐标 = 当前坐标
                上一帧时间 = 当前时间
        else:
            y方向速度 = 0.0
            x方向速度 = 0.0
            上一帧坐标 = 当前坐标
            上一帧时间 = 当前时间

        if 上一帧坐标 is not None:
            x_str = str(int(上一帧坐标[0]))
            y_str = str(int(上一帧坐标[1]))
        else:
            x_str = "None"
            y_str = "None"

        vx_str = "{:.2f}".format(x方向速度)
        vy_str = "{:.2f}".format(y方向速度)

    print(x_str, y_str, vx_str, vy_str)
    img.draw_cross(int(上一帧坐标[0]), int(上一帧坐标[1]), color=(255, 0, 0))
    img.draw_rectangle(小球.rect(), color=(0, 255, 0))

if name == “main”:
try:
主循环()
except KeyboardInterrupt:
print(“程序终止”)

```

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 20, 2026, 8:32pm UTC](https://forums.openmv.io/t/topic/11555/6 "2026-03-20T20:32:13Z")

</div>

I’m not sure if you can use Chinese names for functions and variables reliably. can you post the code with everything using ascii only? I will have an easier time debugging.

---

<div class="post-metadata">

**Author:** ![studyman](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@studyman](https://forums.openmv.io/u/studyman)\
**Post date:** [March 24, 2026, 4:39pm UTC](https://forums.openmv.io/t/topic/11555/7 "2026-03-24T16:39:17Z")

</div>

I’m borrowing the original poster’s thread to raise some of my questions. I also encountered lag issues. The lag occurs after I extract the facial feature points during face recognition. The whole screen freezes, and then the program stops running. I thought it was a firmware issue, but after updating the firmware, new problems appeared. …

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [March 24, 2026, 4:40pm UTC](https://forums.openmv.io/t/topic/11555/8 "2026-03-24T16:40:04Z")

</div>

Hi, we are resolving some issues with the newest protocol. Please use the latest stable firmware until we have these resolved.
