ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

use objectdetection model predict the image subscribed by kinect topic

asked 2019-06-22 04:54:48 -0500

ffzj gravatar image

updated 2019-06-22 07:10:04 -0500

gvdhoorn gravatar image

I use the tensorflow object detection API train a model, I want to use the image topic in the kinect camera and identify it with the trained model. I found that recognition is much less effective than using image recognition directly. Why is that? Is it caused by predicting the image in rosimage format after converting it to cv::mat? Is there any way to solve it?

image_topic = "/kinect2/qhd/image_color"

self._cv_bridge = CvBridge()

self._sub = rospy.Subscriber(image_topic, Image, self.mycallback, queue_size=1) 

def mycallback(self,image):

    cv_image = self._cv_bridge.imgmsg_to_cv2(image_msg, "bgr8")
    pil_img = Image.fromarray(cv_image)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-22 06:49:28 -0500

ffzj gravatar image

I have solved the problem, bgr8 is not the suitable type foe the model ,i have changed the cv_image type to rgb8.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-06-22 04:54:48 -0500

Seen: 95 times

Last updated: Jun 22 '19