fbow icon indicating copy to clipboard operation
fbow copied to clipboard

VS2017 compile errors resolved

Open mshafiei opened this issue 6 years ago • 8 comments

Hi,

I resolved compile time errors on windows. fbow_create_voc_step0.exe works fine. But when I run fbow_create_voc_step1.exe I get a segmentation fault right after the following print,

DescName=orb Creating a 10^6 vocabulary...

any idea why that happens?

Configs of my machine: Windows 10, Visual studio 2017, Opencv 3.4

mshafiei avatar Jun 07 '18 09:06 mshafiei

Actually I resolved the seg fault in the last commit. It runs on Windows now. Didn't check it on linux yet

mshafiei avatar Jun 07 '18 14:06 mshafiei

I think you also have to modify destructor.

//fbow.h

~Lx(){ 
	if (feature != 0){
#if WIN32
		_aligned_free(feature);
#else
		free(feature);
#endif
	}
}

// fbow.cpp

Vocabulary::~Vocabulary(){
	if (_data != 0) {
#if WIN32
		_aligned_free(_data);
#else
		free(_data);
#endif
	}
}

tmako123 avatar Jun 07 '18 15:06 tmako123

Could u please send me the data to reproduce the seg fault on windows?El 7 jun. 2018 4:07 p. m., Mohammad Shafiei [email protected] escribió:Actually I resolved the seg fault in the last commit. It runs on Windows now. Didn't check it on linux yet

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

rmsalinas avatar Jun 07 '18 15:06 rmsalinas

Sure. It's the der hass dataset. But you should no longer face the seg fault if you check out the latest commit

mshafiei avatar Jun 07 '18 16:06 mshafiei

For me, seg fault does not happen anymore in debug mode. But it is strange that in release mode it crashes.

mshafiei avatar Jun 08 '18 09:06 mshafiei

The seg fault that I mentioned in last post was due to the existing destructors. I added @tmako123 's functions and the issues are now resolved. I added few files (imagematching.py and .cpp) where transform function is called. Now there is an error raised from that function. These files could be used by running the cmake again and compiling the code. Then .py file takes the address of a dataset and tries to match each image in the dataset with the rest.

mshafiei avatar Jun 08 '18 14:06 mshafiei

The transform function crashes for ORB feature type but works for SURF and AKAZE. On the other hand, the score function returns score 1.0 for SURF and AKAZE feature types regardless of the actual similarity of the input images.

mshafiei avatar Jun 10 '18 14:06 mshafiei

So the problem is with the io functions. I resolved the io between step0 and step1. Where the features vector is stored in a binary file. Instead I write it on a YML file. There is still another step where vocabulary is written in a file and loaded that I have not fixed. But if you create the vocabulary and use it in one single program then there is no issue. Like what you see in image_matching.cpp file. So running step0 before image_matching.cpp runs with no error on windows

mshafiei avatar Jun 14 '18 09:06 mshafiei