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:
	cmake/OpenCVDetectCUDA.cmake
	doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.rst
	modules/core/CMakeLists.txt
	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
	modules/highgui/src/grfmt_tiff.cpp
	modules/imgproc/src/clahe.cpp
	modules/imgproc/src/moments.cpp
	modules/nonfree/CMakeLists.txt
	modules/ocl/perf/perf_ml.cpp
	modules/superres/CMakeLists.txt
  • Loading branch information
Roman Donchenko committed Feb 25, 2014
2 parents 0a90d6d + 2b0c3eb commit 4843250
Show file tree
Hide file tree
Showing 32 changed files with 208 additions and 89 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ OCV_OPTION(INSTALL_TESTS "Install accuracy and performance test binar
OCV_OPTION(ENABLE_PRECOMPILED_HEADERS "Use precompiled headers" ON IF (NOT IOS) )
OCV_OPTION(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" (MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) )
OCV_OPTION(ENABLE_PROFILING "Enable profiling in the GCC compiler (Add flags: -g -pg)" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_COVERAGE "Enable coverage collection with GCov" OFF IF CMAKE_COMPILER_IS_GNUCXX )
OCV_OPTION(ENABLE_OMIT_FRAME_POINTER "Enable -fomit-frame-pointer for GCC" ON IF CMAKE_COMPILER_IS_GNUCXX AND NOT (APPLE AND CMAKE_COMPILER_IS_CLANGCXX) )
OCV_OPTION(ENABLE_POWERPC "Enable PowerPC for GCC" ON IF (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES powerpc.*) )
OCV_OPTION(ENABLE_FAST_MATH "Enable -ffast-math (not recommended for GCC 4.6.x)" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) )
Expand Down Expand Up @@ -418,8 +419,15 @@ include(cmake/OpenCVModule.cmake)
# ----------------------------------------------------------------------------
# Detect endianness of build platform
# ----------------------------------------------------------------------------
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

if(CMAKE_SYSTEM_NAME STREQUAL iOS)
# test_big_endian needs try_compile, which doesn't work for iOS
# http://public.kitware.com/Bug/view.php?id=12288
set(WORDS_BIGENDIAN 0)
else()
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
endif()

# ----------------------------------------------------------------------------
# Detect 3rd-party libraries
Expand Down
5 changes: 5 additions & 0 deletions cmake/OpenCVCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
add_extra_compiler_option(-ffunction-sections)
endif()

if(ENABLE_COVERAGE)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} --coverage")
set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} --coverage")
endif()

set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
endif()
Expand Down
5 changes: 2 additions & 3 deletions cmake/OpenCVDetectCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ if(CUDA_FOUND)
# we remove -Wsign-promo as it generates warnings under linux
string(REPLACE "-Wsign-promo" "" ${var} "${${var}}")

# we remove -fvisibility-inlines-hidden because it's used for C++ compiler
# but NVCC uses C compiler by default
string(REPLACE "-fvisibility-inlines-hidden" "" ${var} "${${var}}")
# we remove -Wno-sign-promo as it generates warnings under linux
string(REPLACE "-Wno-sign-promo" "" ${var} "${${var}}")

# we remove -Wno-delete-non-virtual-dtor because it's used for C++ compiler
# but NVCC uses C compiler by default
Expand Down
39 changes: 33 additions & 6 deletions cmake/OpenCVFindIPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,16 @@ function(set_ipp_new_libraries _LATEST_VERSION)
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCV}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPI}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPS}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX}
PARENT_SCOPE)

${IPP_LIB_PREFIX}${IPP_PREFIX}${IPPCORE}${IPP_SUFFIX}${IPP_LIB_SUFFIX})

if (UNIX)
set(IPP_LIBRARIES
${IPP_LIBRARIES}
${IPP_LIB_PREFIX}irc${CMAKE_SHARED_LIBRARY_SUFFIX}
${IPP_LIB_PREFIX}imf${CMAKE_SHARED_LIBRARY_SUFFIX}
${IPP_LIB_PREFIX}svml${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
return()

endfunction()
Expand Down Expand Up @@ -208,18 +215,38 @@ function(set_ipp_variables _LATEST_VERSION)
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)

if (APPLE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib)
elseif (IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/intel64)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64 PARENT_SCOPE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/intel64)
else()
if(NOT EXISTS ${IPP_ROOT_DIR}/lib/ia32)
message(SEND_ERROR "IPP IA32 libraries not found")
endif()
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32 PARENT_SCOPE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib/ia32)
endif()

if (UNIX)
get_filename_component(INTEL_COMPILER_LIBRARY_DIR ${IPP_ROOT_DIR}/../lib REALPATH)
if (IPP_X64)
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/intel64)
message(SEND_ERROR "Intel compiler EM64T libraries not found")
endif()
set(IPP_LIBRARY_DIRS
${IPP_LIBRARY_DIRS}
${INTEL_COMPILER_LIBRARY_DIR}/intel64)
else()
if(NOT EXISTS ${INTEL_COMPILER_LIBRARY_DIR}/ia32)
message(SEND_ERROR "Intel compiler IA32 libraries not found")
endif()
set(IPP_LIBRARY_DIRS
${IPP_LIBRARY_DIRS}
${INTEL_COMPILER_LIBRARY_DIR}/ia32)
endif()
endif()
set(IPP_LIBRARY_DIRS ${IPP_LIBRARY_DIRS} PARENT_SCOPE)

# set IPP_LIBRARIES variable (7.x or 8.x lib names)
set_ipp_new_libraries(${_LATEST_VERSION})
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

# General information about the project.
project = u'OpenCV'
copyright = u'2011-2013, opencv dev team'
copyright = u'2011-2014, opencv dev team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ d. **method=CV\_TM\_CCORR\_NORMED**

.. math::
R(x,y)= \frac{\sum_{x',y'} (T(x',y') \cdot I'(x+x',y+y'))}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}}
R(x,y)= \frac{\sum_{x',y'} (T(x',y') \cdot I(x+x',y+y'))}{\sqrt{\sum_{x',y'}T(x',y')^2 \cdot \sum_{x',y'} I(x+x',y+y')^2}}
e. **method=CV\_TM\_CCOEFF**
Expand Down
51 changes: 28 additions & 23 deletions doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,34 @@ Let's use a simple program such as DisplayImage.cpp shown below.

.. code-block:: cpp
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main( int argc, char** argv )
{
Mat image;
image = imread( argv[1], 1 );
if( argc != 2 || !image.data )
{
printf( "No image data \n" );
return -1;
}
namedWindow( "Display Image", WINDOW_AUTOSIZE );
imshow( "Display Image", image );
waitKey(0);
return 0;
}
#include <stdio.h>
#include <opencv2/opencv.hpp>
using namespace cv;
int main(int argc, char** argv )
{
if ( argc != 2 )
{
printf("usage: DisplayImage.out <Image_Path>\n");
return -1;
}
Mat image;
image = imread( argv[1], 1 );
if ( !image.data )
{
printf("No image data \n");
return -1;
}
namedWindow("Display Image", WINDOW_AUTOSIZE );
imshow("Display Image", image);
waitKey(0);
return 0;
}
Create a CMake file
---------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Explanation
imshow( imageName, image );
imshow( "Gray image", gray_image );
#. Add add the *waitKey(0)* function call for the program to wait forever for an user key press.
#. Add the *waitKey(0)* function call for the program to wait forever for an user key press.


Result
Expand Down
2 changes: 1 addition & 1 deletion modules/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if(HAVE_WINRT)
endif()

if(HAVE_CUDA)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wenum-compare -Wunused-function)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wenum-compare -Wunused-function -Wshadow)
endif()

file(GLOB lib_cuda_hdrs "include/opencv2/${name}/cuda/*.hpp" "include/opencv2/${name}/cuda/*.h")
Expand Down
2 changes: 1 addition & 1 deletion modules/core/doc/basic_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@ The method copies the matrix data to another matrix. Before copying the data, th

so that the destination matrix is reallocated if needed. While ``m.copyTo(m);`` works flawlessly, the function does not handle the case of a partial overlap between the source and the destination matrices.

When the operation mask is specified, and the ``Mat::create`` call shown above reallocated the matrix, the newly allocated matrix is initialized with all zeros before copying the data.
When the operation mask is specified, if the ``Mat::create`` call shown above reallocates the matrix, the newly allocated matrix is initialized with all zeros before copying the data.

.. _Mat::convertTo:

Expand Down
8 changes: 4 additions & 4 deletions modules/core/perf/opencl/perf_bufferpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatCreation100, Bool())
}
}

SANITY_CHECK_NOTHING()
SANITY_CHECK_NOTHING();
}

OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatCountNonZero100, Bool())
Expand All @@ -79,7 +79,7 @@ OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatCountNonZero100, Bool())
}
}

SANITY_CHECK_NOTHING()
SANITY_CHECK_NOTHING();
}

OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatCanny10, Bool())
Expand All @@ -104,7 +104,7 @@ OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatCanny10, Bool())
}
}

SANITY_CHECK_NOTHING()
SANITY_CHECK_NOTHING();
}

OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatIntegral10, Bool())
Expand All @@ -124,7 +124,7 @@ OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatIntegral10, Bool())
}
}

SANITY_CHECK_NOTHING()
SANITY_CHECK_NOTHING();
}

} } // namespace cvtest::ocl
Expand Down
2 changes: 1 addition & 1 deletion modules/core/perf/opencl/perf_usage_flags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ OCL_PERF_TEST_P(UsageFlagsBoolFixture, UsageFlags_AllocHostMem, ::testing::Combi
cv::subtract(dst, Scalar::all(1), final);
}

SANITY_CHECK_NOTHING()
SANITY_CHECK_NOTHING();
}

} } // namespace cvtest::ocl
Expand Down
4 changes: 4 additions & 0 deletions modules/cudaimgproc/src/cuda/canny.cu
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,12 @@ namespace canny
n += smem[threadIdx.y + 2][threadIdx.x + 2] == 2;
}

__syncthreads();

if (n > 0)
smem[threadIdx.y + 1][threadIdx.x + 1] = 2;

__syncthreads();
}

const int e = smem[threadIdx.y + 1][threadIdx.x + 1];
Expand Down
19 changes: 14 additions & 5 deletions modules/highgui/src/cap_ios_abstract_camera.mm
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,20 @@ - (void)createVideoPreviewLayer;
{
self.captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];

if ([self.captureVideoPreviewLayer isOrientationSupported]) {
[self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation];
if ([self.captureVideoPreviewLayer respondsToSelector:@selector(connection)])
{
if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported])
{
[self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation];
}
}
else
{
// Deprecated in 6.0; here for backward compatibility
if ([self.captureVideoPreviewLayer isOrientationSupported])
{
[self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation];
}
}

if (parentView != nil) {
Expand All @@ -290,9 +302,6 @@ - (void)createVideoPreviewLayer;
NSLog(@"[Camera] created AVCaptureVideoPreviewLayer");
}




- (void)setDesiredCameraPosition:(AVCaptureDevicePosition)desiredPosition;
{
for (AVCaptureDevice *device in [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]) {
Expand Down
26 changes: 15 additions & 11 deletions modules/highgui/src/grfmt_tiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,15 @@ bool TiffDecoder::readData( Mat& img )
{
case 8:
{
uchar * bstart = buffer;
if( !is_tiled )
ok = TIFFReadRGBAStrip( tif, y, (uint32*)buffer );
else
{
ok = TIFFReadRGBATile( tif, x, y, (uint32*)buffer );

//Tiles fill the buffer from the bottom up
bstart += (tile_height0 - tile_height) * tile_width0 * 4;
}
if( !ok )
{
close();
Expand All @@ -275,19 +279,19 @@ bool TiffDecoder::readData( Mat& img )
{
if (wanted_channels == 4)
{
icvCvt_BGRA2RGBA_8u_C4R( buffer + i*tile_width*4, 0,
icvCvt_BGRA2RGBA_8u_C4R( bstart + i*tile_width0*4, 0,
data + x*4 + img.step*(tile_height - i - 1), 0,
cvSize(tile_width,1) );
}
else
{
icvCvt_BGRA2BGR_8u_C4C3R( buffer + i*tile_width*4, 0,
icvCvt_BGRA2BGR_8u_C4C3R( bstart + i*tile_width0*4, 0,
data + x*3 + img.step*(tile_height - i - 1), 0,
cvSize(tile_width,1), 2 );
}
}
else
icvCvt_BGRA2Gray_8u_C4C1R( buffer + i*tile_width*4, 0,
icvCvt_BGRA2Gray_8u_C4C1R( bstart + i*tile_width0*4, 0,
data + x + img.step*(tile_height - i - 1), 0,
cvSize(tile_width,1), 2 );
break;
Expand All @@ -312,19 +316,19 @@ bool TiffDecoder::readData( Mat& img )
{
if( ncn == 1 )
{
icvCvt_Gray2BGR_16u_C1C3R(buffer16 + i*tile_width*ncn, 0,
icvCvt_Gray2BGR_16u_C1C3R(buffer16 + i*tile_width0*ncn, 0,
(ushort*)(data + img.step*i) + x*3, 0,
cvSize(tile_width,1) );
}
else if( ncn == 3 )
{
icvCvt_RGB2BGR_16u_C3R(buffer16 + i*tile_width*ncn, 0,
icvCvt_RGB2BGR_16u_C3R(buffer16 + i*tile_width0*ncn, 0,
(ushort*)(data + img.step*i) + x*3, 0,
cvSize(tile_width,1) );
}
else
{
icvCvt_BGRA2BGR_16u_C4C3R(buffer16 + i*tile_width*ncn, 0,
icvCvt_BGRA2BGR_16u_C4C3R(buffer16 + i*tile_width0*ncn, 0,
(ushort*)(data + img.step*i) + x*3, 0,
cvSize(tile_width,1), 2 );
}
Expand All @@ -334,12 +338,12 @@ bool TiffDecoder::readData( Mat& img )
if( ncn == 1 )
{
memcpy((ushort*)(data + img.step*i)+x,
buffer16 + i*tile_width*ncn,
buffer16 + i*tile_width0*ncn,
tile_width*sizeof(buffer16[0]));
}
else
{
icvCvt_BGRA2Gray_16u_CnC1R(buffer16 + i*tile_width*ncn, 0,
icvCvt_BGRA2Gray_16u_CnC1R(buffer16 + i*tile_width0*ncn, 0,
(ushort*)(data + img.step*i) + x, 0,
cvSize(tile_width,1), ncn, 2 );
}
Expand Down Expand Up @@ -367,13 +371,13 @@ bool TiffDecoder::readData( Mat& img )
if(dst_bpp == 32)
{
memcpy((float*)(data + img.step*i)+x,
buffer32 + i*tile_width*ncn,
buffer32 + i*tile_width0*ncn,
tile_width*sizeof(buffer32[0]));
}
else
{
memcpy((double*)(data + img.step*i)+x,
buffer64 + i*tile_width*ncn,
buffer64 + i*tile_width0*ncn,
tile_width*sizeof(buffer64[0]));
}
}
Expand Down
Loading

0 comments on commit 4843250

Please sign in to comment.