请问我想引用Python中有的库但是micropython 里面没有定义的库该咋写?
W
wang123
@wang123
0
声望
12
楼层
1101
资料浏览
0
粉丝
0
关注
wang123 发布的帖子
-
RE: 关于自己训练的xml文件运行的问题
@yuan 我把自己训练的xml文件弄小之后还是这样,但是我用openmv自带的cascade文件就没错,源码自带的cascade文件有啥特别的吗?自带的cascade是用哪个xml 文件转化的?
-
RE: 关于自己训练的xml文件运行的问题
@yuan [链接文本](链接:https://pan.baidu.com/s/1Igr8GGKff_r-rmGJiOg8gQ 密码:s5th)
-
RE: 关于自己训练的xml文件运行的问题
我先用openmv_cascade.py将自己训练出来的xml文件转成cascade文件,然后将文件添加到根目录里面,
再将“eye”改成文件名,如下:
eyes_cascade = image.HaarCascade("haarcascade_eye.cascade", stages=24)
然后运行程序时,画面没有检测到目标时程序正常运行,只要一检测到目标,程序就自己退出来了,我觉得是下面这个函数检测的问题,
eyes = img.find_features(eyes_cascade, threshold=0.1, scale_factor=500) -
RE: 关于自己训练的xml文件运行的问题
下面是我的代码:
import sensor, time, image, uio import sys,os,uos iiii = {0}; # Reset sensor sensor.reset() # Sensor settings sensor.set_contrast(3) sensor.set_gainceiling(16) # Set resolution to VGA. sensor.set_framesize(sensor.VGA) sensor.set_brightness(-3) # Bin/Crop image to 200x100, which gives more details with less data to process sensor.set_windowing((220, 190, 200, 100)) sensor.set_pixformat(sensor.GRAYSCALE) # Load Haar Cascade # By default this will use all stages, lower satges is faster but less accurate. #eyes_cascade = image.HaarCascade("eye", stages=24) #eyes_cascade = image.HaarCascade("frontalface.cascade", stages=24) eyes_cascade = image.HaarCascade("haarcascade_eye.cascade", stages=24) print(eyes_cascade) #print("frontalface") print("haarcascade_eye") # FPS clock clock = time.clock() while (True): clock.tick() # Capture snapshot img = sensor.snapshot() time.sleep(250) # Find eyes ! # 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. eyes = img.find_features(eyes_cascade, threshold=0.1, scale_factor=500) # Find iris for e in eyes: iris = img.find_eye(e) img.draw_rectangle(e) img.draw_cross(iris[0], iris[1]) # Print FPS. # Note: Actual FPS is higher, streaming the FB makes it slower. #print(eyes_cascade)
-
RE: openmv如何向opencv一样读取haarcascade_smile.xml
@yuan 请问你运行自己的cascade文件时,运行到feature函数时程序没有自己退出来吗?