-
Notifications
You must be signed in to change notification settings - Fork 3
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
Querying supported PixelFormat
? And issues arising
#7
Comments
A little bit more information. Attempting to set the pixel format directly generates the following error. What is the correct enumeration for BGR mode?
|
Hi Jerry, you are right, those write errors are annoying. We will think of a way to avoid them. The image you posted looks like 8-bit data being interpreted as BGRA (32bpp). Simplest way to get BGR8 data is to set the sink format as BGR8 (in the sink's constructor) and leave the camera's PixelFormat (which is what actually goes over the wire) as Bayer8. ic4 will then automatically convert all images to the specified pixel format. The camera itself does not support the BGR8 format, therefore you get the error when trying to set it. A more descriptive error message might be helpful here. If you only want to convert select images, there is a way:
Using the buffer pool looks a little cumbersome in this example, but it works great if you continuously transform buffers this way since it reuses memory if possible. The copyFrom function does not necessarily support all possible pixel format conversions, but there usually is support converting to BGRa8. |
Hi Tim, thanks again OK so the quick fix is your suggestion re the sink. Sadly this fails using the DFK 33GX545 as shown below. Code snip included in case I've misunderstood something essential.
|
Looks like BGR8 -> BGRa8 is the one transformation that does not work... |
Hi Tim, FYI, the only combination I've got to work is to set the camera to use
otherwise I get errors. Does this mean various cameras support different Bayer flavours? There is surely a common default? Kind of a nuisance, so let me circle back to the question which was: How do I enumerate the pixel formats a camera does support? Thanks for listening. |
And yes, the variety of bayer pattern is camera-specific. |
Like I said, camera-specific. BayerGB8 should work (0x0108000A) |
Ok, we have finally got the VGA camera to produce decent data*. I cannot recommend highly enough that an example demonstrates these two key points. Many thanks here for the help and forbearance. Greatly appreciated.
|
In a future release there will be a pseudo-pixelformat value that can be used to directly set any bayer format with a specified bit depth, regardless of the actual pattern. Enumerating formats and make decisions based on what is available is not something one should be forced to do. |
Setting any bayer pixel format supported by the camera has been simplified in ic4 Version 1.1: PixelFormat::AnyBayer8 |
Good to know. Thanks Tim. |
Hello TIS
We have been lent a VGA camera (DFK 23G 618) whilst waiting delivery of some 4K versions. This is causing me some problems. Questions arising:
I am aware that the VGA camera only supports a single resolution but the error message is surprising.
This image is rendering what I think is 24bpp data with dimensions of 640x480:
imageBuffer
(whatever its format) to Windows style BGR (24bpp) or BGRA (32bpp)? All I can find are the write to a bitmap file family.Thanks again for listening. Any advice much appreciated.
The text was updated successfully, but these errors were encountered: