Skip to content

Commit

Permalink
Merge pull request opencv#12361 from alalek:fix_12359
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Aug 31, 2018
2 parents 9f1218b + fcfa488 commit 94dea84
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/js/src/embindgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
'HOGDescriptor': ['load', 'HOGDescriptor', 'getDefaultPeopleDetector', 'getDaimlerPeopleDetector', 'setSVMDetector', 'detectMultiScale'],
'CascadeClassifier': ['load', 'detectMultiScale2', 'CascadeClassifier', 'detectMultiScale3', 'empty', 'detectMultiScale']}

video = {'': ['CamShift', 'calcOpticalFlowFarneback', 'calcOpticalFlowPyrLK', 'createBackgroundSubtractorMOG2', 'estimateRigidTransform',\
video = {'': ['CamShift', 'calcOpticalFlowFarneback', 'calcOpticalFlowPyrLK', 'createBackgroundSubtractorMOG2', \
'findTransformECC', 'meanShift'],
'BackgroundSubtractorMOG2': ['BackgroundSubtractorMOG2', 'apply'],
'BackgroundSubtractor': ['apply', 'getBackgroundImage']}
Expand Down
2 changes: 1 addition & 1 deletion modules/video/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
set(the_description "Video Analysis")
ocv_define_module(video opencv_imgproc opencv_calib3d WRAP java python js)
ocv_define_module(video opencv_imgproc OPTIONAL opencv_calib3d WRAP java python js)
11 changes: 9 additions & 2 deletions modules/video/src/lkpyramid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
#include "lkpyramid.hpp"
#include "opencl_kernels_video.hpp"
#include "opencv2/core/hal/intrin.hpp"
#ifdef HAVE_OPENCV_CALIB3D
#include "opencv2/calib3d.hpp"
#endif

#include "opencv2/core/openvx/ovx_defs.hpp"

Expand Down Expand Up @@ -1402,7 +1404,10 @@ void cv::calcOpticalFlowPyrLK( InputArray _prevImg, InputArray _nextImg,
cv::Mat cv::estimateRigidTransform( InputArray src1, InputArray src2, bool fullAffine )
{
CV_INSTRUMENT_REGION()

#ifndef HAVE_OPENCV_CALIB3D
CV_UNUSED(src1); CV_UNUSED(src2); CV_UNUSED(fullAffine);
CV_Error(Error::StsError, "estimateRigidTransform requires calib3d module");
#else
Mat A = src1.getMat(), B = src2.getMat();

const int COUNT = 15;
Expand Down Expand Up @@ -1505,8 +1510,10 @@ cv::Mat cv::estimateRigidTransform( InputArray src1, InputArray src2, bool fullA
if (fullAffine)
{
return estimateAffine2D(pA, pB);
} else
}
else
{
return estimateAffinePartial2D(pA, pB);
}
#endif
}
2 changes: 1 addition & 1 deletion platforms/js/build_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_cmake_cmd(self):
"-DWITH_ITT=OFF",
"-DBUILD_ZLIB=ON",
"-DBUILD_opencv_apps=OFF",
"-DBUILD_opencv_calib3d=OFF",
"-DBUILD_opencv_calib3d=ON",
"-DBUILD_opencv_dnn=ON",
"-DBUILD_opencv_features2d=OFF",
"-DBUILD_opencv_flann=OFF",
Expand Down

0 comments on commit 94dea84

Please sign in to comment.