Fixing ticket #1230
This commit is contained in:
parent
39ec7099e2
commit
481256017e
@ -30,6 +30,9 @@
|
|||||||
#ifndef OPENCV_FLANN_CONFIG_H_
|
#ifndef OPENCV_FLANN_CONFIG_H_
|
||||||
#define OPENCV_FLANN_CONFIG_H_
|
#define OPENCV_FLANN_CONFIG_H_
|
||||||
|
|
||||||
#define FLANN_VERSION "1.6.10"
|
#ifdef FLANN_VERSION_
|
||||||
|
#undef FLANN_VERSION_
|
||||||
|
#endif
|
||||||
|
#define FLANN_VERSION_ "1.6.10"
|
||||||
|
|
||||||
#endif /* OPENCV_FLANN_CONFIG_H_ */
|
#endif /* OPENCV_FLANN_CONFIG_H_ */
|
||||||
|
@ -35,7 +35,10 @@
|
|||||||
#include "general.h"
|
#include "general.h"
|
||||||
#include "nn_index.h"
|
#include "nn_index.h"
|
||||||
|
|
||||||
#define FLANN_SIGNATURE "FLANN_INDEX"
|
#ifdef FLANN_SIGNATURE_
|
||||||
|
#undef FLANN_SIGNATURE_
|
||||||
|
#endif
|
||||||
|
#define FLANN_SIGNATURE_ "FLANN_INDEX"
|
||||||
|
|
||||||
namespace cvflann
|
namespace cvflann
|
||||||
{
|
{
|
||||||
@ -84,9 +87,9 @@ void save_header(FILE* stream, const NNIndex<Distance>& index)
|
|||||||
{
|
{
|
||||||
IndexHeader header;
|
IndexHeader header;
|
||||||
memset(header.signature, 0, sizeof(header.signature));
|
memset(header.signature, 0, sizeof(header.signature));
|
||||||
strcpy(header.signature, FLANN_SIGNATURE);
|
strcpy(header.signature, FLANN_SIGNATURE_);
|
||||||
memset(header.version, 0, sizeof(header.version));
|
memset(header.version, 0, sizeof(header.version));
|
||||||
strcpy(header.version, FLANN_VERSION);
|
strcpy(header.version, FLANN_VERSION_);
|
||||||
header.data_type = Datatype<typename Distance::ElementType>::type();
|
header.data_type = Datatype<typename Distance::ElementType>::type();
|
||||||
header.index_type = index.getType();
|
header.index_type = index.getType();
|
||||||
header.rows = index.size();
|
header.rows = index.size();
|
||||||
@ -110,7 +113,7 @@ inline IndexHeader load_header(FILE* stream)
|
|||||||
throw FLANNException("Invalid index file, cannot read");
|
throw FLANNException("Invalid index file, cannot read");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(header.signature,FLANN_SIGNATURE)!=0) {
|
if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) {
|
||||||
throw FLANNException("Invalid index file, wrong signature");
|
throw FLANNException("Invalid index file, wrong signature");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user