Merge pull request #434 from mshabunin:ios-framework

pull/452/head
Maksim Shabunin 9 years ago
commit c3f432be9c
  1. 1
      modules/dnn/3rdparty/protobuf/CMakeLists.txt
  2. 5
      modules/dnn/CMakeLists.txt
  3. 5
      modules/dpm/src/dpm_model.hpp
  4. 2
      modules/saliency/include/opencv2/saliency/saliencySpecializedClasses.hpp
  5. 34
      modules/saliency/src/BING/FilterTIG.cpp
  6. 4
      modules/stereo/src/matching.hpp
  7. 2
      modules/xobjdetect/CMakeLists.txt

@ -100,6 +100,7 @@ if(MSVC)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456) # VS 2015 ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4456) # VS 2015
else() 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 -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() endif()
# Easier to support different versions of protobufs # Easier to support different versions of protobufs

@ -1,4 +1,9 @@
cmake_minimum_required(VERSION 2.8) 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(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) set(OPENCV_MODULE_IS_PART_OF_WORLD OFF)

@ -94,11 +94,6 @@ class Model
// map: pFind[component][part] => part filter index // map: pFind[component][part] => part filter index
std::vector< std::vector<int> > pFind; std::vector< std::vector<int> > pFind;
private:
// number of part filters and deformation model
int numPartFilters;
int numDefParams;
public: public:
Model () {} Model () {}
virtual ~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 // 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 ); 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 void reconstruct( Mat &w );// For illustration purpose
private: private:

@ -47,24 +47,26 @@ namespace cv
namespace saliency 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 ); TIGbits() : bc0(0), bc1(0) {}
int64_t bcT2 = (int64_t) POPCNT64( tig2 ); inline void accumulate(int64_t tig, int64_t tigMask0, int64_t tigMask1, uchar shift)
int64_t bcT4 = (int64_t) POPCNT64( tig4 ); {
int64_t bcT8 = (int64_t) POPCNT64( tig8 ); bc0 += ((POPCNT64(tigMask0 & tig) << 1) - POPCNT64(tig)) << shift;
bc1 += ((POPCNT64(tigMask1 & tig) << 1) - POPCNT64(tig)) << shift;
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 bc0;
int64_t bc04 = (int64_t) ( ( POPCNT64(_bTIGs[0] & tig4) << 1 ) - bcT4 ) << 2; int64_t bc1;
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;
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 ) void ObjectnessBING::FilterTIG::update( Mat &w1f )

@ -151,12 +151,12 @@ namespace cv
private: private:
int *left, *right; int *left, *right;
short *c; short *c;
int v,kernelSize, width, height; int v,kernelSize, width;
int MASK; int MASK;
int *hammLut; int *hammLut;
public : public :
hammingDistance(const Mat &leftImage, const Mat &rightImage, short *cost, int maxDisp, int kerSize, int *hammingLUT): 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 { void operator()(const cv::Range &r) const {
for (int i = r.start; i <= r.end ; i++) for (int i = r.start; i <= r.end ; i++)
{ {

@ -1,3 +1,5 @@
set(the_description "Object detection algorithms") set(the_description "Object detection algorithms")
ocv_define_module(xobjdetect opencv_core opencv_imgproc opencv_highgui opencv_objdetect WRAP python) ocv_define_module(xobjdetect opencv_core opencv_imgproc opencv_highgui opencv_objdetect WRAP python)
if (NOT IOS)
add_subdirectory(tools) add_subdirectory(tools)
endif()

Loading…
Cancel
Save