Ask Your Question
1

Get IR stream from kinect

asked 2011-10-17 20:54:14 -0600

Deby85 gravatar image

updated 2016-10-24 09:03:27 -0600

ngrennan gravatar image

Hi, everybody,

I need to capture the IR stream from IR camera of kinect and I have to use OpenCv Library for analizing it. Doing so, I built a subscriber at the topic camera/ir/image_raw of openni_launch and converted the captured image with cv_bridge::toCvCopy(img, enc:MONO16), but as result I had a really very dark image (almost totally black).

I tried to used the IR camera with command:

rosrun image_view image_view image:=camera/ir/image_raw

and it works properly, so I ask to you: why it doesn't work in my source?

I write below my code:

ros::Subscriber subIRKinect = nh.subscribe("camera/ir/image_raw", 1000, getKinectIRImage);

void getKinectIRImage (const sensor_msgs::ImageConstPtr img)
{
    //image type mono16
    try
    {
        cv_ptr = cv_bridge::toCvCopy(img, enc::MONO16);
    }
    catch (cv_bridge::Exception& e)
    {
        ROS_ERROR("cv_bridge exception: %s", e.what());
    }
 }

Thanks in advance everybody can help me!! ;)

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
0

answered 2011-11-07 20:18:31 -0600

Deby85 gravatar image

Thank you Felix, I solved my problem simply using the the following command:

frame = img_bridge_.imgMsgToCv(img, "bgr8");

and now it works properly. :D

Hoping don't boring you, I have another question for you or everybody could help me: I installed ROS and openni_kinect on another computer exactly how I made previously on mine, but when I try to used the IR camera with command:

rosrun image_view image_view image:/camera/ir/image_raw

It returns me the following error:

Illegal Instruction

I've looked for a solution on the web, but I haven't found it. Could someone help me ??

Thanks in advance

edit flag offensive delete link more

Comments

For a new question open a new thread. This one sounds like you are using binaries that don't fit your system.
dornhege gravatar imagedornhege ( 2011-11-07 23:37:05 -0600 )edit
This illegal instruction was a bug a in opencv, and I heard that it's been fixed in the latest release. You may want to update your opencv package.
Kadir Firat Uyanik gravatar imageKadir Firat Uyanik ( 2012-01-17 03:13:59 -0600 )edit
0

answered 2011-11-08 01:38:01 -0600

Deby85 gravatar image

Sorry dornhege, I've posted my 2nd question here, because is always a problem about getting IR stream from kinect!

In any case, I'm using ROS electric on Ubuntu 11.04. Checking flags on the system I found that it supports sse, sse2, ssse3, while mine supports also sse4_1. It could be this the problem?

I found some suggestions for this kind of problems in ROS Diamondback for the CMakeList file of openni_camera, but they don't work in CMakeList file of openni_launch.

Have you got any suggestion?

edit flag offensive delete link more
0

answered 2013-02-02 12:54:38 -0600

davevh gravatar image

If you used "rosrun image_view image_view image:/camera/ir/image_raw" then the problem may be that you need ":=" instead of just ":".

edit flag offensive delete link more
0

answered 2011-10-17 21:29:02 -0600

My guess is that your visualization doesn't handle mono16, but assumes mono8. Try an explicit conversion (with scaling) before displaying.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2011-10-17 20:54:14 -0600

Seen: 2,643 times

Last updated: Feb 02 '13