logo

img.get_histogram(bins=16) bins>16 openmv会重启,运行不了

2021-03-06 10:25
H
ozrw

img.get_histogram(bins=16) bins>16 openmv会重启,运行不了,但bins太小又精度不够

2021-03-08 17:46
I
网红小智智 星瞳科技

如果涉及代码,需要报错提示与全部代码文本,请注意不要贴代码图片

2021-03-08 21:07
H
ozrw
sensor.reset()                         # 复位并初始化传感器。

sensor.set_contrast(3)
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
#设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种

sensor.set_framesize(sensor.QQVGA)      # 将图像大小设置为QVGA (320x240)

#sensor.set_windowing((64, 64))       # 设置128 x128窗口。
sensor.skip_frames(time=100)
sensor.set_auto_gain(False)
sensor.set_auto_exposure(False)

while(True):
    clock.tick()                    # 更新FPS帧率时钟。
    img = sensor.snapshot()         # 拍一张照片并返回图像。
    histogram = img.get_histogram(bins=16)
    threshold = img_his.get_threshold().value()

bins如果大于16的话 openmv会重启,运行不了,但bins太小threshold又精度不够,请问怎么解决呢?

H
ozrw

@kidswong999

2021-03-09 16:17
I
网红小智智 星瞳科技

你的代码运行不了,你自己先运行试试。

2021-03-09 23:21
H
ozrw

@kidswong999

2021-03-09 23:28
H
ozrw

@ozrw 在 [img\.get\_histogram\(bins=16\) bins>16 openmv会重启,运行不了](/post/19190) 中说:

> 最后一行的 请在这里粘贴代码 要删掉,编辑不了了

2021-03-10 12:48
H
ozrw

@kidswong999

是这个

import sensor, image, time, os
sensor.reset() 
sensor.set_contrast(3)
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
#设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种

sensor.set_framesize(sensor.QQVGA)      # 将图像大小设置为QVGA (320x240)

sensor.skip_frames(time=100)
sensor.set_auto_gain(False)
sensor.set_auto_exposure(False)
clock = time.clock()                # 创建一个时钟对象来跟踪FPS帧率。

while(True):
    clock.tick()                    # 更新FPS帧率时钟。
    img = sensor.snapshot()         # 拍一张照片并返回图像。
    histogram = img.get_histogram(bins=64)
    threshold = histogram.get_threshold().value()
2021-03-10 16:42
I
网红小智智 星瞳科技

我运行这个代码没有重启,

你用的是什么版本的硬件?

什么版本的固件?

2021-03-10 21:35
H
ozrw

@kidswong999

3.15.0

2021-03-11 18:03
I
网红小智智 星瞳科技

目前最新的是v3.9.3,哪来的3.15.0。

硬件是什么?