Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camtron
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kr69sugu
camtron
Commits
5228cf50
Commit
5228cf50
authored
3 years ago
by
am0ebe
Browse files
Options
Downloads
Patches
Plain Diff
.
parent
8d7934cf
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
examples/Demo.cpp
+15
-23
15 additions, 23 deletions
examples/Demo.cpp
opencv
+11
-0
11 additions, 0 deletions
opencv
with
27 additions
and
23 deletions
.gitignore
+
1
−
0
View file @
5228cf50
...
@@ -29,3 +29,4 @@ bgslibrary_gui
...
@@ -29,3 +29,4 @@ bgslibrary_gui
.pypirc
.pypirc
upload.sh
upload.sh
*.sublime-workspace
*.sublime-workspace
README.html
This diff is collapsed.
Click to expand it.
examples/Demo.cpp
+
15
−
23
View file @
5228cf50
...
@@ -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
cam
era
Param
eter
File
(
"."
);
string
camParamFile
(
"."
);
if
(
camerFile
)
if
(
camerFile
)
{
{
//test dir exists
//test dir exists
cam
era
Param
eter
File
=
string
(
camerFile
);
camParamFile
=
string
(
camerFile
);
}
}
cout
<<
"args: -i "
<<
inputFile
<<
" -a "
<<
amountFiles
<<
" -c"
<<
centerFileString
<<
" -o "
<<
outputDir
<<
" -p "
<<
cam
era
Param
eter
File
<<
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
p
aram
eter of: "
<<
cameraParameterFile
<<
endl
;
std
::
string
cam
P
aram
File
=
cameraParameterFile
;
FileStorage
fs
(
camParam
,
FileStorage
::
READ
);
FileStorage
fs
(
camParam
File
,
FileStorage
::
READ
);
if
(
!
fs
.
isOpened
())
if
(
!
fs
.
isOpened
())
{
{
cerr
<<
"error opening '"
<<
cam
era
Param
eter
File
<<
"' 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
,
intrinsicsC
ameraMatrix
,
dist
ortion
Coeff
);
cv
::
undistort
(
img_input
,
imgLenseCorrection
,
c
ameraMatrix
,
distCoeff
s
);
//! 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
);
...
...
This diff is collapsed.
Click to expand it.
opencv
+
11
−
0
View file @
5228cf50
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment