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

boson radiometric #87

Open
bakas90 opened this issue Aug 4, 2023 · 7 comments
Open

boson radiometric #87

bakas90 opened this issue Aug 4, 2023 · 7 comments

Comments

@bakas90
Copy link

bakas90 commented Aug 4, 2023

I'm using a Boson R camera.
I am getting raw data using flirpy.

However, I'm not exactly sure how to get the metadata.

I want to get the radiometric value.
I also want to create a SEQ file.

I would be grateful if you could tell me how.

@jveitchmichaelis
Copy link
Contributor

Hi,

I want to get the radiometric value.

Flirpy was written before the R variant was released and unfortunately I don't have a radiometric camera to test with.

Do you know what format the raw data from the camera is returned as? It should be straightforward to update the library to include radiometric support. Documentation is here

I'd guess we need to check if TLinear mode is enabled at least, and there seem to be options to control what units are output.

I also want to create a SEQ file.

SEQ files are a sequence of FFF files. In theory you could construct these manually, but this isn't something that Flirpy supports - it's mostly used in the opposite direction (getting data out of SEQ files).

Is there a reason you want an SEQ file?

@jveitchmichaelis
Copy link
Contributor

jveitchmichaelis commented Aug 4, 2023

Assuming you've created a camera object, give this a go. This should change the video mode to TLinear.

function_id = 0x000E000E #sysctrlSetUsbVideoIR16Mode
command = struct.pack(">H", 2) # FLR_SYSCTRL_USBIR16_MODE_TLINEAR = 2
res = camera._send_packet(function_id, data=command)
#res = camera._decode_packet(res) # Not needed, but you can see what res is to check if the command went through

# Now try grabbing a frame

...

This should put your camera into TLinear mode and then multiply your raw values by 0.01 to get to Kelvin.

@jveitchmichaelis
Copy link
Contributor

@bakas90 I see the thumbs up, any luck with this? :)

@olfk1234
Copy link

@jveitchmichaelis Hello! I tried the code above and I got a warning stating "WARNING:flirpy.camera.boson:Boson response: bad command ID" when running the decode packet function. Is there another workaround to convert the Boson into TLinear mode or to get the temperatures using flirpy?

@jveitchmichaelis
Copy link
Contributor

If you go to the receive function and print/dump the return from the camera, what do you get?

I don't have a radiometric Boson so I'm unable to check this myself.

@olfk1234
Copy link

@jveitchmichaelis After doing print(camera.receive()) after the code that you mentioned before, I am getting b' '

@jveitchmichaelis
Copy link
Contributor

jveitchmichaelis commented Mar 28, 2024

Try with 0x000E000D:

image

Looks like a typo with the previous function code (that was get, not set).

However you should also send the 0x000E000E command after to check that the setting is correct. I suggest having a read through the document in the link above, it has all the information about which commands you can send and what should be returned. It should be straightforward to figure out how to use Flirpy to implement the ones you need.

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

No branches or pull requests

3 participants