ethz-asl / hfnet

From Coarse to Fine: Robust Hierarchical Localization at Large Scale with HF-Net (https://arxiv.org/abs/1812.03506)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

convert the data type of hfnet local desc from float to int8

tiger20 opened this issue · comments

I want to compress the hfnet local desc to int8 desc. I notice that in Colmap the normalized sift descriptor(float) is multplied by scale=512,then convert it to uint8 datatype. Now I want to do the same thing to nomalized hfnet local descriptors(convert to int8,since hfnet desc has both negative and positive values), but how to choose the scale value to maintain the most infomation of the original descriptor? I tried scale=724 and it works fine but I still didn't know the logic of choosing such a scale value.

Normalized descriptors are ranging from -1 to +1, so you could shift by 1 and scale by 255/2 to obtain descriptors in [0, 255]. I have never seen such thing done in practice, and don't know the impact on performance. Alternatively, converting the descriptors to float16 is usually fine.

Closing this issue due to inactivity. Feel free to reopen.