@kidswong999 ok了!!! 完美的想哭, 我换成灰度图了
15659670865
@15659670865
0
声望
15
楼层
1006
资料浏览
0
粉丝
0
关注
15659670865 发布的帖子
-
RE: 使用“histogram.get_threhsold()”函数后怎么传给“ img.binary”
-
怎么使用“threshold.value()”拿出阈值.
利用“histogram.get_threshold()”得到最佳阈值后,想使用“threshold.value()”拿出阈值,失败了..
THRESHOLD = [0, 100] # Grayscale threshold for dark things... BINARY_VISIBLE = True # Does binary first so you can see what the linear regression # is being run on... might lower FPS though. import sensor, image, time from pyb import LED sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQQVGA) # 80x60 (4,800 pixels) - O(N^2) max = 2,3040,000. sensor.skip_frames(time = 2000) # WARNING: If you use QQVGA it may take seconds clock = time.clock() # to process a frame sometimes. LED(1).on() LED(2).on() LED(3).on() while(True): clock.tick() img = sensor.snapshot().lens_corr(strength = 0.5, zoom = 1.0) img.gaussian(3, unsharp=True) histogram = img.get_histogram()#得到直方图 Thresholds = histogram.get_threshold()#得到最佳阈值 THR=threshold.value()#获取当前阈值 #img.binary([THRESHOLD])if BINARY_VISIBLE else sensor.snapshot() line = img.get_regression([(255,255) if BINARY_VISIBLE else THRESHOLD], robust = True) if (line): img.draw_line(line.line(), color = 127)
-
关于巡线阈值选择,怎样提高阈值的准确性
想做一个巡线小车,用的是手动阈值,发现这个阈值太依赖环境了,换个环境就很不准确了,不知道怎么办,
尝试使用自适应阈值,但是非目标颜色也会选中 -
RE: 使用“histogram.get_threhsold()”函数后怎么传给“ img.binary”
import sensor, image, time,machine from pyb import LED sensor.reset() sensor.set_vflip(False) sensor.set_hmirror(False) sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) # 80x60 (4,800 pixels) - O(N^2) max = 2,3040,000. #sensor.set_windowing([0,20,80,40]) sensor.skip_frames(time = 2000) # WARNING: If you use QQVGA it may take seconds clock = time.clock() # to process a frame sometimes. LED(1).on() LED(2).on() LED(3).on() while(True): clock.tick() img = sensor.snapshot().lens_corr(strength = 0.5, zoom = 1.0) #img=sensor.snapshot().save("lvbo_2.jpg") #获取图像 img.bilateral(3,color_sigma=0.1,space_sigma=0.1)#采用双边滤波 img.gaussian(3, unsharp=True,)#图像消除锐化 histogram = img.get_histogram() Thresholds = histogram.get_threshold() img.binary(threshold) print(Thresholds) #line = img.get_regression([(100,100,0,0,0,0)], robust = True) #if(line):img.draw_line(line.line(), color = 127) #print(clock.fps()
-
RE: openmv如何读取sd卡里的图片并且显示在缓冲区中,使用image函数,但是一直报错
![0_1556510520615_timg.bmp](正在上传 100%)
-
RE: openmv如何读取sd卡里的图片并且显示在缓冲区中,使用image函数,但是一直报错
我更改了图片格式以及大小,依旧持续报错,主要原因应该是那句“copy_to_fb=True”,不执行这一句,不报错
@kidswong999 -
RE: openmv如何读取sd卡里的图片并且显示在缓冲区中,使用image函数,但是一直报错
我更改了图片格式以及大小,依旧持续报错,主要原因应该是那句“copy_to_fb=True”,不执行这一句,不报错
@15342342443 -
使用“histogram.get_threhsold()”函数后怎么传给“ img.binary”
想使用OTSU算法,找到了“histogram.get_threhsold()”函数,但是在传参数的时候一直报错,希望大佬解救