can you devise an “experiment” using remap() and suitable input data, that would show whether the code is correct or wrong?
when in doubt, you should trust that code more than your own understanding. it has received plenty of consideration by people that know what they’re doing.
nearest remap is hard to find cause there is only small diffs.I have done the experiment before i post it here,it is all the same pixel-wise,but when i find it in source code ,I find something wrong.
here is my experiment ,opencv official remap and custom result:
m_remap_x_16_c2,//CV_16SC2 x y indice
m_remap_y_16_c1);//CV_16UC1 strip indice with x is in lower 5 bits