Subversion Repositories seema-scanner

Rev

Rev 142 | Rev 146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 145
Line 9... Line 9...
9
#include <png.h>
9
#include <png.h>
10
#include <zlib.h>
10
#include <zlib.h>
11
 
11
 
12
namespace cvtools{
12
namespace cvtools{
13
 
13
 
14
// Convert an BGR 3-channel image back into a Bayered image
14
// Convert an BGR 3-channel image back into a Bayered image. This saves memory when reading images from disk.
15
void cvtColorBGRToBayerBG(const cv::Mat &imBGR, cv::Mat &imBayerBG){
15
void cvtColorBGRToBayerBG(const cv::Mat &imBGR, cv::Mat &imBayerBG){
16
 
16
 
17
    imBayerBG.create(imBGR.size(), CV_8UC1);
17
    imBayerBG.create(imBGR.size(), CV_8UC1);
18
 
18
 
19
 
-
 
20
    for(int r=0; r<imBGR.rows; r++){
19
    for(int r=0; r<imBGR.rows; r++){
21
        for(int c=0; c<imBGR.cols; c++){
20
        for(int c=0; c<imBGR.cols; c++){
22
 
21
 
23
            bool evenRow = r % 2;
22
            bool evenRow = r % 2;
24
            bool evenCol = c % 2;
23
            bool evenCol = c % 2;
Line 31... Line 30...
31
                imBayerBG.at<uchar>(r,c) = imBGR.at<cv::Vec3b>(r,c)[1];
30
                imBayerBG.at<uchar>(r,c) = imBGR.at<cv::Vec3b>(r,c)[1];
32
 
31
 
33
        }
32
        }
34
 
33
 
35
    }
34
    }
36
 
-
 
37
 
-
 
38
}
35
}
39
 
36
 
40
 
-
 
41
// Removes matches not satisfying the epipolar constraint.
37
// Removes matches not satisfying the epipolar constraint.
42
// F is the fundamental matrix.
38
// F is the fundamental matrix.
43
// Works like cv::correctMatches(), except it removes matches with an error distance greater than maxD.
39
// Works like cv::correctMatches(), except it removes matches with an error distance greater than maxD.
44
void removeIncorrectMatches(const cv::Mat F, const std::vector<cv::Point2f> &q0, const std::vector<cv::Point2f> &q1, const float maxD,
40
void removeIncorrectMatches(const cv::Mat F, const std::vector<cv::Point2f> &q0, const std::vector<cv::Point2f> &q1, const float maxD,
45
                                std::vector<cv::Point2f> q0Correct, std::vector<cv::Point2f> q1Correct){
41
                                std::vector<cv::Point2f> q0Correct, std::vector<cv::Point2f> q1Correct){