

Hi Mathieu,
1. I am working on an autonomous vehicle and i have tried to obtain the 2d map from the synchronised stereo setup.My objective is to find a destined area,for my use case the parking area which i have from my image processing node,how will i find area in the map?.
2. I tried looking in to findObject ,and saw as a really good object detection method to find the position in the map.However for my use case when the object is an area,i dont see a lot of features to be tracked,how can i really find this location in the 2d map?
3. What about the detection and tracking of this area over the next frames ?

Administrator

Hi,
With the stereo camera, you can compute a disparity image (cv::StereoBM). You can detect if there are objects/obstacles in the parking area with that.
When detecting the lines, if you know the height of the camera over the ground and the ground is flat, and with camera calibration, you can know in 3D where the lines are. You can also compute disparity of the detected lines too, to know where they are from the camera in 3D. You can then find the pose in 2D from the robot and as you know where the robot is in the occupancy grid, you can know where the lines are in the grid.
cheers,
Mathieu


Thanks.
Is this what you meant ?
1.Detect the lines in the left image of stereo.
2.Compute disparity using cv::StereoBM of the line pixels and get the 3d(X;Y;Z) values.
3.Transmit the 3d cordinates values through /tf to find in the map.
I have a doubt relating to obstacle detection using cv::StereoBM.As u told,
Can you provide some idea or links how i detect obstacles using cv::StereoBM?

Administrator

Hi,
cv::StereoBM computes the dense disparity image in respect to left image. For each pixel in left image, if there is a disparity that can be computed, you can know (using fx,fy,cx,cy camera parameters) the 3D position of that pixel accordingly to camera. You may not publish a tf for every pixels, but maybe one for the whole line.
Obstacle detection can be similar to what is done in this ros package: http://wiki.ros.org/rtabmap_ros#rtabmap_ros.2BAC8obstacles_detectionNote that is you know you are on a 2D ground plane and the camera is looking forward (no tilt), you can just project the disparity image to 3D, creating a point cloud, then filter all points over a fixed height as obstacles.
cheers,
Mathieu


Okay.Very clear.I will proceed with Region of interest and corresponding 3d points.But i have doubt regarding the /tf.I will get for each line two extremities, the start(x1,y1) and end coordinate points(x2,y2). How will i do /tf for these line lets say?
Do i need create this as the object and use something like tf_example_code to find the grid coordinates corresponding?


Hi Mathiew,
I saw in the FindObjectROS.cpp that from an object you create a center,xaxis and yaxis.And then compute its rotation and do its transform.From my use case lets say i have line extremities x1,y1 and x2,y2 ,how could i perform the tf of this line.?
Or should i actually find the bounding area between the lines and find the center,x axis and y axis to get a transform?

Administrator

Hi,
You can know the center of the line with x1+(x2x1)/2, y1+(y2y1)/2 in image frame. But if you are looking for the center of the line in 3D, project x1,y1 and x2,y2 with their corresponding depth (from disparity image), then find the mean of the 3D points. To get orientation, you know the direction of the line, which could be the local xaxis of the line. To find local yaxis, do cross product between up vector (z global axis) and local xaxis you just defined. Then to find local zaxis, do cross product between local xaxis and local yaxis.
cheers,
Mathieu

