remap with INTER_NEAREST and BORDER_CONSTANT (Patch #1681)


Added by Vladislav Vinogradov almost 14 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-03-13
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

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.


imgwarp.cpp.patch (683 Bytes) Vladislav Vinogradov, 2012-03-13 11:33 am


Associated revisions

Revision 098fc1a6
Added by Vadim Pisarevsky almost 13 years ago

fixed nearest-neighbor remap with constant border, ticket #1681 (thanks to Vlad for the patch)

Revision 31f0ab6c
Added by Roman Donchenko over 11 years ago

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

Also available in: Atom PDF