Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keypoints点数太多,编译的时候出错 #8

Open
cugcsu opened this issue Mar 28, 2019 · 0 comments
Open

keypoints点数太多,编译的时候出错 #8

cugcsu opened this issue Mar 28, 2019 · 0 comments

Comments

@cugcsu
Copy link

cugcsu commented Mar 28, 2019

`{
vectorcv::KeyPoint tmvKeys;
size_t kpn;
ifkfKeys.read(reinterpret_cast<char*>(hd),2);
if(hd[0]!=0xeb || hd[1]!=0x90)
cerr<<"header error kfKeyPoints, shouldn't"<<endl;

            ifkfKeys.read(reinterpret_cast<char*>(&kpn), sizeof(size_t));
            tmvKeys.resize(kpn);
            //for(size_t vit=0;vit<kpn;vit++)
            for(vector<cv::KeyPoint>::iterator vitkeys=tmvKeys.begin(), vendkeys=tmvKeys.end(); vitkeys!=vendkeys; vitkeys++)
            {
                float ptx,pty,size,angle,response;
                int octave,classid;
                ifkfKeys.read(reinterpret_cast<char*>(&ptx), sizeof(float));
                ifkfKeys.read(reinterpret_cast<char*>(&pty), sizeof(float));
                ifkfKeys.read(reinterpret_cast<char*>(&size), sizeof(float));
                ifkfKeys.read(reinterpret_cast<char*>(&angle), sizeof(float));
                ifkfKeys.read(reinterpret_cast<char*>(&response), sizeof(float));
                ifkfKeys.read(reinterpret_cast<char*>(&octave), sizeof(int));
                ifkfKeys.read(reinterpret_cast<char*>(&classid), sizeof(int));
                //tmvKeys[vit] = cv::KeyPoint(ptx,pty,size,angle,response,octave,classid);
                *vitkeys = cv::KeyPoint(ptx,pty,size,angle,response,octave,classid);
                if(ifkfKeys.fail())  cerr<<"loopcnt: "<<skfcnt<<" mnId "<<mnId<<" ifkfKeys fail. shouldn't"<<endl;
            }
            tmpKF->SetKeyPoints(tmvKeys);
        }`

kpn的数值超过几百亿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant