logo

OpenMV有进行仿射变换的库么,或者我可以用什么办法添加函数库进去呢

2018-05-16 15:55
2
_13123022550

现在在做巡双线小车,识别双轨道后平行轨道变成八字形,想利用仿射变换处理,请问openMV可以实现么

2018-05-16 19:59
X
Yuan

你需要自己写或者修改算法,然后import导入模块。

2018-05-17 11:12
I
网红小智智 星瞳科技

这个变换固件里内置了。

http://book.openmv.cc/example/04-Image-Filters/rotation-correction.html

# Rotation Correction
#
# This example shows off how to use the rotation_corr() to undo perspective rotations
# in 3 dimensions along with zooming in and out on the image. While this demo rotates
# the image around for fun you can use this feature to fix perspective issues related
# to how your OpenMV Cam is mounted.

import sensor, image, time

# Degrees per frame to rotation by...
X_ROTATION_DEGREE_RATE = 5
Y_ROTATION_DEGREE_RATE = 0.5
Z_ROTATION_DEGREE_RATE = 0
X_OFFSET = 0
Y_OFFSET = 0

ZOOM_AMOUNT = 1 # Lower zooms out - Higher zooms in

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()

x_rotation_counter = 0
y_rotation_counter = 0
z_rotation_counter = 0

while(True):
    clock.tick()
    img = sensor.snapshot().rotation_corr(x_rotation = 30, \
                                          y_rotation = 0, \
                                          z_rotation = 0, \
                                          x_translation = 0, \
                                          y_translation = 0)
    print(clock.fps())
6ac342d7-ecad-4871-8d14-03cc880a358d.png