Subversion Repositories seema-scanner

Rev

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

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