Azure-Kinect-Sensor-SDK icon indicating copy to clipboard operation
Azure-Kinect-Sensor-SDK copied to clipboard

Retrieve image raw data

Open nicolascarre opened this issue 7 years ago • 6 comments

I'm currently using the MJPG format, but I also need the raw data in order to compute the luminance, is exists a method or something to get the raw data from the image ?

nicolascarre avatar Jul 29 '19 10:07 nicolascarre

@nicolascarre thanks for your feedback, please take a look k4a_image_format_t, and specifically K4A_IMAGE_FORMAT_COLOR_NV12 and K4A_IMAGE_FORMAT_COLOR_YUY2, where you can find the luminance and chroma data. Please let us know whether this addressed your issue

rabbitdaxi avatar Jul 29 '19 14:07 rabbitdaxi

Yes, but I'm using the K4A_IMAGE_FORMAT_COLOR_MJPG format, so your way can't works for me, or I need twice...

nicolascarre avatar Jul 29 '19 15:07 nicolascarre

@nicolascarre , what about you use the NV12 or YUY2 format to get the image (then you have the luminance info), and you can convert to bgra image? k4aviewer does such conversion as well: https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/tools/k4aviewer/k4acolorimageconverter.cpp, see K4AYUY2ImageConverter or K4ANV12ImageConverter

rabbitdaxi avatar Jul 29 '19 15:07 rabbitdaxi

Yes but I need to save the image in a file at the .jpeg format, I have the best performance with MJPG, because this imediatly in jpeg format, no need any transformation.

nicolascarre avatar Jul 29 '19 15:07 nicolascarre

@nicolascarre , the data we get form the color camera firmware either MJPG, or NV12 and YUY2. If you are consuming MJPG and you want to get luminance, you can decode the JPEG to YUV, e.g. libjpeg-turbo?

rabbitdaxi avatar Jul 29 '19 17:07 rabbitdaxi

It seems like this issue is resolved. Closing.

cdedmonds avatar Aug 06 '19 17:08 cdedmonds