Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 57 articles
Browse latest View live

Decimation function of image_proc for dropping depth image resolution

$
0
0
Hi all, Currently I am trying to use image_proc/crop_decimate to reduce the both rgb and depth image resolution of a sensor that I am using. I was able to drop the resolution for rgb image using decimation_x and decimation_y parameters. But for depth image case, it did not work. I am wondering if this image_proc/crop_decimate function is not for depth image, but only for rgb image. I am using Ubuntu 14.04 and ROS indigo. Is there anyone who has dealt with image_proc/crop_decimate for depth image? If there is something I missed, please let me know. Thank you. --edit This is what my lauch file looks like I simply replaced my real rostopic name of sensor with "Your_sensor". This works for RGB image, but for depth image like the above launch file, it does not work. I also checked that Your_sensor/image_depth and Your_sensor/camera_info rostopics being published correctly while rostopic echo /image_depth_in command gave nothing.

Image_proc causes images to hang

$
0
0
I have calibrated two pointgrey cameras to operate in stereo using the [tutorial](http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration). I also have a similar setup still running in ros electric, so I know the system works in a slightly different configuration. Here is my launch file for the cameras: cam.l : Here is the launch file for viewing the images: In some configurations, when I launch the files both with create the relevant ros nodes. After about 1-3 seconds, one of the cameras will hang and never recover. When I ctrl-c to kill the process, ros reports and error with the nodelet package: *** Error in `/opt/ros/indigo/lib/nodelet/nodelet': free(): invalid pointer: 0x00007fded404b9f8 *** When I use /image_raw and suppress the image_proc and image_proc_debayer packages, I have no issues. If I mix the image_view package in with the nodelet launch file, one of the images will hang. Using either image_proc or image_proc_debayer will also cause the hang. Any idea what is causing the hang?

Cropping a raw camera image before it is rectified.

$
0
0
Hi, After reading a lot of Q&A's on the topic, I still can't seem to crop an input image before rectifying it. I hope someone can help me. I'm runing KUbuntu 14.04 and ROS indigo I can take a raw image, rectify it using the camera calibrator toolbox (e.g. using rosrun camera_calibration cameracalibrator.py -p circles -s 8x7 -q 0.02 image:=camera/image_raw&) and act upon the rectified image (view it etc). All fine, using the following : roscore& roslaunch uvc_camera webcam_calibrated.launch& The launch file for uvc_camera is e.g.: But what I'd like to do now is take, say a 720x576 resolution raw image from a video capture card and crop it down to 640x480. Then I would like to run the monocular camera calibrator again, with the input to the calibrator acting upon the output of the cropping process. As an example, let's suppose I have input from the capture card on /dev/video0 and I remap the image_raw and camera_info to the camera0 namespace. ltop1:~/rosbuild_ros$ roscore& ltop1:~/rosbuild_ros$ rosrun uvc_camera uvc_camera_node /image_raw:=/camera0/image_raw /camera_info:=/camera0/camera_info & I can view the raw image (un-rectified) with rviz: ltop1:~/rosbuild_ros$ rosrun rviz rviz -d ./ImageRawViewer.rviz & Running up imag_proc ltop1:~/rosbuild_ros$ ROS_NAMESPACE=camera0 rosrun image_proc image_proc& of course it now complains that it cannot find a camera calibration file (which is what I want). I can view the camera0/image_color or image_mono output in rviz, which is the unrectified color / mono output .Then I try to run the imag_proc nodelet and this is where things go wrong: ltop1:~/rosbuild_ros$ rosrun nodelet nodelet standalone image_proc/crop_decimate _x_offset=45 _y_offset=46 _width=640 _height=480 camera0/image_color:=camera/image_raw /camera0/camera_info:=camera/camera_info & Help! I can't see anything using rviz with the nodelet's default camera_out/image_raw published topic. Can anyone shed any light on how to properly use the image_proc nodelet to take a raw image and crop it prior to running up the monocular camera calibrator? Or perhaps provide and example launch file? Many thanks.

How to use image_proc node

$
0
0
Using Xtion on Ubuntu with ROS hydro. Ran openni2_launch to the launch camera drivers. > $ rostopic list /camera/rgb/image_raw /camera/rgb/camera_info and many other topics /camera/depth/.. camera/ir/.. > ROS_NAMESPACE=camera rosrun image_proc> image_proc tells me to advertise /camera/image_raw first. [ WARN] [1426076094.517140381]: The input topic '/camera/image_raw' is not yet advertised I was assuming my camera drivers are publishing to /camera/image_raw and camera/camera_info by default which I suppose image_proc will subscribe to publish image_mono or image_rect image but apparently they are publishing /camera/rgb/image_raw and camera/rgb/camera_info. What is the difference between /camera/image_raw and /camera/rgb/image_raw and how should I publish /camera/image_raw.

How to run image_proc with roslaunch

$
0
0
How do you write a launch file to pipeline a color usb camera into image_proc, convert it to mono, and display it in a window? To display a color usb webcam, this simple launch file works well: webcam_color.launch: However, I can't find any examples of using image_proc in a launch file. I can pipe the color video stream into image_proc and display the mono using: roslaunch mypkg webcam_test.launch ROS_NAMESPACE=usb_cam rosrun image_proc image_proc rosrun image_view image_view image:=/usb_cam/image_mono What would be the equivalent of doing this all in a single launch file?

How to configure image_proc for publishing only the image_rect_color

$
0
0
Hi, I am using a camera from axis and i am interested in getting a rectified image. By running the image_proc node i am getting several topics, including something related to theora. I would like to configure the image_proc for publishing only the image_rect_color/compressed topic and avoiding overloading my system with the other topics that are being published, such as /axis_camera_front/image_rect and /axis_camera_front/image_rect/theora. I am recording some bag files and I have to filter them to take away of those images.

Image_proc fails with segmentation fault on ros::spin()

$
0
0
Hi, I'm trying to run this node: #include #include #include int main(int argc, char **argv) { ros::init(argc, argv, "image_proc"); // Check for common user errors if (ros::names::remap("camera") != "camera") { ROS_WARN("Remapping 'camera' has no effect! Start image_proc in the " "camera namespace instead.\nExample command-line usage:\n" "\t$ ROS_NAMESPACE=%s rosrun image_proc image_proc", ros::names::remap("camera").c_str()); } if (ros::this_node::getNamespace() == "/") { ROS_WARN("Started in the global namespace! This is probably wrong. Start image_proc " "in the camera namespace.\nExample command-line usage:\n" "\t$ ROS_NAMESPACE=my_camera rosrun image_proc image_proc"); } // Shared parameters to be propagated to nodelet private namespaces ros::NodeHandle private_nh("~"); ROS_INFO("Step1"); XmlRpc::XmlRpcValue shared_params; int queue_size; if (private_nh.getParam("queue_size", queue_size)) shared_params["queue_size"] = queue_size; nodelet::Loader manager(false); // Don't bring up the manager ROS API nodelet::M_string remappings; nodelet::V_string my_argv; ROS_INFO("Step2"); // Debayer nodelet, image_raw -> image_mono, image_color std::string debayer_name = ros::this_node::getName() + "_debayer"; manager.load(debayer_name, "image_proc/debayer", remappings, my_argv); // Rectify nodelet, image_mono -> image_rect std::string rectify_mono_name = ros::this_node::getName() + "_rectify_mono"; if (shared_params.valid()) ros::param::set(rectify_mono_name, shared_params); manager.load(rectify_mono_name, "image_proc/rectify", remappings, my_argv); ROS_INFO("Step3"); // Rectify nodelet, image_color -> image_rect_color // NOTE: Explicitly resolve any global remappings here, so they don't get hidden. remappings["image_mono"] = ros::names::resolve("image_color"); remappings["image_rect"] = ros::names::resolve("image_rect_color"); ROS_INFO("Step4"); std::string rectify_color_name = ros::this_node::getName() + "_rectify_color"; if (shared_params.valid()) ros::param::set(rectify_color_name, shared_params); ROS_INFO("Step5"); manager.load(rectify_color_name, "image_proc/rectify", remappings, my_argv); ROS_INFO("Step6"); // Check for only the original camera topics ros::V_string topics; ROS_INFO("Step7"); topics.push_back(ros::names::resolve("image_raw")); topics.push_back(ros::names::resolve("camera_info")); ROS_INFO("Step8"); image_proc::AdvertisementChecker check_inputs(ros::NodeHandle(), ros::this_node::getName()); ROS_INFO("Step9"); check_inputs.start(topics, 60.0); ros::spin(); ROS_INFO("Step10"); return 0; } However, every time I run it, it goes through it's lines (look at the ROS_INFO(StepX)) and then when it reaches the end, it just fails. peter@peter:~/brokenGlasses$ ROS_NAMESPACE=camera rosrun image_proc image_proc [ INFO] [1436016564.924762943]: Step1 [ INFO] [1436016564.940809151]: Step2 [ INFO] [1436016565.444694821]: Step3 [ INFO] [1436016565.444757917]: Step4 [ INFO] [1436016565.444783119]: Step5 [ INFO] [1436016565.671524024]: Step6 [ INFO] [1436016565.671576133]: Step7 [ INFO] [1436016565.671605069]: Step8 [ INFO] [1436016565.671639400]: Step9 Segmentation fault (core dumped) I'm assuming the namespace is correct since I didn't get the yellow warnings, however there is really nothing to work on here and I'm at an impasse on what to do. If anyone ahs some good ideas, I would really appreciate it!

image_proc/crop_decimate generates no topics

$
0
0
I use realsense camera, where driver comes without camera_info topic. Therefore I did calibration on my own and wrote my own node publishing camera_info. Now I want to use crop_decimate from image_proc to downsample my image from 1920x1080 to 640x480, cause I need depth and rgb image in the same resolution. I started the driver, my camera_info node and the crop_decimate nodelet, which subscribes fine, but does not generate the output topics. ![image description](/upfiles/14374824942502475.png) Even if I subscribe to the topics, there are no Messages received. Here is my launch file: ![image description](/upfiles/14374825728699108.png) Is crop decimate corrupted?

image_proc not working as expected

$
0
0
Hello everyone, I'm trying to use `image_proc` to rectify my image, coming from a folder. Here is my launch file: The `file_monitor` node checks for new images in a folder and publishes the image path. `image_processor` reads that path and uses `openCV` to read the image and publish it to the `/camera/image_raw` node. It also stamps and publishes the `CameraInfo` topic in the `/camera/camera_info` path. From there on, I expect `image_proc` to do its job, but it fails. While the `image_raw` and `image_mono` topics are visible by the `image_view`, `image_rect` always stays grey (in fact it is never published). I also get the following warning (not actually pasted exactly) [image_transport] Topics '/camera/image_mono' and '/camera/camera_info' do not appear to be synchronized. In the last 10s: Image messages received: 4 CameraInfo messages received: 4 Synchronized pairs: 0 `image_mono` seems to be a product of `image_proc`, but not actually a topic I publish myself, which lags `image_raw` by some 10s of ms and is displayed correctly. However, `image_raw` should be the only input of `image_proc` that I have to stamp. Thus, I don't know why this warning should appear, or whether it affects my result. Any ideas welcome, Thanks in advance! **Edit -------------------------------------------------------------------------------------------------------------------------** I managed to have the intended result with the `cv::undistort` API, but the solution is less modular and I'm not sure whether the result is as sound as the well-documented `image_proc`, so I'll leave this open. **Edit 2 ----------------------------------------------------------------------------------------------------------------------** Here is the code which I use to fill the `camera_info` message, having the converted `.yaml` file loaded in the parameter server: pub_img_raw = it.advertise("/camera/image_raw",1); pub_cfg = n.advertise("/camera/camera_info",1); sensor_msgs::CameraInfo cfg; XmlRpc::XmlRpcValue list; int i; cfg.header.frame_id = "camera"; double temp; ros::param::get("/calibration/image_height", temp); cfg.height = (uint)temp; ros::param::get("/calibration/image_width", temp); cfg.width = (uint)temp; ros::param::get("/calibration/distortion_model", cfg.distortion_model); ros::param::get("/calibration/distortion_coefficients/data", list); cfg.D.clear(); for (i=0;i<5;i++) { cfg.D.push_back((double)list[i]); } ros::param::get("/calibration/camera_matrix/data", list); for (i=0;i<9;i++) { cfg.K[i] = list[i]; } ros::param::get("/calibration/rectification_matrix/data", list); for (i=0;i<9;i++) { cfg.R[i] = list[i]; } ros::param::get("/calibration/projection_matrix/data", list); for (i=0;i<12;i++) { cfg.P[i] = list[i]; } and later in the code: sensor_msgs::ImagePtr msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", image).toImageMsg(); msg->header.stamp = ros::Time::now(); msg->header.frame_id = "camera"; pub_img_raw.publish(msg); cfg.header.stamp = ros::Time::now(); pub_cfg.publish(cfg);

depth_image_proc register issue

$
0
0
I'd like to use the depth_image_proc pipeline to create point cloud xyzrgb using a RGBD camera. I calibrated rgb and ir camera and used image_proc to rectify them. Now I would like to register depth image to the frame of the rgb camera. All input topics are up - depth image, depth camera info, rgb camera info and the required tf is also there. The topics depth_registered/camera_info and depth_registered/image_rect are generated, but they are empty. The question is why? ![image description](/upfiles/1453815158177028.png) ![image description](/upfiles/1453815173355060.png)

Point Grey Grasshopper3 Image looks all Green

$
0
0
I'm having an issue running ``camera.launch`` from the ``pointgrey_camera_driver`` package. When I launch try to view the color image ``/camera/image_color`` in either image_view or rviz the image looks all green. This is due to the published image advertising its encoding as ``bgr8`` when in reality it appears to be ``rgb8``. I wrote a quick republisher that just changes the encoding string to ``rgb8`` and everything shows up fine when I view the image in ``image_view``. What is going wrong here, and what do I need to change to get it working correctly?

ROS / Point Grey Chameleon USB3 Cam / No Colour Images

$
0
0
Hello everyone, I almost feel silly asking this, but I have sunken enough time into this now, and can't figure it out. I have a USB3 Pt Grey Chameleon Camera, installed according to the ROS guide. Works fine, but by default it outputs a gray valued image. (It's a colour camera). Camera is plugged via an active USB3 5m extension cable into a USB3 port. I cannot convince the camera to output a colour image. I am on ROS Indigo on 64Bit Ubuntu 14.04.1 Steps taken so far: $ sudo apt-get install ros-indigo-pointgrey-camera-driver $ sudo cat /etc/udev/rules.d/99-pt-grey-chameleon.rules SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1e10", MODE="0666" $ rosrun pointgrey_camera_driver list_cameras Number of cameras found: 1 [0]Serial: 15374833, Model: Chameleon3 CM3-U3-13S2C, Vendor: Point Grey Research, Sensor: Sony ICX445AL (1/3" 1296x964 CCD), Resolution: 1288x964, Color: false, Firmware Version: 1.2.3.1 Not sure why this says colour:false, it definitely is a colour camera: https://www.ptgrey.com/chameleon3-13-mp-color-usb3-vision Launched rqt with image view, all works fine. Can change the params like fps successfully with rqt / dynreconfig. Changing the video mode on the camera via RQT kills the camera and/or my entire machine. The default running mode of the camera is Format7_Mode0. I tried changing it to Format2_Mode1 ("1280x960_bayer8") hoping that I would get a bayer image to the debayer it and end up with colour. Doing so freezes the camera though, and power cycling usually doesnt help. Any ideas would be greatly appreciated, thanks! Edit: I use the roslaunch command as given on the ROS wiki page, and the debayer nodelet is happily running and publishing a /color topic, which isn't there when debayer is not running. The /color topic visualized in RQT is still greyscale.

ROI Error with Baxter camera feed

$
0
0
I receive a ROI error from image_proc when I subscribe to the Baxter robot camera image. The camera resolution is 640 x 400, and from camera_info the ROI is set to the same size. The part of the launch file that invokes image_proc (Indigo) is: The error goes like this: OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.widt h <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) ... The ROI issue from a previous ROS image_pipeline post (issue 55) implies that the problem may be that Baxter publishes already rectified camera data with a smaller than 640 x 400 size window, which the error seems to confirm. To resolve this issue, should I: 1. Republish the camera_info message from Baxter with ROI set to 0,0 for image-proc, OR 2. Tackle Rethink robotics and have them modify their camera_info, OR 3. Some other course of action Comments welcome.

point_grey_camera driver not reading calibration file?

$
0
0
I have a point grey blackfly ethernet camera with a fisheye lens. I'm trying to use the point_grey_camera driver and image_proc to produce rectified images. I've been able to launch the example launch file, I can see images, i can see the color image produced by image_proc/debayer, I successfully performed camera calibration, everything was going pretty well. I point the launch file to my calibration yaml and it doesnt appear to be reading in the calibration data. When i try "rostopic echo /camera/camera_info" nothing is displayed, it just hangs. I can echo other topics without issue. I confirmed my launch file is in the directory i'm pointing to and tried moving/renaming to no avail. Seems like it should be so simple, I'm stumped. Has anyone else successfully produced rectified images with this driver? My launch file is below:

Time synchronization when using multiple cameras with image_transport

$
0
0
Hello, I am using multiple USB cameras for a project and am facing problems with time synchronization. I am currently using image_transport library's subscribeCamera function to subscribe to camera_info and image_rect_color published by image_proc. While one of my cameras is working fine, the second camera is dropping frames due to camera_info being published at a lower rate than the image messages. The following is the warning I am receiving: [ WARN] [1467164006.770029982]: [image_transport] Topics '/usb_cam_2/image_rect_color' and '/usb_cam_2/camera_info' do not appear to be synchronized. In the last 10s: Image messages received: 120 CameraInfo messages received: 94 Synchronized pairs: 6 I have seen a few related answers such as this one link: http://answers.ros.org/question/69925/sync-problem-on-image-and-camera_info-over-wireless/ but in my case one of the cameras is working fine with just subscribeCamera. I was wondering what the reason could be specially for the camera_info being published at a lower rate than the image messages and whether this is something that I can rectify without ApproximateTime message filters as suggested in the answer in the link. Thanks in advance!

Extract rectified images from bag file with image_raw

$
0
0
I have a bag file with the topics image_raw and camera_info from different cameras. By the time I recorded I had not calibrated the cameras. I have now calibrated the cameras and want to save a rectified image. The topics in the bag file are `/prosilica_2450/image_raw` and `/prosilica_2450/camera_info`. Question: What changes do I need in the launch file to be able to save a rectified image? I have the following launch file:

Compiling ROS Kinetec from source fails when building image_proc

$
0
0
I'm using an Arch machine and trying to compile ROS desktop full from source. The build fails when image_proc is trying to link executable. Here is the error log: [ 23%] Built target image_proc_gencfg [ 84%] Built target image_proc [ 92%] Linking CXX executable /home/alphayed/ROS/ros_catkin_ws/devel_isolated/image_proc/lib/image_proc/image_proc /home/alphayed/ROS/ros_catkin_ws/install_isolated/lib/libopencv_viz3.so.3.1.0: undefined reference to `vtkSTLReader::New()' /home/alphayed/ROS/ros_catkin_ws/install_isolated/lib/libopencv_viz3.so.3.1.0: undefined reference to `vtkOBJReader::New()' collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/image_proc_exe.dir/build.make:219: /home/alphayed/ROS/ros_catkin_ws/devel_isolated/image_proc/lib/image_proc/image_proc] Error 1 make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/image_proc_exe.dir/all] Error 2 make: *** [Makefile:139: all] Error 2 I think the problem is related to opencv3. I removed it from the system and recompiled it from source but that didn't solve the issue. Can you please help?

Why does stereo_image_proc use nodelets?

$
0
0
`image_proc` and `stereo_image_proc` both use nodelets in their design for each of the individual processing steps that they're doing (rectification, disparity, stereo etc.). What are the advantages of doing it this way? Also, how is `stereo_image_proc` able to use the `image_rect` output if it is being made by another nodelet? Thank you.

image_proc vs image_raw

$
0
0
Hi, all! I am quite misunderstood with playing image_view node and my mono camera. If I pass image_rect it shows very distorted image, whereas image_raw looks much better than image_proc. If I calibrated camera, I will need to use image_rect topic messages, right? Not image_raw, yes? Does it mean that my camera is not well enough calibrated? When I run cameracheck.py it shows that my Reprojection RMS Error varies from 3 to 18 pixels. Is it bad?

How to extract images from *.bag after image_proc?

$
0
0
I an trying to create pipe in .launch file in the following way: 1. Decompress image 2. Apply image_proc 3. Extract it Contents of the .launch file is the following: https://pastebin.com/8qtJLK2w As a result, some files are saved after image_proc and some are not. My guess is that nodes work simultaneusly and sometimes extraction executes before applying image_proc. However, I am just a novice in ros. Could you please help me to fix my launch file to archive my goal?
Viewing all 57 articles
Browse latest View live