I am trying to print the frames coming from the intel aero realsense camera. However I do not see anything in the buffer I print. Its empty when I print the last statement. What am I doing wrong here ?
The camera is initialized prior to this correctly.
I have the following code
char *camera_data = malloc(640*480*3);
rs_wait_for_frames( camera, &e);
if ( e || !camera )
{
printf( "rs_error was raised when calling %s( %s ):\n", rs_get_failed_function( e), rs_get_failed_args( e ) );
printf(" %s\n", rs_get_error_message( e ) );
return NULL;
}
// Pull the depth and RGB data from the LibRealSense streams
uint16_t *depth = ( uint16_t* ) rs_get_frame_data( camera, RS_STREAM_DEPTH, &e);
if ( e )
printf("error returning depth\n");
struct rgb *rgb = ( struct rgb* ) rs_get_frame_data( camera, RS_STREAM_COLOR, &e);
if ( e )
printf("error returning rgb\n");
// Create the merge of depth data onto the rgb data Basically, trying to create
// our own depth image here by varying the red intensity
for( int i = 0, end = 640 * 480; i < end; ++i )
{
rgb[ i ].r /= 4;
rgb[ i ].g /= 4;
rgb[ i ].b /= 4;
}
memcpy(camera_data, rgb, 640 * 480 * 3);
printf ("buffer is %s---- \n", camera_data);
Hello,
I am trying to print the frames coming from the intel aero realsense camera. However I do not see anything in the buffer I print. Its empty when I print the last statement. What am I doing wrong here ? The camera is initialized prior to this correctly.
I have the following code
@lbegani @lucasdemarchi