例程讲解-03-linear_polar线性极坐标映射
# 线性极坐标映射示例
# 此示例显示使用线性极坐标变换重新投影图像。 线性极化图像是有用的,
# 因为旋转变为X方向上的平移,并且标度的线性变化变为Y方向上的线性平移。
import sensor, image, time
sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others)
sensor.skip_frames(time = 2000) # Let new settings take affect.
clock = time.clock() # Tracks FPS.
while(True):
clock.tick() # Track elapsed milliseconds between snapshots().
img = sensor.snapshot().linpolar(reverse=False)
print(clock.fps()) # Note: Your OpenMV Cam runs about half as fast while
# connected to your computer. The FPS should increase once disconnected.
原图:
运行程序图: