- Timestamp:
- Sep 4, 2014, 11:19:05 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PacpusSocket/PacpusSocket.cpp
r38 r64 54 54 { 55 55 56 socketType_ = param.getProperty("typeSocket");56 socketType_ = config.getProperty("typeSocket"); 57 57 58 58 if (socketType_ == "client" || socketType_ == "Client") 59 59 { 60 address2send_.setAddress( param.getProperty("address"));61 port2send_ = param.getProperty("port").toUInt();60 address2send_.setAddress(config.getProperty("address")); 61 port2send_ = config.getProperty("port").toUInt(); 62 62 socketType_ = "client"; 63 63 } 64 64 else if (socketType_ == "server" || socketType_ == "Server") 65 65 { 66 port2bind_ = param.getProperty("port").toUInt();66 port2bind_ = config.getProperty("port").toUInt(); 67 67 socketType_ = "server"; 68 68 } … … 70 70 { 71 71 qDebug("typeSocket incorrect, become client"); 72 address2send_.setAddress( param.getProperty("address"));73 port2send_ = param.getProperty("port").toUInt();72 address2send_.setAddress(config.getProperty("address")); 73 port2send_ = config.getProperty("port").toUInt(); 74 74 socketType_ = "client"; 75 75 } -
trunk/PtGreyCameras/CMakeLists.txt
r51 r64 130 130 FILES_TO_MOC 131 131 Flea3Component.h 132 #Flea3Grabber.h132 Flea3Grabber.h 133 133 ) 134 134 endif() -
trunk/PtGreyCameras/Flea3Grabber.cpp
r56 r64 43 43 this->nbrCamera_ = 1; 44 44 this->masterCamera_ = 0; 45 this->img2send_ = 0; 45 46 } 46 47 … … 951 952 //++imageCount; 952 953 } 953 954 // Has to change 955 this->img_sending_->write((void*)correctedImg[0].data, settings_[0].mMaxImageOutputSize); 956 } 954 955 switch (img2send_) 956 { 957 case 0: 958 this->img_sending_->write((void*)convertedImage[0].GetData(), settings_[0].mMaxImageOutputSize); 959 break; 960 case 1: 961 this->img_sending_->write((void*)correctedImg[0].data, settings_[0].mMaxImageOutputSize); 962 break; 963 case 2: 964 this->img_sending_->write((void*)convertedImage[1].GetData(), settings_[0].mMaxImageOutputSize); 965 break; 966 case 3: 967 this->img_sending_->write((void*)correctedImg[1].data, settings_[0].mMaxImageOutputSize); 968 break; 969 default: 970 // Should not happen 971 break; 972 } 973 } 957 974 958 975 for (int i = 0; i < this->nbrCamera_; i++) … … 989 1006 } 990 1007 } 1008 1009 1010 //////////////////////////////////////////////////////////////////////////////// 1011 /// Slot to change the image 1012 //////////////////////////////////////////////////////////////////////////////// 1013 void Flea3Grabber::changeImage() 1014 { 1015 img2send_ = ++img2send_ & 0x03; 1016 } -
trunk/PtGreyCameras/Flea3Grabber.h
r56 r64 15 15 16 16 #include <QThread> 17 #include <QMutex>18 17 #include <QDir> 19 18 … … 32 31 #include <string> 33 32 #include <vector> 34 #include "../../ StdDbtPlayerComponents/ImageBaseStructure.h"33 #include "../../../Pacpussensors/trunk/StdDbtPlayerComponents/ImageBaseStructure.h" 35 34 36 35 namespace pacpus { … … 102 101 public ComponentBase 103 102 { 103 Q_OBJECT 104 104 public: 105 105 //============================= DEFAULT ELEMENTS =============================================== … … 113 113 virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config); 114 114 //============================================================================================== 115 115 116 /** 117 * Initialize default values 118 */ 119 void InitDefault(int indice); 120 121 int img2send_; 122 116 123 protected: 117 124 … … 123 130 bool THREAD_ALIVE; 124 131 125 public:126 127 /**128 * Initialize default values129 */130 void InitDefault(int indice);131 132 132 133 private: … … 139 140 std::vector<camSetting> settings_; 140 141 std::vector<ShMem*> shmem_images_; 142 143 public Q_SLOTS: 144 void changeImage(); 141 145 }; 142 146 -
trunk/StereoVisionDisparity/CMakeLists.txt
r53 r64 52 52 set( 53 53 PROJECT_SRCS 54 VDisparity.cpp55 VDisparity.h56 UDisparity.cpp57 UDisparity.h58 54 DisparityMap.cpp 59 55 DisparityMap.h … … 69 65 set( 70 66 FILES_TO_MOC 71 VDisparity.h72 UDisparity.h73 67 DisparityMap.h 74 68 ObstacleDetectionComponent.h -
trunk/StereoVisionDisparity/DisparityMap.h
r57 r64 31 31 32 32 #include <QThread> 33 #include <QMutex>34 33 35 34 namespace pacpus { -
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 -
trunk/StereoVisionDisparity/ObstacleDetectionComponent.h
r56 r64 31 31 32 32 #include <QThread> 33 #include <QMutex>34 33 35 34 namespace pacpus { … … 71 70 int cam_height; // image height 72 71 int cam_channels; // number of channels 72 double cam_ref_cx; // cx camera divide by x image size 73 double cam_ref_cy; // cy camera divide by y image size 74 double cam_ref_fx; // fx camera divide by x image size 75 double cam_ref_fy; // fy camera divide by y image size 73 76 bool showdebug; // Show frame acquired 74 77 int min_disp; // Minimum disparity value to detect obstacles in the u/v-disp map … … 191 194 A CalcMedian(std::vector<A> vetor) const; 192 195 196 //bool PointTriangulate(int row, int col, double &x, double &y, double &z, double disparity); 193 197 }; 194 198
Note:
See TracChangeset
for help on using the changeset viewer.