Skip to content

Commit 78f3e56

Browse files
committed
Memory-efficient vignette calibration implementation.
1 parent 15ca7a9 commit 78f3e56

File tree

2 files changed

+239
-235
lines changed

2 files changed

+239
-235
lines changed

modules/photometric_calib/include/opencv2/photometric_calib/VignetteCalib.hpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@ namespace cv { namespace photometric_calib {
1515
class CV_EXPORTS VignetteCalib
1616
{
1717
public:
18-
VignetteCalib(std::string folderPath, std::string timePath, std::string cameraFile, std::string gammaFile, std::string imageFormat);
19-
VignetteCalib(std::string folderPath, std::string timePath, std::string cameraFile, std::string gammaFile, int imageSkip, int maxIterations, int outlierTh,
20-
int gridWidth, int gridHeight, float facW, float facH, int maxAbsGrad, std::string imageFormat);
18+
VignetteCalib(std::string folderPath, std::string timePath, std::string cameraFile, std::string gammaFile, std::string imageFormat, bool silent);
19+
VignetteCalib(std::string folderPath, std::string timePath, std::string cameraFile, std::string gammaFile, std::string imageFormat, bool silent, int imageSkip, int maxIterations, int outlierTh,
20+
int gridWidth, int gridHeight, float facW, float facH, int maxAbsGrad);
2121

2222
virtual ~VignetteCalib();
2323

2424
//EIGEN_ALWAYS_INLINE float getInterpolatedElement(const float* const mat, const float x, const float y, const int width)
2525
float getInterpolatedElement(const float* const mat, const float x, const float y, const int width);
26+
float calMeanExposureTime();
2627
void displayImage(float* I, int w, int h, std::string name);
2728
void displayImageV(float* I, int w, int h, std::string name);
29+
bool preCalib(unsigned long id, float*& image, float*& plane2imgX, float*& plane2imgY);
2830
void calib();
31+
void calibFast();
2932

3033
private:
3134
int _imageSkip;
@@ -45,9 +48,14 @@ class CV_EXPORTS VignetteCalib
4548

4649
Mat _cameraMatrix;
4750
Mat _distCoeffs;
51+
Matx33f _K_p2idx;
52+
Matx33f _K_p2idx_inverse;
4853

4954
Reader *imageReader;
5055
GammaRemover *gammaRemover;
56+
57+
float _meanExposure;
58+
bool _silent;
5159
};
5260

5361
}}

0 commit comments

Comments
 (0)