Ask Your Question
0

pick-it 3d camera - image processing in ROS

asked 2019-04-15 03:41:37 -0500

Jan Tromp gravatar image

updated 2019-04-15 06:06:13 -0500

Hello everyone,

For one of my projects i am working with a pick-it 3D m 3D camera ( https://www.pickit3d.com/product/pick... ) Now, as far as i understand, the pick-it controller has it's own ROS server running where modes publish some information on certain topics.

In my assignment i need to use the raw images and depth images of the pick-it camera and process them inside ROS, so not let the pick-it controller take care of that. I have to process the 3d-image, as well as the rgb-image.

My question: i am looking for different packages to process images inside ROS. (processing an image means: basic modifications like blurring, convert to greyscale, and most important find the location of a specific product in the image.)

I've looked online for a bit and i saw there is an openCV package for ROS, as well as the pcl package for pointclouds. I want to see if there are some more possible solutions so i can include them in my research, and then find the best solution that fits.

Thanks and kind regards! Jan Tromp

edit retag flag offensive close merge delete

Comments

Anyone got some ideas?

Jan Tromp gravatar image Jan Tromp  ( 2019-04-24 07:12:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-25 05:31:17 -0500

@Jan Tromp, I haven't used pickit3d, but let me suggest one way. Are you able to run pickit3d ros package? If you did, please type rostopic list and provide the output.

You should be able to see topics which publishes message in sensor_msgs/Image type. When you subscribe these topics you will be able to get raw image datas (rgb and depth). You can subscribe these topics from the terminal to check:

rostopic echo /topic_name

If you can get raw datas, then what you can do is to create a ros node which subscribes these topics. After subscribing these topics, you can process these images with opencv as you wish.

Here is a code sample to subscribe an image:

#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <opencv2/highgui/highgui.hpp>
#include <cv_bridge/cv_bridge.h>

void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
  try
  {
    cv::imshow("view", cv_bridge::toCvShare(msg, "bgr8")->image);
    cv::waitKey(30);
  }
  catch (cv_bridge::Exception& e)
  {
    ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str());
  }
}

int main(int argc, char **argv)
{
  ros::init(argc, argv, "image_listener");
  ros::NodeHandle nh;
  cv::namedWindow("view");
  cv::startWindowThread();
  image_transport::ImageTransport it(nh);
  image_transport::Subscriber sub = it.subscribe("camera/image", 1, imageCallback);
  ros::spin();
  cv::destroyWindow("view");
}

Realize that opencv library is already added in the topic. After this point, there is nothing related to ROS. You can process the images with opencv by editing this code template as if you are using opencv in normal c++ mode.

Realize that you need to edit "camera/image" topic name in this line with your topic name.

  image_transport::Subscriber sub = it.subscribe("camera/image", 1, imageCallback);

Don't forget to mark this comment as answer. Good luck!

edit flag offensive delete link more

Comments

Hey, Thanks for your response! This answer will help me a lot later on, but it's not what my question was oirginally.

I know OpenCV and PCL as image processing libaries. But what are some alternatives for this? I want to so image processing with images i get from ROS (as you stated maybe stand alone after i export the image).

However before i get started i want to have a good overview of the different tools/libraries available for image processing.

So my question: What are some good tools/libraries to process images in ROS (or libraries that have a bridge to ROS)? Currently i have:

  • openCV
  • PCL
  • Pickit native image processing (not important for the question, but just to make it complete)

What can be appended to this list?

Kind regards, Jan tromp

Jan Tromp gravatar image Jan Tromp  ( 2019-04-25 08:17:17 -0500 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-04-15 03:31:46 -0500

Seen: 356 times

Last updated: Apr 25 '19