DXcam icon indicating copy to clipboard operation
DXcam copied to clipboard

Video mode with output_color="GRAY" ValueError

Open jplumail opened this issue 3 years ago • 1 comments

This doesn't work

import dxcam

camera = dxcam.create(output_color="GRAY")
camera.start(video_mode=True)
frame = camera.get_latest_frame()

I got this error :

Traceback (most recent call last):
  File "C:\Users\jeanp\miniconda3\envs\tm\lib\site-packages\dxcam\dxcam.py", line 179, in __capture
    self.__frame_buffer[self.__head] = frame
ValueError: could not broadcast input array from shape (1080,1920) into shape (1080,1920,1)

Exception in thread DXCamera:
Traceback (most recent call last):
  File "C:\Users\jeanp\miniconda3\envs\tm\lib\threading.py", line 932, in _bootstrap_inner

Easy to fix, a quick workaround is to expand the array after doing the color conversion.

BTW awesome project thank you !

jplumail avatar May 29 '22 10:05 jplumail

Thanks for the report! A stupid mistake by me to assume HWC output and merged without actually testing :(

ra1nty avatar Jun 10 '22 20:06 ra1nty

Fixed in the upcoming release

ra1nty avatar Sep 04 '22 19:09 ra1nty