-
Notifications
You must be signed in to change notification settings - Fork 86
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
Packed Formats - How Much Effort Required? #146
Comments
Additional questions:
Either of these could potentially make the package viable for odd use cases where cameras output a strange format. (Like packed) I also noticed #35 could affect this. The goal would be that buffer doesn't return a |
@gittb Hi, Ben. Thank you for your message and for the proposal. I see a huge benefit in it but could you wait for a while until I can take some time for that, please? I will write you back when the time is ready. /Kazunari |
@kazunarikudo Kazunari, sounds great! Please let me know if you need any assistance. |
@gittb Hi. Thank you again for the hint. It looks very promising and I would like to support the packed formats in a seamless way. I will let you know once I made it. /Kazunari |
@gittb Hi, I'm working on this now. To get the progress forward, could you check how
Or does it pack data as follows?
Your suggested method looks to be assuming the latter case but I would like you to check the reality. I would appreciate it if you could show diagrams for 12bit and 14bit formats. |
@kazunarikudo To be honest, I have been having trouble locating this information. Here is what I am using in numpy, but I am not 100% certain it is correct. It does display the image well, but it shows the dynamic range as very small, with darks being very dark, and brights being very over exposed. My camera has a dynamic range of 72db, and I am not sure if this is caused by the camera or decoding the 12bitpacked improperly.
While the above may be very close, I am not certain it is correct. Would you like me to send you a buffer from the cameras output? |
I did find a PDF from another manufacture speaking about GB10Packed, which has the layout as found below: https://drive.google.com/file/d/1_OhXPsnhvrGjWBg_Go0HrIKoCRiolJSp/view?usp=sharing |
@gittb Hi. I have pushed the required changes to a branch called |
@gittb Hi. This is just a friendly reminder: I'm still waiting for your feedback. Thanks. |
@kazunarikudo Sorry, work has had me extremely busy, I have time this weekend and I will test it out. Thank you for all your help. I will post again soon. |
@gittb Hi, how's it going? |
@kazunarikudo I've been playing with harvesters for the last few weeks. And I am stuck on this issue as well. So sad that @gittb never answered. Here is a simplified code snippet.
Let me know if I can be of any help to help you debug that. |
Hi everyone.
I am back from the dead.
I actually solved it and frankly forgot. After hitting the wall of not
being able to run Harvesters on ARM I had to abandon the package.
When I get back home I will post my code as well.
…On Sat, Mar 13, 2021, 7:37 PM justinbacle ***@***.***> wrote:
@kazunarikudo <https://github.com/kazunarikudo> I've been playing with
harvesters for the last few weeks. And I am stuck on this issue as well. So
sad that @gittb <https://github.com/gittb> never answered.
I am trying to get BayerRG12p data from a Flir camera. When asked for 16b
bayer data everything is fine but it fails on 12bits packed data.
buffer.payload.components only holds a [None]
Here is a simplified code snippet.
from harvesters.core import Harvester
import cv2
import numpy as np
import config
h = Harvester()
h.add_cti_file("path_to_cti_file")
h.update_device_info_list()
ia = h.create_image_acquirer(0)
ia.remote_device.node_map.PixelFormat.value = "BayerRG12p" # Format of 'BayerRG16' works fine, but not 12 bits packed
# ... Other node manipulation goes here...
ia.start_image_acquisition()
with ia.fetch_buffer(timeout=1) as buffer:
component = buffer.payload.components[0]
if component is not None:
_2d = component.data.reshape(component.height, component.width)
binImage = cv2.cvtColor(np.uint16(_2d), cv2.COLOR_BAYER_RG2RGB_EA)
else:
# FIXME Component is None when camera is asked for 12b packed format
...
ia.stop_image_acquisition()
ia.destroy()
h.reset()
cv2.imshow('img', binImage)
cv2.waitKey(0)
Let me know if I can be of any help to help you debug that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7GRTA77M6X5KAOK53B3M3TDQHORANCNFSM4MID6JNA>
.
|
@justinbacle Hi, does even the latest master give you None for the pixel format? Regards, Kazunari. |
I used the latest version in pypi so 1.2.8. is it different from the current master ? |
Well my bad @kazunarikudo it looks like I had an old version of harvesters installed (becaused I tried Harvesters-gui which is not compatible with the latest harvesters). |
This is just to make sure if the format is supported. See issue the comments from justinbacle in issue #146.
Is your feature request related to a problem? Please describe.
I am working with a camera from SVS-VISTEK, the camera supports bayer12packed.
Camera
The harvester package seems much more appealing to use as the camera is complaint with genIcam than using manufactures C++ SDK.
While it also supports 8 bit output, I would really prefer not to lose the bit depth as it is very important in my use case
I am curious how much work would be required to make this happen. I am happy to contribute.
Describe the solution you'd like
Support for packed 12 & 14 bit bayer formats.
Additional context
I have found this method from stack overflow using numpy to split 2 8 bit bytes into 3 12 bit elements quite effective. This could be a possible simple solution:
https://stackoverflow.com/a/51967333
The text was updated successfully, but these errors were encountered: