mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Fixed Android build
This commit is contained in:
@@ -724,10 +724,10 @@ CV_IMPL void cvSaveWindowParameters(const char* name)
|
||||
CV_NO_GUI_ERROR("cvSaveWindowParameters");
|
||||
}
|
||||
|
||||
CV_IMPL void cvLoadWindowParameterss(const char* name)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvLoadWindowParameters");
|
||||
}
|
||||
// CV_IMPL void cvLoadWindowParameterss(const char* name)
|
||||
// {
|
||||
// CV_NO_GUI_ERROR("cvLoadWindowParameters");
|
||||
// }
|
||||
|
||||
CV_IMPL int cvCreateButton(const char*, void (*)(int, void*), void*, int, int)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include "test_precomp.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
|
||||
#if defined HAVE_GTK || defined HAVE_QT || defined WIN32 || defined _WIN32 || HAVE_CARBON || HAVE_COCOA
|
||||
#if defined HAVE_GTK || defined HAVE_QT || defined WIN32 || defined _WIN32 || defined HAVE_CARBON || defined HAVE_COCOA
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
|
||||
@@ -162,6 +162,8 @@ else()
|
||||
endif()
|
||||
add_dependencies(${the_module} ${api_target})
|
||||
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations)
|
||||
|
||||
# Additional target properties
|
||||
set_target_properties(${the_module} PROPERTIES
|
||||
OUTPUT_NAME "${the_module}"
|
||||
|
||||
@@ -1,5 +1,23 @@
|
||||
#include <jni.h>
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
# include "opencv2/nonfree/nonfree.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV_FEATURES2D
|
||||
# include "opencv2/features2d/features2d.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV_VIDEO
|
||||
# include "opencv2/video/video.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENCV_ML
|
||||
# include "opencv2/ml/ml.hpp"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
@@ -9,6 +27,23 @@ JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK)
|
||||
return -1;
|
||||
|
||||
bool init = true;
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
init &= cv::initModule_nonfree();
|
||||
#endif
|
||||
#ifdef HAVE_OPENCV_FEATURES2D
|
||||
init &= cv::initModule_features2d();
|
||||
#endif
|
||||
#ifdef HAVE_OPENCV_VIDEO
|
||||
init &= cv::initModule_video();
|
||||
#endif
|
||||
#ifdef HAVE_OPENCV_ML
|
||||
init &= cv::initModule_ml();
|
||||
#endif
|
||||
|
||||
if(!init)
|
||||
return -1;
|
||||
|
||||
/* get class with (*env)->FindClass */
|
||||
/* register methods with (*env)->RegisterNatives */
|
||||
|
||||
@@ -21,16 +56,4 @@ JNI_OnUnload(JavaVM *vm, void *reserved)
|
||||
//do nothing
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#if HAVE_OPENCV_MODULES_NONFREE
|
||||
#include "opencv2/nonfree/nonfree.hpp"
|
||||
static bool makeUseOfNonfree = initModule_nonfree();
|
||||
#endif
|
||||
|
||||
#if HAVE_OPENCV_MODULES_FEATURES2D
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
static bool makeUseOfNonfree = initModule_features2d();
|
||||
#endif
|
||||
} // extern "C"
|
||||
@@ -18,7 +18,7 @@ using std::tr1::get;
|
||||
typedef TestBaseWithParam<String> stitch;
|
||||
typedef TestBaseWithParam<String> match;
|
||||
|
||||
#if HAVE_OPENCV_NONFREE
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
#define TEST_DETECTORS testing::Values("surf", "orb")
|
||||
#else
|
||||
#define TEST_DETECTORS testing::Values<String>("orb")
|
||||
|
||||
@@ -61,7 +61,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
if (try_use_gpu && gpu::getCudaEnabledDeviceCount() > 0)
|
||||
{
|
||||
#if HAVE_OPENCV_NONFREE
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
stitcher.setFeaturesFinder(new detail::SurfFeaturesFinderGpu());
|
||||
#else
|
||||
stitcher.setFeaturesFinder(new detail::OrbFeaturesFinder());
|
||||
@@ -72,7 +72,7 @@ Stitcher Stitcher::createDefault(bool try_use_gpu)
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#if HAVE_OPENCV_NONFREE
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
stitcher.setFeaturesFinder(new detail::SurfFeaturesFinder());
|
||||
#else
|
||||
stitcher.setFeaturesFinder(new detail::OrbFeaturesFinder());
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "test_precomp.hpp"
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#if HAVE_OPENCV_NONFREE
|
||||
#ifdef HAVE_OPENCV_NONFREE
|
||||
|
||||
using namespace cv;
|
||||
using namespace std;
|
||||
@@ -57,7 +57,7 @@ TEST(SurfFeaturesFinder, CanFindInROIs)
|
||||
rois.push_back(Rect(img.cols / 2, img.rows / 2, img.cols - img.cols / 2, img.rows - img.rows / 2));
|
||||
detail::ImageFeatures roi_features;
|
||||
(*finder)(img, roi_features, rois);
|
||||
|
||||
|
||||
int tl_rect_count = 0, br_rect_count = 0, bad_count = 0;
|
||||
for (size_t i = 0; i < roi_features.keypoints.size(); ++i)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "opencv2/videostab/motion_core.hpp"
|
||||
#include "opencv2/videostab/outlier_rejection.hpp"
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#endif
|
||||
|
||||
@@ -73,7 +73,7 @@ CV_EXPORTS Mat estimateGlobalMotionRobust(
|
||||
|
||||
class CV_EXPORTS MotionEstimatorBase
|
||||
{
|
||||
public:
|
||||
public:
|
||||
virtual ~MotionEstimatorBase() {}
|
||||
|
||||
virtual void setMotionModel(MotionModel val) { motionModel_ = val; }
|
||||
@@ -200,7 +200,7 @@ private:
|
||||
std::vector<Point2f> pointsPrevGood_, pointsGood_;
|
||||
};
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
class CV_EXPORTS KeypointBasedMotionEstimatorGpu : public ImageMotionEstimatorBase
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/opencv_modules.hpp"
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#endif
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
OutputArray status, OutputArray errors);
|
||||
};
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
class CV_EXPORTS SparsePyrLkOptFlowEstimatorGpu
|
||||
: public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "opencv2/videostab/global_motion.hpp"
|
||||
#include "opencv2/videostab/log.hpp"
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
#include "opencv2/gpu/gpu.hpp"
|
||||
#endif
|
||||
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
Mat_<float> mapx_, mapy_;
|
||||
};
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
class CV_EXPORTS MoreAccurateMotionWobbleSuppressorGpu : public MoreAccurateMotionWobbleSuppressorBase
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -621,7 +621,7 @@ Mat ToFileMotionWriter::estimate(const Mat &frame0, const Mat &frame1, bool *ok)
|
||||
|
||||
KeypointBasedMotionEstimator::KeypointBasedMotionEstimator(Ptr<MotionEstimatorBase> estimator)
|
||||
: ImageMotionEstimatorBase(estimator->motionModel()), motionEstimator_(estimator)
|
||||
{
|
||||
{
|
||||
setDetector(new GoodFeaturesToTrackDetector());
|
||||
setOpticalFlowEstimator(new SparsePyrLkOptFlowEstimator());
|
||||
setOutlierRejector(new NullOutlierRejector());
|
||||
@@ -686,11 +686,11 @@ Mat KeypointBasedMotionEstimator::estimate(const Mat &frame0, const Mat &frame1,
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
KeypointBasedMotionEstimatorGpu::KeypointBasedMotionEstimatorGpu(Ptr<MotionEstimatorBase> estimator)
|
||||
: ImageMotionEstimatorBase(estimator->motionModel()), motionEstimator_(estimator)
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
setOutlierRejector(new NullOutlierRejector());
|
||||
}
|
||||
|
||||
@@ -720,7 +720,7 @@ Mat KeypointBasedMotionEstimatorGpu::estimate(const gpu::GpuMat &frame0, const g
|
||||
detector_(grayFrame0, pointsPrev_);
|
||||
|
||||
// find correspondences
|
||||
optFlowEstimator_.run(frame0, frame1, pointsPrev_, points_, status_);
|
||||
optFlowEstimator_.run(frame0, frame1, pointsPrev_, points_, status_);
|
||||
|
||||
// leave good correspondences only
|
||||
gpu::compactPoints(pointsPrev_, points_, status_);
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
for (int dx = -rad; dx <= rad; ++dx)
|
||||
{
|
||||
int qx0 = x + dx;
|
||||
int qy0 = y + dy;
|
||||
int qy0 = y + dy;
|
||||
|
||||
if (qy0 >= 0 && qy0 < mask0.rows && qx0 >= 0 && qx0 < mask0.cols && mask0(qy0,qx0))
|
||||
{
|
||||
@@ -325,7 +325,7 @@ public:
|
||||
|
||||
MotionInpainter::MotionInpainter()
|
||||
{
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
setOptFlowEstimator(new DensePyrLkOptFlowEstimatorGpu());
|
||||
#else
|
||||
CV_Error(CV_StsNotImplemented, "Current implementation of MotionInpainter requires GPU");
|
||||
@@ -374,7 +374,7 @@ void MotionInpainter::inpaint(int idx, Mat &frame, Mat &mask)
|
||||
|
||||
// warp frame
|
||||
|
||||
frame1_ = at(neighbor, *frames_);
|
||||
frame1_ = at(neighbor, *frames_);
|
||||
|
||||
if (motionModel_ != MM_HOMOGRAPHY)
|
||||
warpAffine(
|
||||
@@ -532,7 +532,7 @@ void completeFrameAccordingToFlow(
|
||||
|
||||
if (x1 >= 0 && x1 < frame1.cols && y1 >= 0 && y1 < frame1.rows && mask1_(y1,x1)
|
||||
&& sqr(flowX_(y0,x0)) + sqr(flowY_(y0,x0)) < sqr(distThresh))
|
||||
{
|
||||
{
|
||||
frame0.at<Point3_<uchar> >(y0,x0) = frame1.at<Point3_<uchar> >(y1,x1);
|
||||
mask0_(y0,x0) = 255;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void SparsePyrLkOptFlowEstimator::run(
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
SparsePyrLkOptFlowEstimatorGpu::SparsePyrLkOptFlowEstimatorGpu()
|
||||
{
|
||||
CV_Assert(gpu::getCudaEnabledDeviceCount() > 0);
|
||||
@@ -135,7 +135,7 @@ void DensePyrLkOptFlowEstimatorGpu::run(
|
||||
flowX_.download(flowX.getMatRef());
|
||||
flowY_.download(flowY.getMatRef());
|
||||
}
|
||||
#endif // #if HAVE_OPENCV_GPU
|
||||
#endif // HAVE_OPENCV_GPU
|
||||
|
||||
} // namespace videostab
|
||||
} // namespace cv
|
||||
|
||||
@@ -115,7 +115,7 @@ void MoreAccurateMotionWobbleSuppressor::suppress(int idx, const Mat &frame, Mat
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_OPENCV_GPU
|
||||
#ifdef HAVE_OPENCV_GPU
|
||||
void MoreAccurateMotionWobbleSuppressorGpu::suppress(int idx, const gpu::GpuMat &frame, gpu::GpuMat &result)
|
||||
{
|
||||
CV_Assert(motions_ && stabilizationMotions_);
|
||||
|
||||
Reference in New Issue
Block a user