Commit 189c2b47 authored by Maksim Shabunin's avatar Maksim Shabunin

Fixed warnings for XCode 7.1.1 and cmake 3.3.2, rewrote one method in sliency to…

Fixed warnings for XCode 7.1.1 and cmake 3.3.2, rewrote one method in sliency to avoid clang 7.0.0 crash
parent 5e008c87
......@@ -100,6 +100,7 @@ if(MSVC)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456) # VS 2015
else()
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wno-deprecated -Wmissing-prototypes -Wmissing-declarations -Wshadow -Wunused-parameter -Wunused-local-typedefs -Wsign-compare -Wsign-promo -Wundef)
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wtautological-undefined-compare)
endif()
# Easier to support different versions of protobufs
......
cmake_minimum_required(VERSION 2.8)
if(IOS OR WINRT)
ocv_module_disable(dnn)
endif()
set(the_description "Deep neural network module. It allows to load models from different frameworks and to make forward pass")
set(OPENCV_MODULE_IS_PART_OF_WORLD OFF)
......@@ -58,4 +63,4 @@ if(${the_module}_BUILD_TORCH_TESTS)
COMMAND th ${CMAKE_CURRENT_SOURCE_DIR}/testdata/dnn/torch/torch_gen_test_data.lua
WORKING_DIRECTORY $ENV{OPENCV_TEST_DATA_PATH}/dnn/torch )
add_definitions(-DENABLE_TORCH_TESTS=1)
endif()
\ No newline at end of file
endif()
......@@ -94,11 +94,6 @@ class Model
// map: pFind[component][part] => part filter index
std::vector< std::vector<int> > pFind;
private:
// number of part filters and deformation model
int numPartFilters;
int numDefParams;
public:
Model () {}
virtual ~Model () {}
......
......@@ -280,7 +280,7 @@ private:
// For a W by H gradient magnitude map, find a W-7 by H-7 CV_32F matching score map
Mat matchTemplate( const Mat &mag1u );
float dot( const int64_t tig1, const int64_t tig2, const int64_t tig4, const int64_t tig8 );
float dot( int64_t tig1, int64_t tig2, int64_t tig4, int64_t tig8 );
void reconstruct( Mat &w );// For illustration purpose
private:
......
......@@ -47,24 +47,26 @@ namespace cv
namespace saliency
{
float ObjectnessBING::FilterTIG::dot( const int64_t tig1, const int64_t tig2, const int64_t tig4, const int64_t tig8 )
struct TIGbits
{
int64_t bcT1 = (int64_t) POPCNT64( tig1 );
int64_t bcT2 = (int64_t) POPCNT64( tig2 );
int64_t bcT4 = (int64_t) POPCNT64( tig4 );
int64_t bcT8 = (int64_t) POPCNT64( tig8 );
int64_t bc01 = (int64_t) ( POPCNT64(_bTIGs[0] & tig1) << 1 ) - bcT1;
int64_t bc02 = (int64_t) ( ( POPCNT64(_bTIGs[0] & tig2) << 1 ) - bcT2 ) << 1;
int64_t bc04 = (int64_t) ( ( POPCNT64(_bTIGs[0] & tig4) << 1 ) - bcT4 ) << 2;
int64_t bc08 = (int64_t) ( ( POPCNT64(_bTIGs[0] & tig8) << 1 ) - bcT8 ) << 3;
int64_t bc11 = (int64_t) ( POPCNT64(_bTIGs[1] & tig1) << 1 ) - bcT1;
int64_t bc12 = (int64_t) ( ( POPCNT64(_bTIGs[1] & tig2) << 1 ) - bcT2 ) << 1;
int64_t bc14 = (int64_t) ( ( POPCNT64(_bTIGs[1] & tig4) << 1 ) - bcT4 ) << 2;
int64_t bc18 = (int64_t) ( ( POPCNT64(_bTIGs[1] & tig8) << 1 ) - bcT8 ) << 3;
TIGbits() : bc0(0), bc1(0) {}
inline void accumulate(int64_t tig, int64_t tigMask0, int64_t tigMask1, uchar shift)
{
bc0 += ((POPCNT64(tigMask0 & tig) << 1) - POPCNT64(tig)) << shift;
bc1 += ((POPCNT64(tigMask1 & tig) << 1) - POPCNT64(tig)) << shift;
}
int64_t bc0;
int64_t bc1;
};
return _coeffs1[0] * ( bc01 + bc02 + bc04 + bc08 ) + _coeffs1[1] * ( bc11 + bc12 + bc14 + bc18 );
float ObjectnessBING::FilterTIG::dot( int64_t tig1, int64_t tig2, int64_t tig4, int64_t tig8 )
{
TIGbits x;
x.accumulate(tig1, _bTIGs[0], _bTIGs[1], 0);
x.accumulate(tig2, _bTIGs[0], _bTIGs[1], 1);
x.accumulate(tig4, _bTIGs[0], _bTIGs[1], 2);
x.accumulate(tig8, _bTIGs[0], _bTIGs[1], 3);
return _coeffs1[0] * x.bc0 + _coeffs1[1] * x.bc1;
}
void ObjectnessBING::FilterTIG::update( Mat &w1f )
......
......@@ -151,12 +151,12 @@ namespace cv
private:
int *left, *right;
short *c;
int v,kernelSize, width, height;
int v,kernelSize, width;
int MASK;
int *hammLut;
public :
hammingDistance(const Mat &leftImage, const Mat &rightImage, short *cost, int maxDisp, int kerSize, int *hammingLUT):
left((int *)leftImage.data), right((int *)rightImage.data), c(cost), v(maxDisp),kernelSize(kerSize),width(leftImage.cols), height(leftImage.rows), MASK(65535), hammLut(hammingLUT){}
left((int *)leftImage.data), right((int *)rightImage.data), c(cost), v(maxDisp),kernelSize(kerSize),width(leftImage.cols), MASK(65535), hammLut(hammingLUT){}
void operator()(const cv::Range &r) const {
for (int i = r.start; i <= r.end ; i++)
{
......@@ -617,4 +617,4 @@ namespace cv
}
#endif
#endif
/*End of file*/
\ No newline at end of file
/*End of file*/
set(the_description "Object detection algorithms")
ocv_define_module(xobjdetect opencv_core opencv_imgproc opencv_highgui opencv_objdetect WRAP python)
add_subdirectory(tools)
if (NOT IOS)
add_subdirectory(tools)
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment