How to print and verify that MatDescriptors are non-empty?? [closed]
For example, suppose I run following snippet
Mat descriptors;
std::cout << descriptors.empty << std::endl; // writes 0
extractor.compute( object, keypoints, descriptors );
std::cout << descriptors.empty << std::endl; // writes 0
So, as you can see even after calling extractor.compute(), descriptors are empty. So, how can one figure out that compute() was called and processed successfully.
http://www.cplusplus.com/reference/vector/vector/
descriptors are not vectors, they are of Mat-type. So I guess, your pointer won't suffice.
My fault. You are right. Check the docs for cv::Mat. It's as easy as reading the doc page.
You answered your question already (except that you code misses brackets after empty such as
std::cout
<<descriptors.empty()
<<std::endl;
. Why there are no descriptors is an entirely different question. You may have detected or specified no keypoints for example.