Suggestion for functions that do not support in-place operations (Feature #1150)


Added by Nghia Ho over 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:2.4.0
Difficulty: Pull request:

Description

There are a hand full of functions that do not support in-place operations, like cv::warpAffine. There's an explicit check:

CV_Assert( dst.data != src.data && src.cols > 0 && src.rows > 0 );

It seems easy to support in-place by simply doing:

if(src.data == dst.data)
src = src.clone();

Sure it'll be inefficient due to extra memory being created temporarily, but if the user doesn't mind then I don't see why not.


Associated revisions

Revision 3f609c89
Added by Vadim Pisarevsky almost 13 years ago

support in-place warpAffine, warpPerspective & remap (feature #1150)

Revision 1b38d1e6
Added by Roman Donchenko over 11 years ago

Merge pull request #1150 from janstarzy:spelling

History

Updated by Vadim Pisarevsky almost 13 years ago

thanks! it sounds reasonable. I did not find other occurrences of such assert, but in imgwarp I implemented your idea in warpAffine, warpPerspective and remap functions (SVN branch 2.4, r7827)

  • Status changed from Open to Done
  • Target version set to 2.4.0

Also available in: Atom PDF