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

Image data is all zero #2

Closed
ghost opened this issue May 13, 2019 · 5 comments
Closed

Image data is all zero #2

ghost opened this issue May 13, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented May 13, 2019

I successfully compiled all the packages,start the jetbot_camera node.But I get the image is all zero.
TIM截图20190513203733

TIM截图20190513204554

At the same time I can successfully run a separate jetson-interface.

thanks!

@ghost ghost closed this as completed May 20, 2019
@localryu
Copy link

Hi. @YuyingJin0111

I have a same error when I run the jetbot_camera node.

Did you solve the issue?
How can i solve this error...?

@alex-makarov
Copy link

Another possible workaround is to pass the converted RGBA via CPU memory. In jetbot_camera.cpp:

       // convert from YUV to RGBA
-       if( !camera->ConvertRGBA(imgCUDA, &imgRGBA) )
+       if( !camera->ConvertRGBA(imgCUDA, &imgRGBA, true) )
        {
                ROS_ERROR("failed to convert from NV12 to RGBA");
                return false;
        }

        // assure correct image size
        if( !camera_cvt->Resize(camera->GetWidth(), camera->GetHeight()) )
        {
                ROS_ERROR("failed to resize camera image converter");
                return false;
        }
+       memcpy(camera_cvt->ImageGPU(), imgRGBA, camera_cvt->GetSize()); 
 
        // populate the message
        sensor_msgs::Image msg;

@shannon112
Copy link

hi, @alex-makarov I have tried your solution, it works. Thanks a lot. But image would flash when environment is changing. Do you know why?

@alex-makarov
Copy link

Not yet, I will look into it.

@alex-makarov
Copy link

@shannon112 - actually I'd recommend to use the patch from @nicolas-beaufort, works better for me.

This issue was closed.
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