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

Exporting (uncompressed) video file? #9

Open
zeirix opened this issue Jan 18, 2023 · 4 comments
Open

Exporting (uncompressed) video file? #9

zeirix opened this issue Jan 18, 2023 · 4 comments

Comments

@zeirix
Copy link

zeirix commented Jan 18, 2023

Very cool project!

Is it possible to output the Data as a 25 fps lossless video file (grayscale or Iron colors) or maybe as a bunch of PNGs, that could be merged to a video?
I tried to get out a Video out of my HT-301 with VLC, but it looks noisier, than the output of your opencv.py script.

Thanks a lot!

@stawel
Copy link
Owner

stawel commented Jan 23, 2023

unfortunately, I don't have much time to deal with this project so I can only give you some hints, you could:

  1. save frame after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L15
    at this line frame should be 16bit raw sensor ADC data (numpy 2D array of type numpy.uint16)
  2. add lut_frame = lut[frame] to line 16 and save it, lut_frame will be a 2D array of temperatures in Celsius (of type numpy.float32)
  3. save frame after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L23
    here frame is a numpy.uint8 scaled gayscale of raw sensors ADC data
  4. save frame after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L24
    here frame is an RGB (or BGR I'm not sure) image, probably this should do at line 25:
cv2.imwrite('image.png', frame)
  1. save frame after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L32
    (see point 4.)

to save the output as one video file you probably can use:
https://www.geeksforgeeks.org/saving-a-video-using-opencv/

@zeirix
Copy link
Author

zeirix commented Jan 23, 2023

Hi Pawel,

Thank you for sharing these hints.
I'll try to edit the script.

@lorenzo-gi
Copy link

@zeirix I was also thinking about saving the video. Have implemented already? Any hint?

@lorenzo-gi
Copy link

lorenzo-gi commented Jul 23, 2024

unfortunately, I don't have much time to deal with this project so I can only give you some hints, you could:

1. save `frame` after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L15
   at this line `frame` should be 16bit raw sensor ADC data (numpy 2D array of type numpy.uint16)

2. add `lut_frame = lut[frame]` to line 16 and save it, `lut_frame` will be a 2D array of temperatures in Celsius (of type numpy.float32)

3. save `frame` after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L23
   here `frame` is a numpy.uint8 scaled gayscale of raw sensors ADC data

4. save `frame` after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L24
   here `frame` is an RGB (or BGR I'm not sure)  image, probably this should do at line 25:
cv2.imwrite('image.png', frame)
5. save `frame` after line https://github.com/stawel/ht301_hacklib/blob/master/opencv.py#L32
   (see point 4.)

to save the output as one video file you probably can use: https://www.geeksforgeeks.org/saving-a-video-using-opencv/

Just wanted to add that those links are now referring to an old commit. I assume the correct commit was this one:
https://github.com/stawel/ht301_hacklib/blob/81f14d0fc81b4d9d7d0067aa877b213f1ff0c220/opencv.py

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