Skip to content
Snippets Groups Projects
Commit 5228cf50 authored by am0ebe's avatar am0ebe
Browse files

.

parent 8d7934cf
No related branches found
No related tags found
No related merge requests found
...@@ -29,3 +29,4 @@ bgslibrary_gui ...@@ -29,3 +29,4 @@ bgslibrary_gui
.pypirc .pypirc
upload.sh upload.sh
*.sublime-workspace *.sublime-workspace
README.html
...@@ -33,6 +33,7 @@ using namespace cv; ...@@ -33,6 +33,7 @@ using namespace cv;
using namespace std; using namespace std;
Scalar color_red( 0,0,255,255 ); Scalar color_red( 0,0,255,255 );
const int FILE_ERROR = -3;
int g_badSignalFlagAbort = 0; int g_badSignalFlagAbort = 0;
...@@ -117,15 +118,15 @@ int main(int argc, char * argv[]) ...@@ -117,15 +118,15 @@ int main(int argc, char * argv[])
} }
char *camerFile = getCmdOption(argv, argv + argc, "-p"); char *camerFile = getCmdOption(argv, argv + argc, "-p");
string cameraParameterFile("."); string camParamFile(".");
if (camerFile) if (camerFile)
{ {
//test dir exists //test dir exists
cameraParameterFile = string(camerFile); camParamFile = string(camerFile);
} }
cout << "args: -i " << inputFile << " -a " << amountFiles << " -c" << centerFileString << " -o " << outputDir << " -p " << cameraParameterFile << endl; cout << "args: -i " << inputFile << " -a " << amountFiles << " -c" << centerFileString << " -o " << outputDir << " -p " << camParamFile << endl;
//!**** end parse input***********/ //!**** end parse input***********/
//libarchive things //libarchive things
...@@ -215,31 +216,22 @@ int main(int argc, char * argv[]) ...@@ -215,31 +216,22 @@ int main(int argc, char * argv[])
//open camera config file //open camera config file
cv::String camParam (cameraParameterFile); Mat distCoeffs;
// std::vector<int> intrinsicsCameraMatrix; // = {1000, 0, 320, 0, 1000, 240, 0, 0, 1}; Mat cameraMatrix;
// std::vector<double> distortionCoeff; // = {1000, 0, 320, 0, 1000, 240, 0, 0, 1};
Mat intrinsicsCameraMatrix; // = {1000, 0, 320, 0, 1000, 240, 0, 0, 1};
// Mat distortionCoeff; // = {0.1, 0.01, -0.001, 0, 0};
{ {
cout << "read cam parameter of: " << cameraParameterFile << endl; std::string camParamFile = cameraParameterFile;
FileStorage fs(camParam, FileStorage::READ); FileStorage fs(camParamFile, FileStorage::READ);
if (!fs.isOpened()) if (!fs.isOpened())
{ {
cerr << "error opening '" << cameraParameterFile << "' will abort" << endl; std::cerr << "error opening '" << camParamFile << "' will abort" << endl;
return -1; return FILE_ERROR;
} }
// Mat_<double>(3,3)
// Mat_<double>(5,1)
fs["camera_matrix"] >> (Mat_<double>(3,3))intrinsicsCameraMatrix;
// fs["distortion_coefficients"] >> distortionCoeff;
// intrinsicsCameraMatrix = (int) fs["camera_matrix"]; fs["camera_matrix"] >> cameraMatrix;
// intrinsicsCameraMatrix = fs["camera_matrix"].mat(); fs["distortion_coefficients"] >> distCoeffs;
// cout << "ISMAT?" << intrinsicsCameraMatrix.isMap() << endl;
// pp(intrinsicsCameraMatrix);
// pp(distortionCoeff);
} cout << cameraMatrix << endl << distCoeffs << endl;
} //fs.release();
system( "echo 'sleep a bit... ' && sleep 12" ); system( "echo 'sleep a bit... ' && sleep 12" );
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
...@@ -322,7 +314,7 @@ int main(int argc, char * argv[]) ...@@ -322,7 +314,7 @@ int main(int argc, char * argv[])
//! step 0 correct lense distortion //! step 0 correct lense distortion
Mat imgLenseCorrection = img_input.clone(); Mat imgLenseCorrection = img_input.clone();
//see https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#undistort //see https://docs.opencv.org/2.4/modules/imgproc/doc/geometric_transformations.html#undistort
cv::undistort(img_input, imgLenseCorrection, intrinsicsCameraMatrix, distortionCoeff); cv::undistort(img_input, imgLenseCorrection, cameraMatrix, distCoeffs);
//! step 1) cut out a smaller ROI //! step 1) cut out a smaller ROI
img_input = TToolBox::cropImageCircle(imgLenseCorrection,circleCenterX,circleCenterY,circleRadius); img_input = TToolBox::cropImageCircle(imgLenseCorrection,circleCenterX,circleCenterY,circleRadius);
......
...@@ -103,3 +103,14 @@ https://docs.opencv.org/4.x/d0/d49/tutorial_moments.html ...@@ -103,3 +103,14 @@ https://docs.opencv.org/4.x/d0/d49/tutorial_moments.html
#BGS #BGS
https://docs.opencv.org/4.x/d8/d38/tutorial_bgsegm_bg_subtraction.html https://docs.opencv.org/4.x/d8/d38/tutorial_bgsegm_bg_subtraction.html
# alliedvision-vimba-sdk
#######################
AsynchronousGrab example > to use with opencv
/tmp/mozilla_sugu0/Vimba_installation_under_Linux-1.pdf
C-api
https://www.ansatt.hig.no/ares/Support/Camera%20drivers/AVT/Vimba/1.1/VimbaC/Documentation/Vimba%20C%20Manual.pdf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment