求RAW8里十字标的中心

#include 
#include 
#include 
#include 
#include 
using namespace cv;
using namespace std;
#define THRESHOLD 200
#define THRESHOLD_PIXEL 30
#define FIRSTFLAG 0
#define SECONDFLAG 0
#define THIRDFLAG 4200
#define FORTHFLAG 4511


static Mat readRawDataImage(const char *);
static Point2d findCenter(Mat &inputImage);
static Point2d calculateCrossCenter(Point2d & ,Point2d &,Point2d &,Point2d & , Mat &);
static int imageHeight = 4512;
static int imageWeight = 6016;
int main( )
{
    char imageName[] = "/home/solitary/Documents/01-6016X4512.raw" ;
    Mat srcImage;
    Mat _srcImage ;
    readRawDataImage(imageName).copyTo(srcImage);
    Point2d centerPoint =  findCenter(srcImage);
    cout<<"the center of cross in main = "<<" ["<::iterator it;
    for (it = rawData.begin();it!=rawData.end();++it)
    {
        if(fread( &((*it)[2]), 1 ,1,filePointer)!=1)    //R
        {
            cout<<"read data frow raw image failed!"<((gr+gb)/2);
        if(fread( &((*it)[0]), 1 ,1,filePointer)!=1)    //B
        {
            cout<<"read data frow raw image failed!"<(i);
        if(fread(p , 1 ,static_cast(imageWeight), filePointer)!=static_cast(imageWeight))
        {
            cout<<"read data frow raw image failed!"<(i);
        if(fread(p , 1 ,static_cast(imageWeight), filePointer)!=static_cast(imageWeight))
        {
            cout<<"read data frow raw image failed!"<=-eps_0 && (point1.y - point3.y) <= eps_0)
    {
        crossCenter.y = point3.y / 2;
        crossCenter.x = point3.x / 2;
    }else
    {
        double k1 = (point3.y - point1.y) / (point3.x - point1.x) ;
        double k2 = (point4.y - point2.y) / (point4.x - point2.x) ;
        double denominator =k1 * point1.x - k2 * point2.x + point2.y - point1.y ;
        double molecule = k1 - k2;
        crossCenter.x = denominator / molecule ;
        crossCenter.y = k1 * (crossCenter.x - point1.x) + point1.y;
        cout<<"the center of cross = "<<" ["<

 

你可能感兴趣的:(opencv)