Merge commit '43aec5ad' into merge-2.4
Conflicts: cmake/OpenCVConfig.cmake cmake/OpenCVLegacyOptions.cmake modules/contrib/src/retina.cpp modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst modules/gpu/doc/video.rst modules/gpu/src/speckle_filtering.cpp modules/python/src2/cv2.cv.hpp modules/python/test/test2.py samples/python/watershed.py
This commit is contained in:
@@ -14,4 +14,3 @@ double getCameraPropertyC(void* camera, int propIdx);
|
||||
void setCameraPropertyC(void* camera, int propIdx, double value);
|
||||
void applyCameraPropertiesC(void** camera);
|
||||
}
|
||||
|
||||
|
@@ -44,4 +44,4 @@ private:
|
||||
int frameHeight;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -6,4 +6,3 @@ calib3d. Camera Calibration and 3D Reconstruction
|
||||
:maxdepth: 2
|
||||
|
||||
camera_calibration_and_3d_reconstruction
|
||||
|
||||
|
@@ -621,4 +621,3 @@ void epnp::qr_solve(CvMat * A, CvMat * b, CvMat * X)
|
||||
pX[i] = (pb[i] - sum) / A2[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -411,4 +411,3 @@ bool p3p::jacobi_4x4(double * A, double * D, double * U)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -59,4 +59,3 @@ class p3p
|
||||
};
|
||||
|
||||
#endif // P3P_H
|
||||
|
||||
|
@@ -348,4 +348,3 @@ void cv::solvePnPRansac(InputArray _opoints, InputArray _ipoints,
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -195,4 +195,3 @@ void CV_Affine3D_EstTest::run( int /* start_from */)
|
||||
}
|
||||
|
||||
TEST(Calib3d_EstimateAffineTransform, accuracy) { CV_Affine3D_EstTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -735,5 +735,3 @@ protected:
|
||||
TEST(Calib3d_CalibrateCamera_C, badarg) { CV_CameraCalibrationBadArgTest test; test.safe_run(); }
|
||||
TEST(Calib3d_Rodrigues_C, badarg) { CV_Rodrigues2BadArgTest test; test.safe_run(); }
|
||||
TEST(Calib3d_ProjectPoints_C, badarg) { CV_ProjectPoints2BadArgTest test; test.safe_run(); }
|
||||
|
||||
|
||||
|
@@ -329,4 +329,3 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const
|
||||
return generateChessBoard(bg, camMat, distCoeffs, zero, pb1, pb2,
|
||||
squareSize.width, squareSize.height, pts3d, corners);
|
||||
}
|
||||
|
||||
|
@@ -212,4 +212,3 @@ protected:
|
||||
};
|
||||
|
||||
TEST(Calib3d_ComposeRT, accuracy) { CV_composeRT_Test test; test.safe_run(); }
|
||||
|
||||
|
@@ -21,4 +21,3 @@ namespace cvtest
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -173,4 +173,3 @@ protected:
|
||||
};
|
||||
|
||||
TEST(Calib3d_ReprojectImageTo3D, accuracy) { CV_ReprojectImageTo3DTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -306,4 +306,4 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency)
|
||||
EXPECT_LT(tnorm, 1e-6);
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -94,4 +94,4 @@ void CV_UndistortTest::run(int /* start_from */)
|
||||
}
|
||||
}
|
||||
|
||||
TEST(Calib3d_Undistort, accuracy) { CV_UndistortTest test; test.safe_run(); }
|
||||
TEST(Calib3d_Undistort, accuracy) { CV_UndistortTest test; test.safe_run(); }
|
||||
|
@@ -626,5 +626,3 @@ CSV for the AT&T Facedatabase
|
||||
.. literalinclude:: etc/at.txt
|
||||
:language: none
|
||||
:linenos:
|
||||
|
||||
|
||||
|
@@ -30,4 +30,3 @@ Indices and tables
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
|
@@ -23,4 +23,3 @@ target_link_libraries(facerec_fisherfaces opencv_contrib opencv_core opencv_imgp
|
||||
|
||||
add_executable(facerec_lbph facerec_lbph.cpp)
|
||||
target_link_libraries(facerec_lbph opencv_contrib opencv_core opencv_imgproc opencv_highgui)
|
||||
|
||||
|
@@ -231,5 +231,3 @@ Here are some examples:
|
||||
+---------------------------------+----------------------------------------------------------------------------+
|
||||
| 0.2 (20%), 0.2 (20%), (70,70) | .. image:: ../img/tutorial/gender_classification/arnie_20_20_70_70.jpg |
|
||||
+---------------------------------+----------------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
@@ -44,4 +44,3 @@ And here is the Reconstruction, which is the same as the original:
|
||||
|
||||
.. image:: ../img/eigenface_reconstruction_opencv.png
|
||||
:align: center
|
||||
|
||||
|
@@ -205,5 +205,3 @@ Here are some examples:
|
||||
+---------------------------------+----------------------------------------------------------------------------+
|
||||
| 0.2 (20%), 0.2 (20%), (70,70) | .. image:: ../img/tutorial/gender_classification/arnie_20_20_70_70.jpg |
|
||||
+---------------------------------+----------------------------------------------------------------------------+
|
||||
|
||||
|
||||
|
@@ -113,5 +113,3 @@ The method executes the variational algorithm on a rectified stereo pair. See ``
|
||||
**Note**:
|
||||
|
||||
The method is not constant, so you should not use the same ``StereoVar`` instance from different threads simultaneously.
|
||||
|
||||
|
||||
|
@@ -286,5 +286,3 @@ void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histog
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@@ -136,4 +136,3 @@ Mat BOWMSCTrainer::cluster(const Mat& _descriptors) const {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -287,4 +287,3 @@ bool ChowLiuTree::reduceEdgesToMinSpan(std::list<info>& edges) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -132,5 +132,3 @@ Point2f CvMeanShiftTracker::getTrackingCenter()
|
||||
{
|
||||
return prev_center;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -41,4 +41,3 @@
|
||||
//M*/
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
|
@@ -892,4 +892,3 @@ const cv::DetectionBasedTracker::Parameters& DetectionBasedTracker::getParameter
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -221,4 +221,3 @@ Point2f CvFeatureTracker::getTrackingCenter()
|
||||
center.y = (float)(prev_center.y + prev_trackwindow.height/2.0);
|
||||
return center;
|
||||
}
|
||||
|
||||
|
@@ -721,4 +721,3 @@ void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int
|
||||
searchMode = tsTracking;
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -233,4 +233,3 @@ void CvHybridTracker::updateTrackerWithLowPassFilter(Mat) {
|
||||
Rect CvHybridTracker::getTrackingWindow() {
|
||||
return prev_window;
|
||||
}
|
||||
|
||||
|
@@ -1106,4 +1106,3 @@ Mat LDA::reconstruct(InputArray src) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -649,4 +649,3 @@ LogPolar_Adjacent::~LogPolar_Adjacent()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -408,4 +408,4 @@ void StereoVar::operator ()( const Mat& left, const Mat& right, Mat& disp )
|
||||
|
||||
u.release();
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
@@ -14,4 +14,3 @@
|
||||
#include <iostream>
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -544,7 +544,7 @@ Range
|
||||
-----
|
||||
.. ocv:class:: Range
|
||||
|
||||
Template class specifying a continuous subsequence (slice) of a sequence.
|
||||
Template class specifying a continuous subsequence (slice) of a sequence.
|
||||
|
||||
::
|
||||
|
||||
@@ -854,7 +854,7 @@ Mat
|
||||
---
|
||||
.. ocv:class:: Mat
|
||||
|
||||
OpenCV C++ n-dimensional dense array class
|
||||
OpenCV C++ n-dimensional dense array class
|
||||
::
|
||||
|
||||
class CV_EXPORTS Mat
|
||||
@@ -2941,4 +2941,3 @@ The above methods are usually enough for users. If you want to make your own alg
|
||||
* Add public virtual method ``AlgorithmInfo* info() const;`` to your class.
|
||||
* Add constructor function, ``AlgorithmInfo`` instance and implement the ``info()`` method. The simplest way is to take http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/ml/src/ml_init.cpp as the reference and modify it according to the list of your parameters.
|
||||
* Add some public function (e.g. ``initModule_<mymodule>()``) that calls info() of your algorithm and put it into the same source file as ``info()`` implementation. This is to force C++ linker to include this object file into the target application. See ``Algorithm::create()`` for details.
|
||||
|
||||
|
@@ -16,4 +16,3 @@ core. The Core Functionality
|
||||
clustering
|
||||
utility_and_system_functions_and_macros
|
||||
opengl_interop
|
||||
|
||||
|
@@ -1580,4 +1580,3 @@ Gathers all node pointers to a single sequence.
|
||||
:param storage: Container for the sequence
|
||||
|
||||
The function puts pointers of all nodes reachable from ``first`` into a single sequence. The pointers are written sequentially in the depth-first order.
|
||||
|
||||
|
@@ -1677,4 +1677,3 @@ For example, `NumPy <http://numpy.scipy.org/>`_ arrays support the array interfa
|
||||
(480, 640, 3) 1
|
||||
|
||||
.. note:: In the new Python wrappers (**cv2** module) the function is not needed, since cv2 can process Numpy arrays (and this is the only supported array type).
|
||||
|
||||
|
@@ -24,4 +24,3 @@ PERF_TEST_P(Size_MatType, abs, TYPICAL_MATS_ABS)
|
||||
|
||||
SANITY_CHECK(c);
|
||||
}
|
||||
|
||||
|
@@ -73,4 +73,3 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM)
|
||||
|
||||
SANITY_CHECK(c);
|
||||
}
|
||||
|
||||
|
@@ -34,4 +34,4 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
|
||||
TEST_CYCLE_MULTIRUN(runs) merge( (vector<Mat> &)mv, dst );
|
||||
|
||||
SANITY_CHECK(dst, 1e-12);
|
||||
}
|
||||
}
|
||||
|
@@ -1396,4 +1396,4 @@ CV_IMPL void cvNormalize( const CvArr* srcarr, CvArr* dstarr,
|
||||
cv::normalize( src, dst, a, b, norm_type, dst.type(), mask );
|
||||
}
|
||||
|
||||
/* End of file. */
|
||||
/* End of file. */
|
||||
|
@@ -1823,4 +1823,4 @@ cvSVBkSb( const CvArr* warr, const CvArr* uarr,
|
||||
|
||||
cv::SVD::backSubst(w, u, v, rhs, dst);
|
||||
CV_Assert( dst.data == dst0.data );
|
||||
}
|
||||
}
|
||||
|
@@ -454,45 +454,45 @@ cv::Scalar cv::sum( InputArray _src )
|
||||
{
|
||||
Mat src = _src.getMat();
|
||||
int k, cn = src.channels(), depth = src.depth();
|
||||
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
typedef IppStatus (CV_STDCALL* ippiSumFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiSumFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiSumFunc)ippiSum_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiSumFunc)ippiSum_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiSumFunc)ippiSum_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiSumFunc)ippiSum_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiSumFunc)ippiSum_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiSumFunc)ippiSum_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiSumFunc)ippiSum_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiSumFunc)ippiSum_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiSumFunc)ippiSum_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiSumFunc)ippiSum_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiSumFunc)ippiSum_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiSumFunc)ippiSum_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
typedef IppStatus (CV_STDCALL* ippiSumFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiSumFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiSumFunc)ippiSum_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiSumFunc)ippiSum_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiSumFunc)ippiSum_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiSumFunc)ippiSum_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiSumFunc)ippiSum_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiSumFunc)ippiSum_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiSumFunc)ippiSum_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiSumFunc)ippiSum_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiSumFunc)ippiSum_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiSumFunc)ippiSum_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiSumFunc)ippiSum_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiSumFunc)ippiSum_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SumFunc func = getSumFunc(depth);
|
||||
|
||||
CV_Assert( cn <= 4 && func != 0 );
|
||||
@@ -566,81 +566,81 @@ cv::Scalar cv::mean( InputArray _src, InputArray _mask )
|
||||
CV_Assert( mask.empty() || mask.type() == CV_8U );
|
||||
|
||||
int k, cn = src.channels(), depth = src.depth();
|
||||
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
if( !mask.empty() )
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, void *, int, IppiSize, Ipp64f *);
|
||||
ippiMaskMeanFuncC1 ippFuncC1 =
|
||||
type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR :
|
||||
type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR :
|
||||
type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR :
|
||||
0;
|
||||
if( ippFuncC1 )
|
||||
{
|
||||
Ipp64f res;
|
||||
if( ippFuncC1(src.data, src.step[0], mask.data, mask.step[0], sz, &res) >= 0 )
|
||||
{
|
||||
return Scalar(res);
|
||||
}
|
||||
}
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, void *, int, IppiSize, int, Ipp64f *);
|
||||
ippiMaskMeanFuncC3 ippFuncC3 =
|
||||
type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR :
|
||||
type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR :
|
||||
type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR :
|
||||
0;
|
||||
if( ippFuncC3 )
|
||||
{
|
||||
Ipp64f res1, res2, res3;
|
||||
if( ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 1, &res1) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 2, &res2) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 3, &res3) >= 0 )
|
||||
{
|
||||
return Scalar(res1, res2, res3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMeanFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiMeanFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiMeanFunc)ippiMean_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMeanFunc)ippiMean_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMeanFunc)ippiMean_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiMeanFunc)ippiMean_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiMeanFunc)ippiMean_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiMeanFunc)ippiMean_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiMeanFunc)ippiMean_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiMeanFunc)ippiMean_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiMeanFunc)ippiMean_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiMeanFunc)ippiMean_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMeanFunc)ippiMean_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMeanFunc)ippiMean_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
size_t total_size = src.total();
|
||||
int rows = src.size[0], cols = (int)(total_size/rows);
|
||||
if( src.dims == 2 || (src.isContinuous() && mask.isContinuous() && cols > 0 && (size_t)rows*cols == total_size) )
|
||||
{
|
||||
IppiSize sz = { cols, rows };
|
||||
int type = src.type();
|
||||
if( !mask.empty() )
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC1)(const void *, int, void *, int, IppiSize, Ipp64f *);
|
||||
ippiMaskMeanFuncC1 ippFuncC1 =
|
||||
type == CV_8UC1 ? (ippiMaskMeanFuncC1)ippiMean_8u_C1MR :
|
||||
type == CV_16UC1 ? (ippiMaskMeanFuncC1)ippiMean_16u_C1MR :
|
||||
type == CV_32FC1 ? (ippiMaskMeanFuncC1)ippiMean_32f_C1MR :
|
||||
0;
|
||||
if( ippFuncC1 )
|
||||
{
|
||||
Ipp64f res;
|
||||
if( ippFuncC1(src.data, src.step[0], mask.data, mask.step[0], sz, &res) >= 0 )
|
||||
{
|
||||
return Scalar(res);
|
||||
}
|
||||
}
|
||||
typedef IppStatus (CV_STDCALL* ippiMaskMeanFuncC3)(const void *, int, void *, int, IppiSize, int, Ipp64f *);
|
||||
ippiMaskMeanFuncC3 ippFuncC3 =
|
||||
type == CV_8UC3 ? (ippiMaskMeanFuncC3)ippiMean_8u_C3CMR :
|
||||
type == CV_16UC3 ? (ippiMaskMeanFuncC3)ippiMean_16u_C3CMR :
|
||||
type == CV_32FC3 ? (ippiMaskMeanFuncC3)ippiMean_32f_C3CMR :
|
||||
0;
|
||||
if( ippFuncC3 )
|
||||
{
|
||||
Ipp64f res1, res2, res3;
|
||||
if( ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 1, &res1) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 2, &res2) >= 0 &&
|
||||
ippFuncC3(src.data, src.step[0], mask.data, mask.step[0], sz, 3, &res3) >= 0 )
|
||||
{
|
||||
return Scalar(res1, res2, res3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef IppStatus (CV_STDCALL* ippiMeanFunc)(const void*, int, IppiSize, double *, int);
|
||||
ippiMeanFunc ippFunc =
|
||||
type == CV_8UC1 ? (ippiMeanFunc)ippiMean_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMeanFunc)ippiMean_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMeanFunc)ippiMean_8u_C4R :
|
||||
type == CV_16UC1 ? (ippiMeanFunc)ippiMean_16u_C1R :
|
||||
type == CV_16UC3 ? (ippiMeanFunc)ippiMean_16u_C3R :
|
||||
type == CV_16UC4 ? (ippiMeanFunc)ippiMean_16u_C4R :
|
||||
type == CV_16SC1 ? (ippiMeanFunc)ippiMean_16s_C1R :
|
||||
type == CV_16SC3 ? (ippiMeanFunc)ippiMean_16s_C3R :
|
||||
type == CV_16SC4 ? (ippiMeanFunc)ippiMean_16s_C4R :
|
||||
type == CV_32FC1 ? (ippiMeanFunc)ippiMean_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMeanFunc)ippiMean_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMeanFunc)ippiMean_32f_C4R :
|
||||
0;
|
||||
if( ippFunc )
|
||||
{
|
||||
Ipp64f res[4];
|
||||
if( ippFunc(src.data, src.step[0], sz, res, ippAlgHintAccurate) >= 0 )
|
||||
{
|
||||
Scalar sc;
|
||||
for( int i = 0; i < cn; i++ )
|
||||
{
|
||||
sc[i] = res[i];
|
||||
}
|
||||
return sc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
SumFunc func = getSumFunc(depth);
|
||||
|
||||
CV_Assert( cn <= 4 && func != 0 );
|
||||
|
@@ -2118,5 +2118,3 @@ TEST(Core_DS_Seq, sort_invert) { Core_SeqSortInvTest test; test.safe_run(); }
|
||||
TEST(Core_DS_Set, basic_operations) { Core_SetTest test; test.safe_run(); }
|
||||
TEST(Core_DS_Graph, basic_operations) { Core_GraphTest test; test.safe_run(); }
|
||||
TEST(Core_DS_Graph, scan) { Core_GraphScanTest test; test.safe_run(); }
|
||||
|
||||
|
||||
|
@@ -866,5 +866,3 @@ protected:
|
||||
};
|
||||
|
||||
TEST(Core_DFT, complex_output) { Core_DFTComplexOutputTest test; test.safe_run(); }
|
||||
|
||||
|
||||
|
@@ -406,7 +406,7 @@ protected:
|
||||
Vec<int, 5> v1(15, 16, 17, 18, 19), ov1;
|
||||
Scalar sc1(20.0, 21.1, 22.2, 23.3), osc1;
|
||||
Range g1(7, 8), og1;
|
||||
|
||||
|
||||
FileStorage fs(fname, FileStorage::WRITE);
|
||||
fs << "mi" << mi;
|
||||
fs << "mv" << mv;
|
||||
|
@@ -2755,4 +2755,3 @@ TEST(CovariationMatrixVectorOfMatWithMean, accuracy)
|
||||
}
|
||||
|
||||
/* End of file. */
|
||||
|
||||
|
@@ -1,3 +1,2 @@
|
||||
set(the_description "2D Features Framework")
|
||||
ocv_define_module(features2d opencv_imgproc opencv_flann OPTIONAL opencv_highgui)
|
||||
|
||||
|
@@ -274,5 +274,3 @@ Example: ::
|
||||
|
||||
VectorDescriptorMatcher matcher( new SurfDescriptorExtractor,
|
||||
new BruteForceMatcher<L2<float> > );
|
||||
|
||||
|
||||
|
@@ -41,4 +41,3 @@ PERF_TEST_P(fast, detect, testing::Combine(
|
||||
|
||||
SANITY_CHECK_KEYPOINTS(points);
|
||||
}
|
||||
|
||||
|
@@ -176,10 +176,10 @@ void BOWImgDescriptorExtractor::compute( const Mat& image, std::vector<KeyPoint>
|
||||
|
||||
// Normalize image descriptor.
|
||||
imgDescriptor /= descriptors.rows;
|
||||
|
||||
|
||||
// Add the descriptors of image keypoints
|
||||
if (_descriptors) {
|
||||
*_descriptors = descriptors.clone();
|
||||
*_descriptors = descriptors.clone();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -257,7 +257,7 @@ struct IntersectAreaCounter
|
||||
{
|
||||
CV_Assert( miny < maxy );
|
||||
CV_Assert( dr > FLT_EPSILON );
|
||||
|
||||
|
||||
int temp_bua = bua, temp_bna = bna;
|
||||
for( int i = range.begin(); i != range.end(); i++ )
|
||||
{
|
||||
|
@@ -357,4 +357,3 @@ int cornerScore<8>(const uchar* ptr, const int pixel[], int threshold)
|
||||
}
|
||||
|
||||
} // namespace cv
|
||||
|
||||
|
@@ -93,4 +93,3 @@ void CV_BRISKTest::run( int )
|
||||
}
|
||||
|
||||
TEST(Features2d_BRISK, regression) { CV_BRISKTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -135,4 +135,3 @@ void CV_FastTest::run( int )
|
||||
}
|
||||
|
||||
TEST(Features2d_FAST, regression) { CV_FastTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -166,5 +166,3 @@ TEST(Features2d_Detector_Keypoints_Dense, validation)
|
||||
CV_FeatureDetectorKeypointsTest test(Algorithm::create<FeatureDetector>("Feature2D.Dense"));
|
||||
test.safe_run();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -205,4 +205,3 @@ void CV_MserTest::run(int)
|
||||
}
|
||||
|
||||
TEST(Features2d_MSER, DISABLED_regression) { CV_MserTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -1,3 +1,2 @@
|
||||
set(the_description "Clustering and Search in Multi-Dimensional Spaces")
|
||||
ocv_define_module(flann opencv_core)
|
||||
|
||||
|
@@ -131,5 +131,3 @@ public:
|
||||
}
|
||||
|
||||
#endif //OPENCV_FLANN_RANDOM_H
|
||||
|
||||
|
||||
|
@@ -540,4 +540,3 @@ private:
|
||||
}
|
||||
|
||||
#endif //OPENCV_FLANN_RESULTSET_H
|
||||
|
||||
|
@@ -54,4 +54,4 @@ namespace cvflann
|
||||
}
|
||||
|
||||
void dummyfunc() {}
|
||||
}
|
||||
}
|
||||
|
@@ -309,4 +309,3 @@ Class that enables getting ``cudaStream_t`` from :ocv:class:`gpu::Stream` and is
|
||||
{
|
||||
CV_EXPORTS static cudaStream_t getStream(const Stream& stream);
|
||||
};
|
||||
|
||||
|
@@ -60,4 +60,3 @@ With this algorithm, a dual GPU gave a 180
|
||||
%
|
||||
performance increase comparing to the single Fermi GPU. For a source code example, see
|
||||
http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/gpu/.
|
||||
|
||||
|
@@ -257,4 +257,3 @@ if __name__ == "__main__":
|
||||
outputFile = open(sys.argv[2], 'w')
|
||||
outputFile.writelines(lines)
|
||||
outputFile.close()
|
||||
|
||||
|
@@ -290,5 +290,3 @@ void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& cam
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@@ -334,5 +334,3 @@ See below various examples of the ``createButton`` function call: ::
|
||||
createButton("button6",callbackButton2,NULL,CV_PUSH_BUTTON,1);
|
||||
|
||||
..
|
||||
|
||||
|
||||
|
@@ -539,4 +539,3 @@ Writes the next video frame
|
||||
:param image: The written frame
|
||||
|
||||
The functions/methods write the specified image to video file. It must have the same size as has been specified when opening the video writer.
|
||||
|
||||
|
@@ -46,4 +46,4 @@
|
||||
|
||||
UIImage* MatToUIImage(const cv::Mat& image);
|
||||
void UIImageToMat(const UIImage* image,
|
||||
cv::Mat& m, bool alphaExist = false);
|
||||
cv::Mat& m, bool alphaExist = false);
|
||||
|
@@ -37,4 +37,4 @@ PERF_TEST_P(VideoCapture_Reading, ReadFile, testing::Values( "highgui/video/big_
|
||||
SANITY_CHECK(dummy);
|
||||
}
|
||||
|
||||
#endif // BUILD_WITH_VIDEO_INPUT_SUPPORT
|
||||
#endif // BUILD_WITH_VIDEO_INPUT_SUPPORT
|
||||
|
@@ -1325,4 +1325,3 @@ bool CvVideoWriter_AVFoundation::writeFrame(const IplImage* iplimage) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -96,4 +96,3 @@ typedef int (*Read_InputMediaStream_FFMPEG_Plugin)(struct InputMediaStream_FFMPE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -491,4 +491,3 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -388,7 +388,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;};
|
||||
|
||||
- (CVPixelBufferRef) pixelBufferFromCGImage: (CGImageRef) image
|
||||
{
|
||||
|
||||
|
||||
CGSize frameSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image));
|
||||
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool:NO], kCVPixelBufferCGImageCompatibilityKey,
|
||||
@@ -399,23 +399,23 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;};
|
||||
frameSize.height, kCVPixelFormatType_32ARGB, (CFDictionaryRef) CFBridgingRetain(options),
|
||||
&pxbuffer);
|
||||
NSParameterAssert(status == kCVReturnSuccess && pxbuffer != NULL);
|
||||
|
||||
|
||||
CVPixelBufferLockBaseAddress(pxbuffer, 0);
|
||||
void *pxdata = CVPixelBufferGetBaseAddress(pxbuffer);
|
||||
|
||||
|
||||
|
||||
|
||||
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
CGContextRef context = CGBitmapContextCreate(pxdata, frameSize.width,
|
||||
frameSize.height, 8, 4*frameSize.width, rgbColorSpace,
|
||||
kCGImageAlphaPremultipliedFirst);
|
||||
|
||||
|
||||
CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image),
|
||||
CGImageGetHeight(image)), image);
|
||||
CGColorSpaceRelease(rgbColorSpace);
|
||||
CGContextRelease(context);
|
||||
|
||||
|
||||
CVPixelBufferUnlockBaseAddress(pxbuffer, 0);
|
||||
|
||||
|
||||
return pxbuffer;
|
||||
}
|
||||
|
||||
@@ -616,4 +616,3 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;};
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -14,7 +14,7 @@ It has been tested with the motempl sample program
|
||||
First Patch: August 24, 2004 Travis Wood TravisOCV@tkwood.com
|
||||
For Release: OpenCV-Linux Beta4 opencv-0.9.6
|
||||
Tested On: LMLBT44 with 8 video inputs
|
||||
Problems? Post your questions at answers.opencv.org,
|
||||
Problems? Post your questions at answers.opencv.org,
|
||||
Report bugs at code.opencv.org,
|
||||
Submit your fixes at https://github.com/Itseez/opencv/
|
||||
Patched Comments:
|
||||
|
@@ -3026,7 +3026,7 @@ double CvCaptureFile_MSMF::getProperty(int property_id)
|
||||
return ((double)captureFormats[captureFormatIndex].MF_MT_FRAME_RATE_NUMERATOR) /
|
||||
((double)captureFormats[captureFormatIndex].MF_MT_FRAME_RATE_DENOMINATOR);
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -3062,7 +3062,7 @@ IplImage* CvCaptureFile_MSMF::retrieveFrame(int)
|
||||
|
||||
if(RIOut && size == RIOut->getSize())
|
||||
{
|
||||
videoInput::processPixels(RIOut->getpPixels(), (unsigned char*)frame->imageData, width,
|
||||
videoInput::processPixels(RIOut->getpPixels(), (unsigned char*)frame->imageData, width,
|
||||
height, bytes, false, verticalFlip);
|
||||
}
|
||||
|
||||
@@ -3532,4 +3532,4 @@ CvVideoWriter* cvCreateVideoWriter_MSMF( const char* filename, int fourcc,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -411,9 +411,9 @@ int CvCaptureCAM::startCaptureDevice(int cameraNum) {
|
||||
|
||||
void CvCaptureCAM::setWidthHeight() {
|
||||
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
|
||||
[mCaptureSession stopRunning];
|
||||
|
||||
|
||||
NSDictionary* pixelBufferOptions = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithDouble:1.0*width], (id)kCVPixelBufferWidthKey,
|
||||
[NSNumber numberWithDouble:1.0*height], (id)kCVPixelBufferHeightKey,
|
||||
@@ -422,9 +422,9 @@ void CvCaptureCAM::setWidthHeight() {
|
||||
nil];
|
||||
|
||||
[mCaptureDecompressedVideoOutput setPixelBufferAttributes:pixelBufferOptions];
|
||||
|
||||
|
||||
[mCaptureSession startRunning];
|
||||
|
||||
|
||||
grabFrame(60);
|
||||
[localpool drain];
|
||||
}
|
||||
@@ -1044,4 +1044,3 @@ bool CvVideoWriter_QT::writeFrame(const IplImage* image) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ It has been tested with the motempl sample program
|
||||
First Patch: August 24, 2004 Travis Wood TravisOCV@tkwood.com
|
||||
For Release: OpenCV-Linux Beta4 opencv-0.9.6
|
||||
Tested On: LMLBT44 with 8 video inputs
|
||||
Problems? Post your questions at answers.opencv.org,
|
||||
Problems? Post your questions at answers.opencv.org,
|
||||
Report bugs at code.opencv.org,
|
||||
Submit your fixes at https://github.com/Itseez/opencv/
|
||||
Patched Comments:
|
||||
|
@@ -218,7 +218,7 @@ void CvCaptureCAM_XIMEA::resetCvImage()
|
||||
default :
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
cvZero(frame);
|
||||
}
|
||||
/**********************************************************************************/
|
||||
@@ -348,4 +348,4 @@ int CvCaptureCAM_XIMEA::getBpp()
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************************************************/
|
||||
/**********************************************************************************/
|
||||
|
@@ -16,4 +16,4 @@ The license does not permit the following uses:
|
||||
|
||||
You may not use, or allow anyone else to use the icons to create pornographic, libelous, obscene, or defamatory material.
|
||||
|
||||
All icon files are provided "as is". You agree not to hold IconEden.com liable for any damages that may occur due to use, or inability to use, icons or image data from IconEden.com.
|
||||
All icon files are provided "as is". You agree not to hold IconEden.com liable for any damages that may occur due to use, or inability to use, icons or image data from IconEden.com.
|
||||
|
@@ -563,4 +563,3 @@ bool BmpEncoder::write( const Mat& img, const std::vector<int>& )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -44,21 +44,21 @@
|
||||
#include "precomp.hpp"
|
||||
|
||||
UIImage* MatToUIImage(const cv::Mat& image) {
|
||||
|
||||
|
||||
NSData *data = [NSData dataWithBytes:image.data
|
||||
length:image.elemSize()*image.total()];
|
||||
|
||||
|
||||
CGColorSpaceRef colorSpace;
|
||||
|
||||
|
||||
if (image.elemSize() == 1) {
|
||||
colorSpace = CGColorSpaceCreateDeviceGray();
|
||||
} else {
|
||||
colorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
}
|
||||
|
||||
|
||||
CGDataProviderRef provider =
|
||||
CGDataProviderCreateWithCFData((__bridge CFDataRef)data);
|
||||
|
||||
|
||||
// Creating CGImage from cv::Mat
|
||||
CGImageRef imageRef = CGImageCreate(image.cols,
|
||||
image.rows,
|
||||
@@ -73,14 +73,14 @@ UIImage* MatToUIImage(const cv::Mat& image) {
|
||||
false,
|
||||
kCGRenderingIntentDefault
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
// Getting UIImage from CGImage
|
||||
UIImage *finalImage = [UIImage imageWithCGImage:imageRef];
|
||||
CGImageRelease(imageRef);
|
||||
CGDataProviderRelease(provider);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
|
||||
|
||||
return finalImage;
|
||||
}
|
||||
|
||||
@@ -114,4 +114,4 @@ void UIImageToMat(const UIImage* image,
|
||||
image.CGImage);
|
||||
CGContextRelease(contextRef);
|
||||
CGColorSpaceRelease(colorSpace);
|
||||
}
|
||||
}
|
||||
|
@@ -2474,7 +2474,7 @@ void DefaultViewPort::saveView()
|
||||
if (!fileName.isEmpty()) //save the picture
|
||||
{
|
||||
QString extension = fileName.right(3);
|
||||
|
||||
|
||||
// Create a new pixmap to render the viewport into
|
||||
QPixmap viewportPixmap(viewport()->size());
|
||||
viewport()->render(&viewportPixmap);
|
||||
|
@@ -112,4 +112,4 @@ TEST(Highgui_dshow, fourcc_conversion)
|
||||
|
||||
EXPECT_EQ(fourcc, (unsigned long)(unsigned)fourccFromParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,3 @@
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
CV_TEST_MAIN("highgui")
|
||||
|
||||
|
@@ -220,4 +220,4 @@ void CV_VideoRandomPositioningTest::run(int)
|
||||
#if BUILD_WITH_VIDEO_INPUT_SUPPORT && defined HAVE_FFMPEG
|
||||
TEST (Highgui_Video, seek_progressive) { CV_VideoProgressivePositioningTest test; test.safe_run(); }
|
||||
TEST (Highgui_Video, seek_random) { CV_VideoRandomPositioningTest test; test.safe_run(); }
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1570,4 +1570,3 @@ is equivalent to
|
||||
.. seealso::
|
||||
|
||||
:ocv:func:`cartToPolar`
|
||||
|
||||
|
@@ -682,5 +682,3 @@ The function is similar to
|
||||
where ``undistort()`` is an approximate iterative algorithm that estimates the normalized original point coordinates out of the normalized distorted point coordinates ("normalized" means that the coordinates do not depend on the camera matrix).
|
||||
|
||||
The function can be used for both a stereo camera head or a monocular camera (when R is empty).
|
||||
|
||||
|
||||
|
@@ -37,4 +37,4 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerEigenValsAndVecs,
|
||||
extractChannel(dst, l1, 0);
|
||||
|
||||
SANITY_CHECK(l1, 2e-5);
|
||||
}
|
||||
}
|
||||
|
@@ -36,4 +36,4 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris,
|
||||
TEST_CYCLE() cornerHarris(src, dst, blockSize, apertureSize, k, borderType);
|
||||
|
||||
SANITY_CHECK(dst, 2e-5);
|
||||
}
|
||||
}
|
||||
|
@@ -72,5 +72,3 @@ PERF_TEST_P( Image_KernelSize, GaborFilter2d,
|
||||
|
||||
SANITY_CHECK(filteredImage, 1e-3);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -221,4 +221,3 @@ PERF_TEST(Transform, getPerspectiveTransform)
|
||||
|
||||
SANITY_CHECK(transformCoefficient, 1e-5);
|
||||
}
|
||||
|
||||
|
@@ -1139,134 +1139,134 @@ private:
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kernel, const Point &anchor)
|
||||
{
|
||||
int type = src.type();
|
||||
const Mat* _src = &src;
|
||||
Mat temp;
|
||||
if( src.data == dst.data )
|
||||
{
|
||||
src.copyTo(temp);
|
||||
_src = &temp;
|
||||
}
|
||||
//DEPRECATED. Allocates and initializes morphology state structure for erosion or dilation operation.
|
||||
typedef IppStatus (CV_STDCALL* ippiMorphologyInitAllocFunc)(int, const void*, IppiSize, IppiPoint, IppiMorphState **);
|
||||
ippiMorphologyInitAllocFunc ippInitAllocFunc =
|
||||
type == CV_8UC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C4R :
|
||||
type == CV_32FC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C4R :
|
||||
0;
|
||||
typedef IppStatus (CV_STDCALL* ippiMorphologyBorderReplicateFunc)(const void*, int, void *, int, IppiSize, IppiBorderType, IppiMorphState *);
|
||||
ippiMorphologyBorderReplicateFunc ippFunc = 0;
|
||||
switch( op )
|
||||
{
|
||||
case MORPH_DILATE:
|
||||
{
|
||||
ippFunc =
|
||||
type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C4R :
|
||||
type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C4R :
|
||||
0;
|
||||
break;
|
||||
}
|
||||
case MORPH_ERODE:
|
||||
{
|
||||
ippFunc =
|
||||
type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C4R :
|
||||
type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C4R :
|
||||
0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( ippFunc && ippInitAllocFunc)
|
||||
{
|
||||
IppiMorphState* pState;
|
||||
IppiSize roiSize = {src.cols, src.rows};
|
||||
IppiSize kernelSize = {kernel.cols, kernel.rows};
|
||||
IppiPoint point = {anchor.x, anchor.y};
|
||||
if( ippInitAllocFunc( roiSize.width, kernel.data, kernelSize, point, &pState ) < 0 )
|
||||
return false;
|
||||
bool is_ok = ippFunc( _src->data, _src->step[0], dst.data, dst.step[0], roiSize, ippBorderRepl, pState ) >= 0;
|
||||
ippiMorphologyFree(pState);
|
||||
return is_ok;
|
||||
}
|
||||
return false;
|
||||
int type = src.type();
|
||||
const Mat* _src = &src;
|
||||
Mat temp;
|
||||
if( src.data == dst.data )
|
||||
{
|
||||
src.copyTo(temp);
|
||||
_src = &temp;
|
||||
}
|
||||
//DEPRECATED. Allocates and initializes morphology state structure for erosion or dilation operation.
|
||||
typedef IppStatus (CV_STDCALL* ippiMorphologyInitAllocFunc)(int, const void*, IppiSize, IppiPoint, IppiMorphState **);
|
||||
ippiMorphologyInitAllocFunc ippInitAllocFunc =
|
||||
type == CV_8UC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_8u_C4R :
|
||||
type == CV_32FC1 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMorphologyInitAllocFunc)ippiMorphologyInitAlloc_32f_C4R :
|
||||
0;
|
||||
typedef IppStatus (CV_STDCALL* ippiMorphologyBorderReplicateFunc)(const void*, int, void *, int, IppiSize, IppiBorderType, IppiMorphState *);
|
||||
ippiMorphologyBorderReplicateFunc ippFunc = 0;
|
||||
switch( op )
|
||||
{
|
||||
case MORPH_DILATE:
|
||||
{
|
||||
ippFunc =
|
||||
type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_8u_C4R :
|
||||
type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiDilateBorderReplicate_32f_C4R :
|
||||
0;
|
||||
break;
|
||||
}
|
||||
case MORPH_ERODE:
|
||||
{
|
||||
ippFunc =
|
||||
type == CV_8UC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C1R :
|
||||
type == CV_8UC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C3R :
|
||||
type == CV_8UC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_8u_C4R :
|
||||
type == CV_32FC1 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C1R :
|
||||
type == CV_32FC3 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C3R :
|
||||
type == CV_32FC4 ? (ippiMorphologyBorderReplicateFunc)ippiErodeBorderReplicate_32f_C4R :
|
||||
0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( ippFunc && ippInitAllocFunc)
|
||||
{
|
||||
IppiMorphState* pState;
|
||||
IppiSize roiSize = {src.cols, src.rows};
|
||||
IppiSize kernelSize = {kernel.cols, kernel.rows};
|
||||
IppiPoint point = {anchor.x, anchor.y};
|
||||
if( ippInitAllocFunc( roiSize.width, kernel.data, kernelSize, point, &pState ) < 0 )
|
||||
return false;
|
||||
bool is_ok = ippFunc( _src->data, _src->step[0], dst.data, dst.step[0], roiSize, ippBorderRepl, pState ) >= 0;
|
||||
ippiMorphologyFree(pState);
|
||||
return is_ok;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool IPPMorphOp(int op, InputArray _src, OutputArray _dst,
|
||||
InputArray _kernel,
|
||||
const Point &anchor, int iterations,
|
||||
int borderType, const Scalar &borderValue)
|
||||
InputArray _kernel,
|
||||
const Point &anchor, int iterations,
|
||||
int borderType, const Scalar &borderValue)
|
||||
{
|
||||
Mat src = _src.getMat(), kernel = _kernel.getMat();
|
||||
if( !( src.depth() == CV_8U || src.depth() == CV_32F ) || ( iterations > 1 ) ||
|
||||
!( borderType == cv::BORDER_REPLICATE || (borderType == cv::BORDER_CONSTANT && borderValue == morphologyDefaultBorderValue()) )
|
||||
|| !( op == MORPH_DILATE || op == MORPH_ERODE) )
|
||||
return false;
|
||||
if( borderType == cv::BORDER_CONSTANT )
|
||||
{
|
||||
int x, y;
|
||||
for( y = 0; y < kernel.rows; y++ )
|
||||
{
|
||||
if( kernel.at<uchar>(y, anchor.x) != 0 )
|
||||
continue;
|
||||
for( x = 0; x < kernel.cols; x++ )
|
||||
{
|
||||
if( kernel.at<uchar>(y,x) != 0 )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for( x = 0; y < kernel.cols; x++ )
|
||||
{
|
||||
if( kernel.at<uchar>(anchor.y, x) != 0 )
|
||||
continue;
|
||||
for( y = 0; y < kernel.rows; y++ )
|
||||
{
|
||||
if( kernel.at<uchar>(y,x) != 0 )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Mat src = _src.getMat(), kernel = _kernel.getMat();
|
||||
if( !( src.depth() == CV_8U || src.depth() == CV_32F ) || ( iterations > 1 ) ||
|
||||
!( borderType == cv::BORDER_REPLICATE || (borderType == cv::BORDER_CONSTANT && borderValue == morphologyDefaultBorderValue()) )
|
||||
|| !( op == MORPH_DILATE || op == MORPH_ERODE) )
|
||||
return false;
|
||||
if( borderType == cv::BORDER_CONSTANT )
|
||||
{
|
||||
int x, y;
|
||||
for( y = 0; y < kernel.rows; y++ )
|
||||
{
|
||||
if( kernel.at<uchar>(y, anchor.x) != 0 )
|
||||
continue;
|
||||
for( x = 0; x < kernel.cols; x++ )
|
||||
{
|
||||
if( kernel.at<uchar>(y,x) != 0 )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for( x = 0; y < kernel.cols; x++ )
|
||||
{
|
||||
if( kernel.at<uchar>(anchor.y, x) != 0 )
|
||||
continue;
|
||||
for( y = 0; y < kernel.rows; y++ )
|
||||
{
|
||||
if( kernel.at<uchar>(y,x) != 0 )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Size ksize = kernel.data ? kernel.size() : Size(3,3);
|
||||
Point normanchor = normalizeAnchor(anchor, ksize);
|
||||
}
|
||||
Size ksize = kernel.data ? kernel.size() : Size(3,3);
|
||||
Point normanchor = normalizeAnchor(anchor, ksize);
|
||||
|
||||
CV_Assert( normanchor.inside(Rect(0, 0, ksize.width, ksize.height)) );
|
||||
CV_Assert( normanchor.inside(Rect(0, 0, ksize.width, ksize.height)) );
|
||||
|
||||
_dst.create( src.size(), src.type() );
|
||||
Mat dst = _dst.getMat();
|
||||
_dst.create( src.size(), src.type() );
|
||||
Mat dst = _dst.getMat();
|
||||
|
||||
if( iterations == 0 || kernel.rows*kernel.cols == 1 )
|
||||
{
|
||||
src.copyTo(dst);
|
||||
return true;
|
||||
}
|
||||
if( iterations == 0 || kernel.rows*kernel.cols == 1 )
|
||||
{
|
||||
src.copyTo(dst);
|
||||
return true;
|
||||
}
|
||||
|
||||
if( !kernel.data )
|
||||
{
|
||||
kernel = getStructuringElement(MORPH_RECT, Size(1+iterations*2,1+iterations*2));
|
||||
normanchor = Point(iterations, iterations);
|
||||
iterations = 1;
|
||||
}
|
||||
else if( iterations > 1 && countNonZero(kernel) == kernel.rows*kernel.cols )
|
||||
{
|
||||
normanchor = Point(normanchor.x*iterations, normanchor.y*iterations);
|
||||
kernel = getStructuringElement(MORPH_RECT,
|
||||
Size(ksize.width + (iterations-1)*(ksize.width-1),
|
||||
ksize.height + (iterations-1)*(ksize.height-1)),
|
||||
normanchor);
|
||||
iterations = 1;
|
||||
}
|
||||
if( !kernel.data )
|
||||
{
|
||||
kernel = getStructuringElement(MORPH_RECT, Size(1+iterations*2,1+iterations*2));
|
||||
normanchor = Point(iterations, iterations);
|
||||
iterations = 1;
|
||||
}
|
||||
else if( iterations > 1 && countNonZero(kernel) == kernel.rows*kernel.cols )
|
||||
{
|
||||
normanchor = Point(normanchor.x*iterations, normanchor.y*iterations);
|
||||
kernel = getStructuringElement(MORPH_RECT,
|
||||
Size(ksize.width + (iterations-1)*(ksize.width-1),
|
||||
ksize.height + (iterations-1)*(ksize.height-1)),
|
||||
normanchor);
|
||||
iterations = 1;
|
||||
}
|
||||
|
||||
return IPPMorphReplicate( op, src, dst, kernel, normanchor );
|
||||
return IPPMorphReplicate( op, src, dst, kernel, normanchor );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1277,8 +1277,8 @@ static void morphOp( int op, InputArray _src, OutputArray _dst,
|
||||
{
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
if( IPPMorphOp(op, _src, _dst, _kernel, anchor, iterations, borderType, borderValue) )
|
||||
return;
|
||||
if( IPPMorphOp(op, _src, _dst, _kernel, anchor, iterations, borderType, borderValue) )
|
||||
return;
|
||||
#endif
|
||||
|
||||
Mat src = _src.getMat(), kernel = _kernel.getMat();
|
||||
|
@@ -239,49 +239,49 @@ void cv::integral( InputArray _src, OutputArray _sum, OutputArray _sqsum, Output
|
||||
sdepth = CV_MAT_DEPTH(sdepth);
|
||||
|
||||
#if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7)
|
||||
if( ( depth == CV_8U ) && ( !_tilted.needed() ) )
|
||||
{
|
||||
if( sdepth == CV_32F )
|
||||
{
|
||||
if( cn == 1 )
|
||||
{
|
||||
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
|
||||
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
|
||||
sum = _sum.getMat();
|
||||
if( _sqsum.needed() )
|
||||
{
|
||||
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
|
||||
sqsum = _sqsum.getMat();
|
||||
ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, srcRoiSize, 0 );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( sdepth == CV_32S )
|
||||
{
|
||||
if( cn == 1 )
|
||||
{
|
||||
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
|
||||
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
|
||||
sum = _sum.getMat();
|
||||
if( _sqsum.needed() )
|
||||
{
|
||||
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
|
||||
sqsum = _sqsum.getMat();
|
||||
ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, srcRoiSize, 0 );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( ( depth == CV_8U ) && ( !_tilted.needed() ) )
|
||||
{
|
||||
if( sdepth == CV_32F )
|
||||
{
|
||||
if( cn == 1 )
|
||||
{
|
||||
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
|
||||
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
|
||||
sum = _sum.getMat();
|
||||
if( _sqsum.needed() )
|
||||
{
|
||||
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
|
||||
sqsum = _sqsum.getMat();
|
||||
ippiSqrIntegral_8u32f64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
ippiIntegral_8u32f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32f*)sum.data, sum.step, srcRoiSize, 0 );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( sdepth == CV_32S )
|
||||
{
|
||||
if( cn == 1 )
|
||||
{
|
||||
IppiSize srcRoiSize = ippiSize( src.cols, src.rows );
|
||||
_sum.create( isize, CV_MAKETYPE( sdepth, cn ) );
|
||||
sum = _sum.getMat();
|
||||
if( _sqsum.needed() )
|
||||
{
|
||||
_sqsum.create( isize, CV_MAKETYPE( CV_64F, cn ) );
|
||||
sqsum = _sqsum.getMat();
|
||||
ippiSqrIntegral_8u32s64f_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, (Ipp64f*)sqsum.data, sqsum.step, srcRoiSize, 0, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
ippiIntegral_8u32s_C1R( (const Ipp8u*)src.data, src.step, (Ipp32s*)sum.data, sum.step, srcRoiSize, 0 );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
_sum.create( isize, CV_MAKETYPE(sdepth, cn) );
|
||||
|
@@ -356,4 +356,3 @@ _exit_:
|
||||
}
|
||||
|
||||
TEST(Imgproc_ApproxPoly, accuracy) { CV_ApproxPolyTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -1700,4 +1700,3 @@ TEST(Imgproc_ContourPerimeterSlice, accuracy) { CV_PerimeterAreaSliceTest test;
|
||||
TEST(Imgproc_FitEllipse, small) { CV_FitEllipseSmallTest test; test.safe_run(); }
|
||||
|
||||
/* End of file. */
|
||||
|
||||
|
@@ -283,5 +283,3 @@ void CV_DisTransTest::prepare_to_validation( int /*test_case_idx*/ )
|
||||
|
||||
|
||||
TEST(Imgproc_DistanceTransform, accuracy) { CV_DisTransTest test; test.safe_run(); }
|
||||
|
||||
|
||||
|
@@ -1886,4 +1886,3 @@ protected:
|
||||
};
|
||||
|
||||
TEST(Imgproc_Filtering, supportedFormats) { CV_FilterSupportedFormatsTest test; test.safe_run(); }
|
||||
|
||||
|
@@ -318,4 +318,3 @@ void CV_ThreshTest::prepare_to_validation( int /*test_case_idx*/ )
|
||||
}
|
||||
|
||||
TEST(Imgproc_Threshold, accuracy) { CV_ThreshTest test; test.safe_run(); }
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user