Changeset 64 in pacpussensors for trunk/StereoVisionDisparity/ObstacleDetectionComponent.cpp
- Timestamp:
- Sep 4, 2014, 11:19:05 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StereoVisionDisparity/ObstacleDetectionComponent.cpp
r56 r64 504 504 cv::waitKey(1); 505 505 } 506 506 507 507 // Remap the v-disparity point in the original image and create binary masks 508 508 //std::pair<cv::Mat, cv::Mat> masks = this->MaskSurface2(Disp_map, color_v_disp_map1, color_uv_disp_map.first, this->min_disp, this->max_disp, 1); … … 599 599 cv::imshow("ObstacleDetectionComponent - Final Classification", reference); 600 600 } 601 601 602 //--------------------------------------------------------------------------- 602 603 … … 622 623 cvDestroyAllWindows(); 623 624 } 625 626 /* PointTriangulate 627 Description: 628 Calculate the point triangulation in the world 629 Parameters: 630 row,col = row and column in the image 631 x,y,z = world coordinates 632 disparity = disparity value 633 634 bool ObstacleDetectionComponent::PointTriangulate(int row, int col, double &x, double &y, double &z, double disparity) 635 { 636 bool valid_point = false; 637 638 if(disparity > 0.0 && disparity < 255.0) 639 { 640 z = this->cam_width * this->cam_fx * this->cam_baseline / disparity; 641 double u = col / (this->cam_width - 1.0) - this->cam_cx; 642 double v = row / (this->cam_height - 1.0) - this->cam_cy; 643 644 x = u * z / this->cam_fx; 645 646 y = v * z / this->cam_fy; 647 648 valid_point = true; 649 } 650 651 return valid_point; 652 }*/ 653 624 654 625 655 // Function to calculate the U/V disparity map
Note:
See TracChangeset
for help on using the changeset viewer.