这段代码是用的例程上的源码,但是不能左转是因为啥
import sensor, image, time
import car
from pid import PID
from time import sleep
from pyb import Pin
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(10)
sensor.set_auto_whitebal(False)
clock = time.clock()
green_threshold = (46, 65, -53, -16, 18, 66)
size_threshold = 2000
x_pid = PID(p=0.1, i=1, imax=100)
h_pid = PID(p=0.05, i=0.1, imax=50)
def find_max(blobs):
max_size=0
for blob in blobs:
if blob[2]*blob[3] > max_size:
max_blob=blob
max_size = blob[2]*blob[3]
return max_blob
while(True):
clock.tick()
img = sensor.snapshot()
blobs = img.find_blobs([green_threshold])
if blobs:
max_blob = find_max(blobs)
x_error = max_blob[5]-img.width()/2
h_error = max_blob[2]*max_blob[3]-size_threshold
print("x error: ", x_error)
img.draw_rectangle(max_blob[0:4])
img.draw_cross(max_blob[5], max_blob[6])
x_output=x_pid.get_pid(x_error,1)
h_output=h_pid.get_pid(h_error,1)
print("h_output",h_output)
car.run(-h_output-x_output,-h_output+x_output)
sleep(0.1)
else:
car.run(26,-26)
二维码识别的内置识别算法的源码或者它运用的公式
回复: openmv里面内置的二维码识别算法
里面二维码识别源码的页面404了
这个blob.elongation()到底啥意思呀。
我查文档就一句话:返回一个介于0和1之间的值,该值表示对象的长度(不是圆形)。一条线将是1。看着这句话,完全是懵的,然后我打印blob.elongation()的值,串行终端显示的是
0.784345
0.778271
0.799604
0.776931
0.793868
0.777317
为什么是0.7几?这个单颜色识别的例程里面,if blob.elongation() > 0.5:为什么是大于0.5,搞了半天还是一头雾水
请问openmv人脸识别的image.HaarCascade的源代码怎么查看
新人求助源代码找不到
用Ubuntu git clone下载源代码卡在某一句怎么办?
用Ubuntu git clone下载源代码卡在某一句怎么办?
编译源码时出现错误,TypeError: 'NoneType' object is not iterable
需要的软件和库都按照“编译固件章节”安装了,就是卡在这里过不了,不知道什么原因?
root@ubuntu:/home/jacky/Documents/openmv-master# sudo make -j$(nproc) -C src/micropython/mpy-cross
make: Entering directory '/home/jacky/Documents/openmv-master/src/micropython/mpy-cross'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Traceback (most recent call last):
File "../py/makeversionhdr.py", line 106, in
make_version_header(sys.argv[1])
File "../py/makeversionhdr.py", line 73, in make_version_header
omv_git_tag, omv_git_hash = get_version_info_from_git(omv_repo)
TypeError: 'NoneType' object is not iterable
../py/py.mk:241: recipe for target 'build/genhdr/mpversion.h' failed
make: *** [build/genhdr/mpversion.h] Error 1
make: Leaving directory '/home/jacky/Documents/openmv-master/src/micropython/mpy-cross'
root@ubuntu:/home/jacky/Documents/openmv-master#
交叉编码工具版本:
root@ubuntu:/home/jacky/Documents/openmv-master# arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../lib/gcc/arm-none-eabi/7.3.1/lto-wrapper
Target: arm-none-eabi
Configured with: /build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/src/gcc/configure --target=arm-none-eabi --prefix=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native --libexecdir=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native/lib --infodir=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/build/gcc-arm-none-eabi-Ubq5Xp/gcc-arm-none-eabi-7-2018q2/install-native/arm-none-eabi --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for Arm Embedded Processors 7-2018-q3-update' --with-multilib-list=rmprofile
Thread model: single
gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q3-update)
python3版本:
Python 3.5.2 (default, Jan 26 2021, 13:30:48)
[GCC 5.4.0 20160609] on linux
请问人脸检测例子能在openMV-git上找到源码吗?
比如 image.HaarCascade() 函数,我在源码上就没有找到,是不是直接编译成了库还是需要调用某些编译库?
顺便问下,人脸检测例子就一个吗?有没有简单点的人脸检测算法可以看到源码移植的等等
谢谢
有没有小伙伴研究【源码】,一起出来交流一下
openmv 代码是开源的,特别是内置了很多图像算法,都是基于C的,有没有小伙伴在研究底层图像源码的,可以一起来交流一下
主要是目录:src/omv/img 文件夹下的源码 ,我有意向进行二次开发,然后对C代码封装,在micropython上调用。
例程讲解28-Global-Shutter-> triggered_mode 触发模式源代码错误
例程讲解28-Global-Shutter-> triggered_mode 触发模式直接运行源代码出现错误。
口罩检测和垃圾分类的源码链接无法打开
如https://book.openmv.cc/project/mask.html下的https://github.com/SingTown/mask-tflite链接无法打开