stereo mapping

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

stereo mapping

hazem

I am trying to create a map by using my stereo camera "StereoPi", The map can't be completely created as shown and the odom quality is very low.So how can I increase my odom quality and what shall I do to get a better and a denser map?
Regards
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

matlabbe
Administrator
How the calibration was done? Follow steps in section 2 here: http://wiki.ros.org/rtabmap_ros/Tutorials/StereoHandHeldMapping#Bring-up_the_camera
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

hazem
This post was updated on .
I did the calibration according to this tutorial  http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration.However when the the parameter optical flow is set to true it gives me an error that the min disparity might be low (currently 128) or the camera is not calibrated so I tried calibration several times and it gave the same error so I turned optical flow to false and the error didn't appear again.

Sent from my iPhone
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

matlabbe
Administrator
Can you record some images and calibration and share them? Something like (adjust to your real topics):
$ rosbag record /camera/left/image_raw /camera/right/image_raw /camera/left/camera_info /camera/right/camera_info

Make sure all topics are recorded:
$ rosbag info recorded.bag
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

hazem


I am sorry for the late reply, I changed my camera to two web cams and I calibrated them, the optical flow warning doesn't show up anymore and the odom quality is much higher now but still the point cloud is as shown.
These are my disparity images, I tries to adjust the parameters but I couldn't do more than that
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

matlabbe
Administrator
Not sure why ICP registration is used as I don't know the parameters you used. But the main problem seems about the stereo camera calibration or stereo parameters.
See http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration
and http://wiki.ros.org/stereo_image_proc/Tutorials/ChoosingGoodStereoParameters
While you cannot get a good disparity image, there is not much that can be done in rtabmap side.
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

hazem
I tried to change the stereo parameters but I couldn't get a better disparity, the values of the parameters are
prefilter_size"            value="9"
"prefilter_cap"             value="31"
"correlation_window_size"   value="35"
"min_disparity"             value="-5"
"disparity_range"           value="32"
  "uniqueness_ratio"          value="0.0"
"texture_threshold"         value="0"
  "speckle_size"              value="0"
  "speckle_range"             value="0"
I also tried to change the parameters of the RTAB and re-calibrate the cameras and I ended up that the RTAB was able to follow up with the cameras meaning that the visual odometry worked perfectly as well as the loop closure detection but still there were no point cloud as seen in the photo


the parameters of the stereo odometry are
 "Stereo/MaxDisparity"                type="double" value="128"
"Stereo/OpticalFlow"                type="string" value="true"
"Vis/MinInliers" type="string" value="10"/>
"OdomF2M/MaxSize" type="string" value="1000"/>
"Vis/RoiRatios"  type="string" value="0.0 0.0 0.0 0.0"/>
"Odom/Strategy" value="0"/>
"Vis/CorType" value="0"/>
"Vis/MaxFeatures" type="string" value="1000"/>
"Vis/EstimationType" type="string" value="1"/>
"Vis/MaxDepth"       type="string" value="0"/>
"Odom/GuessMotion" type="string" value="true"/>
 unless="$(arg local_bundle)" name="OdomF2M/BundleAdjustment" type="string" value="1"/>
"GFTT/MinDistance"   type="string" value="3"/>
"GFTT/QualityLevel"  type="string" value="0.001"/>
"Vis/BundleAdjustment" type="string" value="1"/>
Vis/FeatureType" type="string" value="6"/>
The parameters of the RTAB are
"Grid/FromDepth" type="string" value="true"/>
"Grid/3D" type="string" value="true"/>
"Stereo/MaxDisparity"                type="double" value="128"/>
"Stereo/OpticalFlow"                type="string" value="true"/>
"Rtabmap/TimeThr" type="string" value="0"/>
"RGBD/ProximityBySpace"     type="string" value="true"/>
RGBD/ProximityByTime"      type="string" value="false"/>
"Reg/Strategy"              type="string" value="0"/>
"RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
RGBD/OptimizeMaxError"     type="string" value="3"/>
"Mem/STMSize"               type="string" value="10"/>  
"RGBD/LocalRadius"          type="string" value="10"/>    
"Icp/CorrespondenceRatio"   type="string" value="0.1"/>
"Kp/MAxDepth" type="string" value="0"/>
"AngularUpdate" type="string" value="0.1"/>
"RGBD/LinearUpdate" type="string" value="0.1"/>
"Reg/Force3DoF" type="string" value="false"/>
Vis/MinInliers" type="string" value="10"/>
"GridGlobal/MinSize" type="double" value="0"/>
"Grid/NoiseFilteringRadius" value="0.0"/>
"Grid/NoiseFilteringMinNeighbors" value="5"/>
"Grid/DepthDecimation"              type="string" value="4"/>
"Grid/FlatObstacleDetected"         type="string" value="true"/>
"Kp/DetectorStrategy"               type="string" value="6"/>  
"RGBD/CreateOccupancyGrid"          type="string" value="true"/>
"Rtabmap/DetectionRate" type="string" value="1"/>
"Grid/RangeMax"         type="string" value="5"/>
"Kp/MaxFeatures" type="string" value="500"/>
"Kp/RoiRatios" type="string" value="0.0 0.0 0.0 0.0"/>
"Kp/NNStrategy" type="string" value="1"/>        
"SURF/HessianThreshold" type="string" value="500"/>
"Vis/EstimationType" type="string" value="1"/>

"RGBD/LoopClosureReextractFeatures" type="string" value="false"/>
"Vis/MaxFeatures" type="string" value="1000"/>
"LccReextract/depth" type="string" value="0"/>
"Mem/UseOdomFeatures"               type="string" value="true"/>  
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

matlabbe
Administrator
If the camera resolution is low and the environment has mostly textureless surfaces, you won't get a dense point cloud. It is why the realsense cameras use an IR projector to add fake textures on surfaces indoor, so that they can get dense point clouds indoor even with a stereo approach.
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

hazem
This post was updated on .
I have another problem where now my point cloud is clear and complete but
the mapcloud is not at all
Reply | Threaded
Open this post in threaded view
|

Re: stereo mapping

matlabbe
Administrator
Hi,

Is the point cloud created with stereo_image_proc node? If so, you may use the same stereo parameters to rtabmap node:
rtabmap --params | grep StereoBM/
Param: StereoBM/BlockSize = "15"                           [See cv::StereoBM]
Param: StereoBM/Disp12MaxDiff = "-1"                       [See cv::StereoBM]
Param: StereoBM/MinDisparity = "0"                         [See cv::StereoBM]
Param: StereoBM/NumDisparities = "128"                     [See cv::StereoBM]
Param: StereoBM/PreFilterCap = "31"                        [See cv::StereoBM]
Param: StereoBM/PreFilterSize = "9"                        [See cv::StereoBM]
Param: StereoBM/SpeckleRange = "4"                         [See cv::StereoBM]
Param: StereoBM/SpeckleWindowSize = "100"                  [See cv::StereoBM]
Param: StereoBM/TextureThreshold = "10"                    [See cv::StereoBM]
Param: StereoBM/UniquenessRatio = "15"                     [See cv::StereoBM]