Closed Lvhhhh closed 7 years ago
Hi,
this code was originally used to create our own database format. This format did not save floating point values f
, but instead 16bit integer values (short)(f*32.0)
which allowed for much better compression.
The current code creates another database format where we do not use this trick. The fragment value*32.768/1024
is just value*32.0
(the dot .
in 32.768
is a decimal mark, i.e. the number is 32768
(in Germany we use the dot as decimal mark, not the comma)).
It's just a comment and shows where we changed the code.
thank u for your answer! i find the values are smaller about 32 times than values before these code. but the operation"*32.768/1024" is an annotation. how do these value shrink almost 32 times? just because the format of these values transform from 16bit integer values to float point?
I'm not sure what you mean. That code line does not change the values, it only casts them to short
.
for example. the float ' a =1.0 ' becomes the short 'a = 32 ' when it cast to short . is it right?
because i found in "convert_imageset_and_disparity.cpp" l158 " \
value=cv_disp.at
Ok, I finally got it. It's a bug, but it is not directly related to a "float -> short" conversion.
If you use the CustomData
layer, line 158 in convert_imageset_and_disparity.cpp
in its current form clashes with line 107 in src/caffe/layers/custom_data_layer.cpp
which divides by 32.
Either change the CustomData
layer to not do that, or change the converter code to this:
value=cv_disp.at(y, x)*32.0;
We actually fixed this in the flow conversion script, but forgot to do so in the disparity converter.
thank you!!!! i finally know !!!!!!
@Lvhhhh
Hi, do you solve the problem? Is the result correct after add the
value=cv_disp.at
why the value*32.768/1024?
value=cv_disp.at(y, x); // = flo_data[j]*32.768/1024;