Suggestion for functions that do not support in-place operations (Feature #1150)
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
support in-place warpAffine, warpPerspective & remap (feature #1150)
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