Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4' into merge-2.4
Browse files Browse the repository at this point in the history
Conflicts:
	.gitignore
	modules/contrib/src/detection_based_tracker.cpp
	modules/core/include/opencv2/core/core.hpp
	modules/core/include/opencv2/core/internal.hpp
	modules/core/src/gpumat.cpp
	modules/core/src/opengl.cpp
	modules/gpu/src/cuda/safe_call.hpp
	modules/highgui/src/cap.cpp
	modules/imgproc/include/opencv2/imgproc/imgproc.hpp
	modules/ocl/doc/image_processing.rst
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/src/haar.cpp
	modules/ocl/src/imgproc.cpp
	modules/ocl/src/kmeans.cpp
	modules/ocl/src/svm.cpp
	modules/ocl/test/test_objdetect.cpp
	samples/ocl/adaptive_bilateral_filter.cpp
  • Loading branch information
Roman Donchenko committed Nov 11, 2013
2 parents 469d7ee + 0ac6124 commit 4f1aed9
Show file tree
Hide file tree
Showing 59 changed files with 986 additions and 780 deletions.
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
*.autosave
*.pyc
.DS_Store
refman.rst
OpenCV4Tegra/
tegra/
*.user
.sw[a-z]
.*.swp
tags
.DS_Store
.sw[a-z]
/modules/refman.rst
Thumbs.db
*.autosave
tags
tegra/
4 changes: 2 additions & 2 deletions doc/tutorials/introduction/android_binary_package/O4A_SDK.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The structure of package contents looks as follows:
OpenCV-2.4.7-android-sdk
|_ apk
| |_ OpenCV_2.4.7_binary_pack_armv7a.apk
| |_ OpenCV_2.4.7_Manager_2.13_XXX.apk
| |_ OpenCV_2.4.7_Manager_2.14_XXX.apk
|
|_ doc
|_ samples
Expand Down Expand Up @@ -295,7 +295,7 @@ Well, running samples from Eclipse is very simple:
.. code-block:: sh
:linenos:
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.7_Manager_2.13_armv7a-neon.apk
<Android SDK path>/platform-tools/adb install <OpenCV4Android SDK path>/apk/OpenCV_2.4.7_Manager_2.14_armv7a-neon.apk
.. note:: ``armeabi``, ``armv7a-neon``, ``arm7a-neon-android8``, ``mips`` and ``x86`` stand for
platform targets:
Expand Down
27 changes: 5 additions & 22 deletions modules/contrib/src/detection_based_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,37 +180,20 @@ bool cv::DetectionBasedTracker::SeparateDetectionWork::run()
return true;
}

#ifdef __GNUC__
#define CATCH_ALL_AND_LOG(_block) \
do { \
#define CATCH_ALL_AND_LOG(_block) \
do { \
try { \
_block; \
break; \
} \
catch(cv::Exception& e) { \
LOGE0("\n %s: ERROR: OpenCV Exception caught: \n'%s'\n\n", __func__, e.what()); \
LOGE0("\n %s: ERROR: OpenCV Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
} catch(std::exception& e) { \
LOGE0("\n %s: ERROR: Exception caught: \n'%s'\n\n", __func__, e.what()); \
LOGE0("\n %s: ERROR: Exception caught: \n'%s'\n\n", CV_Func, e.what()); \
} catch(...) { \
LOGE0("\n %s: ERROR: UNKNOWN Exception caught\n\n", __func__); \
LOGE0("\n %s: ERROR: UNKNOWN Exception caught\n\n", CV_Func); \
} \
} while(0)
#else
#define CATCH_ALL_AND_LOG(_block) \
do { \
try { \
_block; \
break; \
} \
catch(cv::Exception& e) { \
LOGE0("\n ERROR: OpenCV Exception caught: \n'%s'\n\n", e.what()); \
} catch(std::exception& e) { \
LOGE0("\n ERROR: Exception caught: \n'%s'\n\n", e.what()); \
} catch(...) { \
LOGE0("\n ERROR: UNKNOWN Exception caught\n\n"); \
} \
} while(0)
#endif

void* cv::workcycleObjectDetectorFunction(void* p)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/opencv2/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CV_EXPORTS Exception : public std::exception

int code; ///< error code @see CVStatus
String err; ///< error description
String func; ///< function name. Available only when the compiler supports __func__ macro
String func; ///< function name. Available only when the compiler supports getting it
String file; ///< source file name where the error has occured
int line; ///< line number in the source file where the error has occured
};
Expand Down
16 changes: 9 additions & 7 deletions modules/core/include/opencv2/core/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,18 @@ enum {
*/
CV_EXPORTS void error(int _code, const String& _err, const char* _func, const char* _file, int _line);

#ifdef __GNUC__
# define CV_Error( code, msg ) cv::error( code, msg, __func__, __FILE__, __LINE__ )
# define CV_Error_( code, args ) cv::error( code, cv::format args, __func__, __FILE__, __LINE__ )
# define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, __func__, __FILE__, __LINE__ )
#if defined __GNUC__
#define CV_Func __func__
#elif defined _MSC_VER
#define CV_Func __FUNCTION__
#else
# define CV_Error( code, msg ) cv::error( code, msg, "", __FILE__, __LINE__ )
# define CV_Error_( code, args ) cv::error( code, cv::format args, "", __FILE__, __LINE__ )
# define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, "", __FILE__, __LINE__ )
#define CV_Func ""
#endif

#define CV_Error( code, msg ) cv::error( code, msg, CV_Func, __FILE__, __LINE__ )
#define CV_Error_( code, args ) cv::error( code, cv::format args, CV_Func, __FILE__, __LINE__ )
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )

#ifdef _DEBUG
# define CV_DbgAssert(expr) CV_Assert(expr)
#else
Expand Down
6 changes: 1 addition & 5 deletions modules/core/include/opencv2/core/cuda/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ namespace cv { namespace cuda {
}}

#ifndef cudaSafeCall
#if defined(__GNUC__)
#define cudaSafeCall(expr) cv::cuda::checkCudaError(expr, __FILE__, __LINE__, __func__)
#else /* defined(__CUDACC__) || defined(__MSVC__) */
#define cudaSafeCall(expr) cv::cuda::checkCudaError(expr, __FILE__, __LINE__, "")
#endif
#define cudaSafeCall(expr) cv::cuda::checkCudaError(expr, __FILE__, __LINE__, CV_Func)
#endif

namespace cv { namespace cuda
Expand Down
9 changes: 2 additions & 7 deletions modules/core/include/opencv2/core/private.cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,8 @@ namespace cv { namespace cuda
};
}}

#if defined(__GNUC__)
#define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, __func__)
#define cuSafeCall(expr) cv::cuda::checkCudaDriverApiError(expr, __FILE__, __LINE__, __func__)
#else /* defined(__CUDACC__) || defined(__MSVC__) */
#define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, "")
#define cuSafeCall(expr) cv::cuda::checkCudaDriverApiError(expr, __FILE__, __LINE__, "")
#endif
#define nppSafeCall(expr) cv::cuda::checkNppError(expr, __FILE__, __LINE__, CV_Func)
#define cuSafeCall(expr) cv::cuda::checkCudaDriverApiError(expr, __FILE__, __LINE__, CV_Func)

#endif // HAVE_CUDA

Expand Down
1 change: 1 addition & 0 deletions modules/core/src/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ void repeat(InputArray _src, int ny, int nx, OutputArray _dst)
{
Mat src = _src.getMat();
CV_Assert( src.dims <= 2 );
CV_Assert( ny > 0 && nx > 0 );

_dst.create(src.rows*ny, src.cols*nx, src.type());
Mat dst = _dst.getMat();
Expand Down
6 changes: 1 addition & 5 deletions modules/core/src/opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ namespace
#endif
}

#if defined(__GNUC__)
#define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__, __func__)) )
#else
#define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__)) )
#endif
#define CV_CheckGlError() CV_DbgAssert( (checkError(__FILE__, __LINE__, CV_Func)) )
} // namespace

#ifdef HAVE_OPENGL
Expand Down
7 changes: 1 addition & 6 deletions modules/core/src/persistence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,8 @@ cvCreateMap( int flags, int header_size, int elem_size,
return map;
}

#ifdef __GNUC__
#define CV_PARSE_ERROR( errmsg ) \
icvParseError( fs, __func__, (errmsg), __FILE__, __LINE__ )
#else
#define CV_PARSE_ERROR( errmsg ) \
icvParseError( fs, "", (errmsg), __FILE__, __LINE__ )
#endif
icvParseError( fs, CV_Func, (errmsg), __FILE__, __LINE__ )

static void
icvParseError( CvFileStorage* fs, const char* func_name,
Expand Down
12 changes: 2 additions & 10 deletions modules/cudaarithm/src/arithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ namespace
}
}

#if defined(__GNUC__)
#define cublasSafeCall(expr) ___cublasSafeCall(expr, __FILE__, __LINE__, __func__)
#else /* defined(__CUDACC__) || defined(__MSVC__) */
#define cublasSafeCall(expr) ___cublasSafeCall(expr, __FILE__, __LINE__, "")
#endif
#define cublasSafeCall(expr) ___cublasSafeCall(expr, __FILE__, __LINE__, CV_Func)
#endif // HAVE_CUBLAS

#ifdef HAVE_CUFFT
Expand Down Expand Up @@ -151,11 +147,7 @@ namespace
}
}

#if defined(__GNUC__)
#define cufftSafeCall(expr) ___cufftSafeCall(expr, __FILE__, __LINE__, __func__)
#else /* defined(__CUDACC__) || defined(__MSVC__) */
#define cufftSafeCall(expr) ___cufftSafeCall(expr, __FILE__, __LINE__, "")
#endif
#define cufftSafeCall(expr) ___cufftSafeCall(expr, __FILE__, __LINE__, CV_Func)

#endif

Expand Down
6 changes: 1 addition & 5 deletions modules/cudalegacy/include/opencv2/cudalegacy/private.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ namespace cv { namespace cuda
}
}}

#if defined(__GNUC__)
#define ncvSafeCall(expr) cv::cuda::checkNcvError(expr, __FILE__, __LINE__, __func__)
#else /* defined(__CUDACC__) || defined(__MSVC__) */
#define ncvSafeCall(expr) cv::cuda::checkNcvError(expr, __FILE__, __LINE__, "")
#endif
#define ncvSafeCall(expr) cv::cuda::checkNcvError(expr, __FILE__, __LINE__, CV_Func)

#endif // __OPENCV_CORE_CUDALEGACY_PRIVATE_HPP__
2 changes: 1 addition & 1 deletion modules/highgui/src/cap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ bool VideoCapture::retrieve(Mat& image, int channel)
return false;
}
if(_img->origin == IPL_ORIGIN_TL)
image = cv::cvarrToMat(_img);
cv::cvarrToMat(_img).copyTo(image);
else
{
Mat temp = cv::cvarrToMat(_img);
Expand Down
17 changes: 8 additions & 9 deletions modules/imgproc/doc/filtering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -416,24 +416,23 @@ adaptiveBilateralFilter
-----------------------
Applies the adaptive bilateral filter to an image.

.. ocv:function:: void adaptiveBilateralFilter( InputArray src, OutputArray dst, Size ksize, double sigmaSpace, Point anchor=Point(-1, -1), int borderType=BORDER_DEFAULT )
.. ocv:function:: void adaptiveBilateralFilter( InputArray src, OutputArray dst, Size ksize, double sigmaSpace, double maxSigmaColor = 20.0, Point anchor=Point(-1, -1), int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.adaptiveBilateralFilter(src, ksize, sigmaSpace[, dst[, anchor[, borderType]]]) -> dst
:param src: Source 8-bit, 1-channel or 3-channel image.

:param dst: Destination image of the same size and type as ``src`` .
:param src: The source image

:param ksize: filter kernel size.
:param dst: The destination image; will have the same size and the same type as src

:param sigmaSpace: Filter sigma in the coordinate space. It has similar meaning with ``sigmaSpace`` in ``bilateralFilter``.
:param ksize: The kernel size. This is the neighborhood where the local variance will be calculated, and where pixels will contribute (in a weighted manner).

:param anchor: anchor point; default value ``Point(-1,-1)`` means that the anchor is at the kernel center. Only default value is supported now.
:param sigmaSpace: Filter sigma in the coordinate space. Larger value of the parameter means that farther pixels will influence each other (as long as their colors are close enough; see sigmaColor). Then d>0, it specifies the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace.

:param borderType: border mode used to extrapolate pixels outside of the image.
:param maxSigmaColor: Maximum allowed sigma color (will clamp the value calculated in the ksize neighborhood. Larger value of the parameter means that more dissimilar pixels will influence each other (as long as their colors are close enough; see sigmaColor). Then d>0, it specifies the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace.

The function applies adaptive bilateral filtering to the input image. This filter is similar to ``bilateralFilter``, in that dissimilarity from and distance to the center pixel is punished. Instead of using ``sigmaColor``, we employ the variance of pixel values in the neighbourhood.
:param borderType: Pixel extrapolation method.

A main part of our strategy will be to load each raw pixel once, and reuse it to calculate all pixels in the output (filtered) image that need this pixel value. The math of the filter is that of the usual bilateral filter, except that the sigma color is calculated in the neighborhood, and clamped by the optional input value.


blur
Expand Down
2 changes: 1 addition & 1 deletion modules/imgproc/include/opencv2/imgproc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ CV_EXPORTS_W void bilateralFilter( InputArray src, OutputArray dst, int d,

//! smooths the image using adaptive bilateral filter
CV_EXPORTS_W void adaptiveBilateralFilter( InputArray src, OutputArray dst, Size ksize,
double sigmaSpace, Point anchor=Point(-1, -1),
double sigmaSpace, double maxSigmaColor = 20.0, Point anchor=Point(-1, -1),
int borderType=BORDER_DEFAULT );

//! smooths the image using the box filter. Each pixel is processed in O(1) time
Expand Down
Loading

0 comments on commit 4f1aed9

Please sign in to comment.