On Sun, Dec 13, 2020 at 07:23:46PM +0530, Mayuresh wrote: > I am trying to get sane work with a digital X ray device used for > dentistry described here [1] on Linux (Ubuntu 20.04) or on NetBSD 9.1.
With the help of usbmon (untruncated version courtesy [1]) and pyusb I managed to get the camera to work and return a byte array to me. [It's complicated as the device that actually returns the data is hidden and gets unlocked only after following certain sequence of interactions with the device that at first appears. But that's a matter of detail.] Using PIL python APIs I am also able to convert the raw byte array into an image, though there is just one glitch. The raw data is a 16 bit grayscale image, which converts fine, but when showing / saving it's treated like an 8 bit image. I read on some thread that this is indeed a limitation of the pillow (PIL) package. This scenario of converting raw data to an image must be very common in sane. Wonder if I could get some suggestions. If a python package (other than PIL for above issue) can do it, it will be better as the driver itself is in python. But even other alternatives will do [1] https://github.com/swetland/usbmon
