justadudewhohacks / justadudewhohacks/opencv4nodejs
ROS compressedImage to raw image
- Dominant language
- C++
- Stars
- 5.1k
- Forks
- 826
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am trying to convert ROS compressedImage (http://docs.ros.org/melodic/api/sensor_msgs/html/msg/CompressedImage.html) to raw image of the size width 300 and height 400 to be displayed on the UI.
I am using XVIZ code but it does not work as the image (data) is a compressed image.
async convertMessage(frame, xvizBuilder) {
const msgs = frame[this.topic];
if (!msgs) {
return;
}
if (msgs.length) {
const {message} = msgs[msgs.length - 1];
const {format, data} = message;
xvizBuilder.primitive(this.xvizStream).image(nodeBufferToTypedArray(data), format);
}
}
getMetadata(xvizMetaBuilder) {
const xb = xvizMetaBuilder;
xb.stream(this.xvizStream)
.category('primitive')
.type('image');
}
I would like to convert the image to RAW as done by ROS (https://github.com/ethz-asl/ros-message-transport/blob/master/compressed_imagem_transport/src/compressed_subscriber.cpp)
Any pointers here will really help.
Best regards,
Hitesh
Contributor guide
Research direction
Start with the convertMessage and getMetadata entry points shown in the issue, then compare the expected XVIZ image input with ROS CompressedImage format and data fields. Review the referenced compressed_subscriber.cpp implementation to establish the conversion requirements; done means compressed ROS images are converted to the requested raw dimensions and displayed through the XVIZ image stream.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- computer-vision, robotics
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100