logo

ValueError: Pixel format is not supported!

2021-01-12 10:09
M
x1oq
bc94217f-c1b8-48c3-8ec1-888529d6329f.png
2021-01-12 18:41
I
网红小智智 星瞳科技

如果涉及代码,需要报错提示与全部代码文本,请注意不要贴代码图片

2021-01-25 20:04
M
x1oq

# Hello World Example

#

# Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!

import sensor, image, time

sensor.reset() # Reset and initialize the sensor.

sensor.set_pixformat(sensor.RGB565 ) # Set pixel format to RGB565 (or GRAYSCALE)

sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)

sensor.skip_frames(time = 2000) # Wait for settings take effect.

clock = time.clock() # Create a clock object to track the FPS.

while(True):

clock.tick() # Update the FPS clock.

img = sensor.snapshot() # Take a picture and return the image.

print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected

# to the IDE. The FPS should increase once disconnected.

M
x1oq

@kidswong999 显示灰度可以rgb565就会报错

M
x1oq

@x1oq # Hello World Example

#

# Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script!

import sensor, image, time

sensor.reset() # Reset and initialize the sensor.

sensor.set_pixformat(sensor.RGB565 ) # Set pixel format to RGB565 (or GRAYSCALE)

sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)

sensor.skip_frames(time = 2000) # Wait for settings take effect.

clock = time.clock() # Create a clock object to track the FPS.

while(True):

clock.tick() # Update the FPS clock.

img = sensor.snapshot() # Take a picture and return the image.

print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected

# to the IDE. The FPS should increase once disconnected.

M
x1oq
6ba05dd2-bfb4-4d38-9b38-dd14abc24d07.png
2021-01-26 17:52
I
网红小智智 星瞳科技

你使用的是MT9V034吧?MT9V034只支持灰度,不支持彩色。

2021-01-27 18:24
M
x1oq

@kidswong999 在 [ValueError: Pixel format is not supported\!](/post/18717) 中说:

> MT9V034

怎么看摄像头型号?

2021-01-27 18:33
I
网红小智智 星瞳科技

IDE最下面有传感器型号。