Comments (3)
hi,@liudongdong1
Have you worked out any approach to solve the problem? I also meet that when I load a database file.
I get the error at this statement: DBoW3::Database db( database_dir ); the error is as follows:
OpenCV Error: Assertion failed (s >= 0) in setSize, file /home/robot/opencv-3.3.0/modules/core/src/matrix.cpp, line 310 terminate called after throwing an instance of 'cv::Exception'
what(): /home/robot/opencv-3.3.0/modules/core/src/matrix.cpp:310: error: (-215) s >= 0 in function setSize
from dbow3.
i found the answer which already solved by other in issues,and change it,
void DescManip::fromString(cv::Mat &a, const std::string &s)
{
string ss_aux;
stringstream ss(s);
ss>>ss_aux;
if(ss_aux.find("dbw3")==std::string::npos){
int val;
vector data;data.reserve(100);
while( ss>>val) data.push_back(val);
a.create(1,data.size(),CV_8UC1);
memcpy(a.ptr(0),&data[0],data.size());
}
else{
int type,cols;
ss >>type>>cols;
a.create(1, cols, type);
if(type==CV_8UC1){
unsigned char *p = a.ptr();
int n;
for(int i = 0; i < a.cols; ++i, ++p)
if ( ss >> n) *p = (unsigned char)n;
}
else{
float *p = a.ptr();
for(int i = 0; i < a.cols; ++i, ++p)
if ( !(ss >> *p))cerr<<"Error reading. Unexpected EOF. DescManip::fromString"<<endl;
}
}
}
it does work
from dbow3.
Thank you very much,it really works after change,but there are two small mistake in the code you given,
vector data;data.reserve(100);
float *p = a.ptr();
I corrected it and it worked.thank you!
from dbow3.
Related Issues (20)
- static MIN_COMMON_WORDS in Database.h
- Akaze descriptors issue HOT 1
- Is this project still maintained? HOT 1
- DBOW3 installs an item in Win10 environment. How do you solve this problem?
- make[2]: *** 没有规则可制作目标“/usr/local/lib/libDBoW3.a”,由“gen_vocab” 需求。 停止。 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/gen_vocab.dir/all' failed make[1]: *** [CMakeFiles/gen_vocab.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
- Database:: save does not support saving binary files such as bin files. The source code uses cv:: FileStorage. Opencv does not support saving binary files, does it? HOT 2
- Problems about float format descriptors. HOT 2
- Windows10 - Built as dynamic libs?:ON, Thanks a lot!
- surf ,to generate vocabulary but it seems stuck for a long while(more than 24h) and can not obtain the vocabulary. And I don't know where the problems are. HOT 7
- Problem with generating dictionary on own features HOT 1
- hello,if I want build DBow3 into .a,how can I do?now I build it into .so,which isnt what I want HOT 1
- Build error: ISO C++17 does not allow dynamic exception specification HOT 1
- Is DBoW3 thread safe?
- Why the format is different?
- similar score is wrong ,result is not ideal HOT 1
- c++17 compile error
- How can I get the EntryID separately?
- Floating point descriptor - Error when training HOT 1
- [Question] update vocabulary zip when new image's bow in HOT 1
- How to transform ***.yml.gz to ***.txt or ***.bin which used in ORB-SLAM2?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbow3.