Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAW-16 Not Working on OS X #7

Open
amirgholami opened this issue May 3, 2020 · 3 comments
Open

RAW-16 Not Working on OS X #7

amirgholami opened this issue May 3, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@amirgholami
Copy link

Hi,

First let me thank you for creating this repository. It is very useful and the code is very clean. I am trying to get the RAW pre AGC 16-bit data, but using the provided instructions I am only getting uint8:

camera = Boson()
camera.setup_video(device_id=2)
image = camera.grab()
print(image.dtype)
uint8

I did check that the following lines return 0 so I am not sure why this is happening:

The order of these calls matters!

self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*"Y16 "))
self.cap.set(cv2.CAP_PROP_CONVERT_RGB, False)

P.S: I am running this on MAC

@jveitchmichaelis
Copy link
Contributor

jveitchmichaelis commented May 3, 2020

I am running this on MAC

Unfortunately this is the problem - 16 bit video support is not great on OS X unfortunately. You might have some luck with a generic UVC driver, but you can't use OpenCV.

Take a look at https://github.com/groupgets/libuvc for example. It should support Y16. Maybe also you could try gstreamer? That may be a good route actually, I'll have a look into that (though it would require compiling everything from scratch).

I added 16 bit video support to OpenCV for Linux and Windows some time ago; I looked into doing the same for OS X but I think AVFoundation is quite limited in terms of supported codecs.

In theory there should be no problem, because the most recent builds of iOS can deal with the disparity map streams from newer iPhones, and that's almost certainly 16-bit data.

I'd be interested if you can get gstreamer to work, using eg GRAY16_LE as the format spec.

@amirgholami
Copy link
Author

That is right, it seems the problem is OSX. I tested it on Linux and the 16-bit works correctly.

@jveitchmichaelis jveitchmichaelis changed the title RAW-16 Not Working RAW-16 Not Working on OS X May 4, 2020
@jveitchmichaelis jveitchmichaelis added the enhancement New feature or request label May 4, 2020
@shinya-ohtani
Copy link

You might have some luck with a generic UVC driver,

On macOS before macOS 12 (macOS 11.6.2 or earlier to be exact), libuvc works. However, on macOS 12, libuvc does not work at all. When trying to open the camera device, uvc_open() results in "uvc err: Access denied (-3)".

more details in this Issue:
groupgets/purethermal1-uvc-capture#56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants