擅长:python、mysql、java
<p>我也遇到了同样的问题,但是我用的是一个USB接口的Blackfly S摄像头。我必须使用一种特定的格式来实现它。在采集之前,我还设置了相机的像素格式。在</p>
<pre><code>cam.PixelFormat.SetValue(PySpin.PixelFormat_BGR8)
cam.BeginAcquisition()
image_result = cam.GetNextImage()
image_converted = image_result.Convert(PySpin.PixelFormat_BGR8)
# Convert the Image object to RGB array
width = image_result.GetWidth()
height = image_result.GetHeight()
rgb_array = image_converted.GetData()
rgb_array = rgb_array.reshape(height, width, 3)
</code></pre>