Explicitly linking to a Python framework on OS X prevents modules from
being built against one Python (i.e. system python) and imported from
another (i.e. Homebrew python); the interpreter segfaults if there's a
linkage to a foreign Python. Building the module with `-undefined
dynamic_lookup` instead of an explicit link allows the symbols to be
resolved at load time from a compatible python.
1. Use built-in mad() instead of += and *.
2. For stump stages, if weight.z == 0, avoid unnecessary calculation
because some features only have 2 rectangles..
It could improve
OCL_Cascade_Image_MinSize_CascadeClassifier.CascadeClassifier/*
about 10% mean values.
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
The matrix templateZM needs to be initialized because otherwise
uninitialized values leak into the correlation in:
const double correlation = templateZM.dot(imageWarped)
In the worst case this will lead the correlation to be NaN ruining the
whole routine. The subtraction does not initialize templateZM due to the
mask.
Unfortunately, the uninitialized values (by altering the correlation)
have the side effect of dragging out the computation a little longer
giving a slightly better error bound. This means that fixing this bug
breaks perf_ecc where
SANITY_CHECK(warpMat, 1e-3);
is just a little too tight and happens to work due to the uninitialized
values. Since this is a performance not a accuracy test I think it is OK
to just relax the error bound a little bit (the tight error bound being
after all the result of a bug).
Previously the Python3 cv2 package ends up with no submodules (bgsegm, face,
etc) in it, which makes a lot of functionality unusable. By not writing over
our root reference we ensure the new submodules are added to the correct cv2
module.
FFmpeg now requires that frames allocated with avcodec_alloc_frame are
freed with avcodec_free_frame.
(cherry picked from commit 77578d415f)
Conflicts:
modules/highgui/src/cap_ffmpeg_impl.hpp