Get IR stream from kinect
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!! ;)