Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
habonlaci committed Aug 26, 2014
1 parent 36c0033 commit 2878bf2
Show file tree
Hide file tree
Showing 5 changed files with 500 additions and 148 deletions.
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,17 @@ SET(MAVMAP_LIBRARIES
feature
image
timer
math)
math
rectify
reproject)

ADD_EXECUTABLE(densemapper densemapper.cc)
TARGET_LINK_LIBRARIES(densemapper
${MAVMAP_LIBRARIES}
${OpenCV_LIBRARIES}
${Boost_LIBRARIES}
${CERES_LIBRARIES}
)
ADD_EXECUTABLE(mapper mapper.cc)
TARGET_LINK_LIBRARIES(mapper
${MAVMAP_LIBRARIES}
Expand Down
28 changes: 10 additions & 18 deletions src/densemap/rectify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ void rectify_images(const Matrix3d& calib_matrix_,


Mat dist_coeffs = Mat::zeros(1,8,CV_32F);
//Mat rimage, limage; //resizing
Mat const rimage = camera_poses_[ridx].read(); //rimageBig = camera_poses_[ridx].read();
//resize(rimageBig, rimage, Size(), 0.4, 0.4, INTER_LINEAR);

Mat const rimage = camera_poses_[ridx].read();

Mat const limage = camera_poses_[lidx].read();
//resize(limageBig, limage, Size(), 0.4, 0.4, INTER_LINEAR);



Size imageSize = rimage.size();
Mat roi= Mat::zeros(imageSize.height, imageSize.width, CV_8U), lroi, rroi, roirect;

//TODO IMPLEMENT PARAMETER FROM TERMINAL

rectangle(roi, Point(15,15),Point(imageSize.width-15,imageSize.height-15),CV_RGB(255, 255, 255) ,CV_FILLED);

rvec[0] = camera_poses_[ridx].roll;
Expand All @@ -50,7 +50,7 @@ void rectify_images(const Matrix3d& calib_matrix_,
tvec[2] = camera_poses_[ridx].tz;


right_Rt = compose_Rt_matrix (rvec, tvec);
right_Rt = compose_proj_matrix (rvec, tvec);

rvec[0] = camera_poses_[lidx].roll;
rvec[1] = camera_poses_[lidx].pitch;
Expand All @@ -61,7 +61,7 @@ void rectify_images(const Matrix3d& calib_matrix_,
tvec[2] = camera_poses_[lidx].tz;


left_Rt = compose_Rt_matrix (rvec, tvec);
left_Rt = compose_proj_matrix (rvec, tvec);

right_Rt4.block<3,4>(0,0)= right_Rt;
left_Rt4.block<3,4>(0,0)= left_Rt;
Expand Down Expand Up @@ -152,7 +152,7 @@ void rectify_images(const Matrix3d& calib_matrix_,



int depthmapMethod=1; // 1: cpu sbgm mukodik mindennel
int depthmapMethod=1; // 1: cpu sbgm
// 2: gpu bm
// 3: cpu bm

Expand Down Expand Up @@ -471,7 +471,7 @@ fs.release();
// cout<<disp;
// waitKey();
filterDisparity(disp);
//TODO bilateralFilter(disp, dispfilter, 5, 20, 20);


// medianBlur(disp, dispfilter, 5); //not that good
// dispfilter.copyTo(disp);
Expand Down Expand Up @@ -539,15 +539,7 @@ cout<<"reprojection done!"<<endl;



//TODO TODO TODO TODO
/*
* + csinalni parameterezheto ROI-t
*
* regi kepek + 3k kepek block matchingel osszeallitani a kepet, depth mapet, maszkot, pointcloudot osszehasonlitasra.
*
* nagytakaritas
*/



cout<<"matrix:"<<endl;
//cout<<_3dimage;
Expand Down
11 changes: 11 additions & 0 deletions src/densemap/rectify.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@


#include "base3d/projection.h"
#include "base2d/image.h"

#include <Eigen/Geometry>
#include <Eigen/LU>
Expand All @@ -17,11 +18,21 @@

#include <opencv2/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/core/eigen.hpp>

#include "base2d/image.h"
#include <Eigen/Core>
#include <vector>

/**
* @brief rectifies an image pair
*
* @param calib_matrix_ camera calibration matrix
* @param camera_poses_ poses of the two cameras
* @param lidx left image indes
* @param ridx right image index
* @return void
**/
void rectify_images (const Eigen::Matrix3d& calib_matrix_,
const std::vector<Image>& camera_poses_,
int lidx, int ridx );
Expand Down
2 changes: 1 addition & 1 deletion src/densemap/reproject.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <cstddef>

#include "util/defs.h"
//#include "util/defs.h"



Expand Down
Loading

0 comments on commit 2878bf2

Please sign in to comment.