https://github.com/flexrobotics/roboflex_util_jpeg
Roboflex in-memory compression of rgb images to and from jpegs.
https://github.com/flexrobotics/roboflex_util_jpeg
jpeg roboflex
Last synced: 2 months ago
JSON representation
Roboflex in-memory compression of rgb images to and from jpegs.
- Host: GitHub
- URL: https://github.com/flexrobotics/roboflex_util_jpeg
- Owner: flexrobotics
- License: mit
- Created: 2023-10-19T21:24:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-04T20:39:21.000Z (over 1 year ago)
- Last Synced: 2025-02-23T00:19:24.947Z (3 months ago)
- Topics: jpeg, roboflex
- Language: C++
- Homepage: https://github.com/flexrobotics/roboflex_util_jpeg
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# roboflex.util.jpeg
Roboflex support for jpeg compression to file and memory, and jpeg decompression from memory.
Useful for compressing images over slow transports (wifi, etc).
## System Dependencies
None! We build jpeg-compression from source...
## pip install
pip install roboflex.util.jpeg
## Import
import roboflex.util.jpeg as ruj
## Nodes
There are two complementary nodes: `JPEGCompressor`, which can turn rgb tensors into jpegs in memory, and `JPEGDecompressor`, which does the opposite. Useful either for writing rgb tensors to files, or compressing them (NOTE jpeg is lossy).
# all parameters are optional
c = ruj.JPEGCompressor(# in the incoming message, where to find the rgb tensor
image_key = "rgb",# in the outgoing message, where to place the jpeg data
output_key = "jpeg",# If this is provided, will ALSO write jpeg files with this
# prefix, with a variation of the date and time as the suffix.
filename_prefix = "",# name of the node
name = "JPEGCompressor",# prints internal info
debug = False,
)... and ...
c = ruj.JPEGDecompressor(
# in the incoming message, where to find the jpeg data as a blob
input_key = "jpeg",# in the outgoing message, where to place the rgb data as a tensor
output_key = "rgb",# name of the node
name = "JPEGDecompressor",# prints internal info
debug = False,
)