Contradiction between specification of cv::pow and its implementation (Bug #3012)


Added by Leonid Beynenson almost 12 years ago. Updated over 9 years ago.


Status:Open Start date:2013-05-06
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:-
Affected version:branch '2.4' Operating System:
Difficulty: HW Platform:
Pull request:

Description

The specification declares that in the function cv::pow "for a non-integer power exponent, the absolute values of input array elements are used".
Also the specification contains the following statement: "For some values of power , such as integer values, 0.5 and -0.5, specialized faster algorithms are used"

At the moment if the power value is +/- 0.5, the usual function std::sqrt is applied in the element-wise manner, so for negative matrix elements the result is NaN.
This is the contradiction between the specification of the function cv::pow and its implementation.

See the code of the function cv::pow and the static functions Sqrt_32f, Sqrt_64f, InvSqrt_32f, InvSqrt_64f in the file source:modules/core/src/mathfuncs.cpp

(This may be easily fixed in the non-optimized branch of the functions, but the optimized code of the functions requires additional effort to avoid contradiction between optimized and non-optimized versions of the functions.)


Associated revisions

Revision 4c8a9c5d
Added by Andrey Pavlenko over 10 years ago

Merge pull request #3012 from vpisarev:clean_objdetect

History

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4566

Also available in: Atom PDF