Skip to content

Commit 2473675

Browse files
committed
Create class VignetteCalib
1 parent a89e952 commit 2473675

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// This file is part of OpenCV project.
2+
// It is subject to the license terms in the LICENSE file found in the top-level directory
3+
// of this distribution and at http://opencv.org/license.html.
4+
5+
#ifndef _OPENCV_VIGNETTECALIB_HPP
6+
#define _OPENCV_VIGNETTECALIB_HPP
7+
8+
#include "opencv2/photometric_calib.hpp"
9+
#include "opencv2/photometric_calib/Reader.hpp"
10+
11+
namespace cv { namespace photometric_calib {
12+
13+
14+
class CV_EXPORTS VignetteCalib
15+
{
16+
public:
17+
VignetteCalib(std::string folderPath, std::string timePath);
18+
VignetteCalib(std::string folderPath, std::string timePath, int imageSkip, int maxIterations, int outlierTh,
19+
int gridWidth, int gridHeight, float facW, float facH, int maxAbsGrad);
20+
21+
private:
22+
int _imageSkip;
23+
int _maxIterations;
24+
int _outlierTh;
25+
26+
// grid width for template image.
27+
int _gridWidth;
28+
int _gridHeight;
29+
30+
// width of grid relative to marker (fac times marker size)
31+
float _facW;
32+
float _facH;
33+
34+
// remove pixel with absolute gradient larger than this from the optimization.
35+
int _maxAbsGrad;
36+
37+
Reader *imageReader;
38+
};
39+
40+
}}
41+
42+
43+
#endif //_OPENCV_VIGNETTECALIB_HPP
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// This file is part of OpenCV project.
2+
// It is subject to the license terms in the LICENSE file found in the top-level directory
3+
// of this distribution and at http://opencv.org/license.html.
4+
5+
#include "precomp.hpp"
6+
#include "opencv2/photometric_calib/VignetteCalib.hpp"
7+
8+
#include <fstream>
9+
#include <iostream>
10+
11+
namespace cv { namespace photometric_calib{
12+
13+
14+
VignetteCalib::VignetteCalib(std::string folderPath, std::string timePath) :
15+
_imageSkip(1), _maxIterations(20), _outlierTh(15), _gridWidth(1000), _gridHeight(1000), _facW(5), _facH(5),
16+
_maxAbsGrad(255)
17+
{
18+
imageReader = new Reader(folderPath, "png", timePath);
19+
}
20+
21+
VignetteCalib::VignetteCalib(std::string folderPath, std::string timePath, int imageSkip, int maxIterations,
22+
int outlierTh, int gridWidth, int gridHeight, float facW, float facH, int maxAbsGrad) :
23+
_imageSkip(imageSkip), _maxIterations(maxIterations), _outlierTh(outlierTh), _gridWidth(gridWidth), _gridHeight(gridHeight),
24+
_facW(facW), _facH(facH), _maxAbsGrad(maxAbsGrad)
25+
{
26+
imageReader = new Reader(folderPath, "png", timePath);
27+
}
28+
}}// namespace photometric_calib, cv

0 commit comments

Comments
 (0)