Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camera_calibration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container 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
bioroboticslab
robofish
camera_calibration
Commits
dd3be93e
Commit
dd3be93e
authored
1 year ago
by
calrama
Browse files
Options
Downloads
Patches
Plain Diff
Throw exception if output file cannot be opened, try to create output file path.
parent
ed00437b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+2
-0
2 additions, 0 deletions
CMakeLists.txt
src/main.cc
+5
-0
5 additions, 0 deletions
src/main.cc
with
7 additions
and
0 deletions
CMakeLists.txt
+
2
−
0
View file @
dd3be93e
...
@@ -8,6 +8,8 @@ add_executable(camera_calibration
...
@@ -8,6 +8,8 @@ add_executable(camera_calibration
src/main.cc
src/main.cc
)
)
set_property
(
TARGET camera_calibration PROPERTY CXX_STANDARD 17
)
find_package
(
OpenCV 4 QUIET
)
find_package
(
OpenCV 4 QUIET
)
if
(
NOT OpenCV_FOUND
)
if
(
NOT OpenCV_FOUND
)
find_package
(
OpenCV 3 REQUIRED
)
find_package
(
OpenCV 3 REQUIRED
)
...
...
This diff is collapsed.
Click to expand it.
src/main.cc
+
5
−
0
View file @
dd3be93e
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
#include
<string>
#include
<string>
#include
<ctime>
#include
<ctime>
#include
<cstdio>
#include
<cstdio>
#include
<filesystem>
#include
<opencv2/core.hpp>
#include
<opencv2/core.hpp>
#include
<opencv2/core/utility.hpp>
#include
<opencv2/core/utility.hpp>
...
@@ -567,7 +568,11 @@ static void saveCameraParams( Settings& s, Size& imageSize, Mat& cameraMatrix, M
...
@@ -567,7 +568,11 @@ static void saveCameraParams( Settings& s, Size& imageSize, Mat& cameraMatrix, M
const
vector
<
float
>&
reprojErrs
,
const
vector
<
vector
<
Point2f
>
>&
imagePoints
,
const
vector
<
float
>&
reprojErrs
,
const
vector
<
vector
<
Point2f
>
>&
imagePoints
,
double
totalAvgErr
)
double
totalAvgErr
)
{
{
filesystem
::
create_directories
(
filesystem
::
path
(
s
.
outputFileName
).
parent_path
());
FileStorage
fs
(
s
.
outputFileName
,
FileStorage
::
WRITE
);
FileStorage
fs
(
s
.
outputFileName
,
FileStorage
::
WRITE
);
if
(
!
fs
.
isOpened
())
throw
std
::
runtime_error
(
"Could not open camara parameters file for writing"
);
time_t
tm
;
time_t
tm
;
time
(
&
tm
);
time
(
&
tm
);
...
...
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