remap with INTER_NEAREST and BORDER_CONSTANT (Patch #1681)
Description
In cv::remap there is functions tab for nearest interpolation mode:
static RemapNNFunc nn_tab[] = { remapNearest<uchar>, remapNearest<uchar>, remapNearest<ushort>, remapNearest<ushort>, remapNearest<int>, remapNearest<int>, remapNearest<double>, 0 };
For types CV_8S, CV_16S and CV_32F it use other integral type with same bit size (for float it use specialization with int, for example).
With BORDER_CONSTANT it cast border value to specified type and use it if need. But for float it cast borderValue to Scalar_<int>, not to Scalar_<float>. So it assign integer values to float data, in fact doing reinterpret casting.
Associated revisions
fixed nearest-neighbor remap with constant border, ticket #1681 (thanks to Vlad for the patch)
Merge pull request #1681 from LeszekSwirski:fix-ninjabuild
History
Updated by Alexander Shishkov almost 13 years ago
- Tracker changed from Bug to Patch
- Target version deleted ()
Updated by Vadim Pisarevsky almost 13 years ago
thanks! your patch has been applied in r7627
- Status changed from Open to Done
- Assignee set to Vadim Pisarevsky
Updated by Alexander Shishkov almost 13 years ago
- Target version set to 2.4.0