Commit 0bd061f0 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #1413 from alalek:fix_build

parents e9cd99d9 27ced2cb
set(BUILD_opencv_cnn_3dobj_INIT OFF) # Must be disabled by default - requires custom build of Caffe.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Caffe) find_package(Caffe)
...@@ -8,7 +10,9 @@ else() ...@@ -8,7 +10,9 @@ else()
message(STATUS "Caffe: NO") message(STATUS "Caffe: NO")
endif() endif()
find_package(Protobuf) if(NOT BUILD_PROTOBUF)
find_package(Protobuf)
endif()
if(Protobuf_FOUND) if(Protobuf_FOUND)
message(STATUS "Protobuf: YES") message(STATUS "Protobuf: YES")
set(HAVE_PROTOBUF 1) set(HAVE_PROTOBUF 1)
......
# Protobuf package for CNN Triplet training
unset(Protobuf_FOUND)
find_library(Protobuf_LIBS NAMES protobuf
HINTS
/usr/local/lib)
if(Protobuf_LIBS)
set(Protobuf_FOUND 1)
endif()
...@@ -58,18 +58,10 @@ struct CallMetaData ...@@ -58,18 +58,10 @@ struct CallMetaData
} // namespaces } // namespaces
#ifdef __GNUC__
#define CVVISUAL_FUNCTION_NAME_MACRO __PRETTY_FUNCTION__
#else
#define CVVISUAL_FUNCTION_NAME_MACRO __func__
#endif
/** /**
* @brief Creates an instance of CallMetaData with the location of the macro as * @brief Creates an instance of CallMetaData with the location of the macro as
* value. * value.
*/ */
#define CVVISUAL_LOCATION \ #define CVVISUAL_LOCATION ::cvv::impl::CallMetaData(__FILE__, __LINE__, CV_Func)
::cvv::impl::CallMetaData(__FILE__, __LINE__, \
CVVISUAL_FUNCTION_NAME_MACRO)
#endif #endif
...@@ -67,14 +67,14 @@ void changedPixelImage(const cv::Mat& mat0, const cv::Mat& mat1, cv::Mat& out) ...@@ -67,14 +67,14 @@ void changedPixelImage(const cv::Mat& mat0, const cv::Mat& mat1, cv::Mat& out)
template<int Depth, int Channels> template<int Depth, int Channels>
void changedPixelImage(const cv::Mat& mat0, const cv::Mat& mat1, cv::Mat& out) void changedPixelImage(const cv::Mat& mat0, const cv::Mat& mat1, cv::Mat& out)
{ {
using PixelInType=const cvv::qtutil::PixelType<Depth,Channels>; using PixelInType=cvv::qtutil::PixelType<Depth,Channels>;
using PixelOutType=cvv::qtutil::DepthType<CV_8U>; using PixelOutType=cvv::qtutil::DepthType<CV_8U>;
cv::Mat result=cv::Mat::zeros(mat0.rows, mat0.cols,CV_8U); cv::Mat result=cv::Mat::zeros(mat0.rows, mat0.cols,CV_8U);
bool same; bool same;
PixelInType* in0; const PixelInType* in0;
PixelInType* in1; const PixelInType* in1;
for(int i=0;i<result.rows;i++) for(int i=0;i<result.rows;i++)
{ {
for(int j=0;j<result.cols;j++) for(int j=0;j<result.cols;j++)
......
...@@ -12,7 +12,7 @@ TEST(LocationTest, FileLineFunction) ...@@ -12,7 +12,7 @@ TEST(LocationTest, FileLineFunction)
auto locationMacroResult = CVVISUAL_LOCATION; auto locationMacroResult = CVVISUAL_LOCATION;
size_t line = __LINE__ - 1; size_t line = __LINE__ - 1;
auto file = __FILE__; auto file = __FILE__;
auto fun = CVVISUAL_FUNCTION_NAME_MACRO; auto fun = CV_Func;
EXPECT_EQ(locationMacroResult.isKnown, true); EXPECT_EQ(locationMacroResult.isKnown, true);
EXPECT_EQ(locationMacroResult.file, file); EXPECT_EQ(locationMacroResult.file, file);
EXPECT_EQ(locationMacroResult.line, line); EXPECT_EQ(locationMacroResult.line, line);
......
...@@ -79,7 +79,9 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER) ...@@ -79,7 +79,9 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER)
# NOTE: In case that proto files already exist, # NOTE: In case that proto files already exist,
# this is not needed anymore. # this is not needed anymore.
find_package(Protobuf QUIET) if(NOT BUILD_PROTOBUF)
find_package(Protobuf QUIET)
endif()
if(NOT ${Protobuf_FOUND}) if(NOT ${Protobuf_FOUND})
message(STATUS "Module opencv_dnn_modern disabled because Protobuf is not found") message(STATUS "Module opencv_dnn_modern disabled because Protobuf is not found")
......
...@@ -121,7 +121,7 @@ Mat loadPLYSimple(const char* fileName, int withNormals) ...@@ -121,7 +121,7 @@ Mat loadPLYSimple(const char* fileName, int withNormals)
{ {
float* data = cloud.ptr<float>(i); float* data = cloud.ptr<float>(i);
int col = 0; int col = 0;
for (; col < withNormals ? 6 : 3; ++col) for (; col < (withNormals ? 6 : 3); ++col)
{ {
ifs >> data[col]; ifs >> data[col];
} }
......
...@@ -83,7 +83,9 @@ private: ...@@ -83,7 +83,9 @@ private:
Rect2d vote(const std::vector<Point2f>& oldPoints,const std::vector<Point2f>& newPoints,const Rect2d& oldRect,Point2f& mD); Rect2d vote(const std::vector<Point2f>& oldPoints,const std::vector<Point2f>& newPoints,const Rect2d& oldRect,Point2f& mD);
float dist(Point2f p1,Point2f p2); float dist(Point2f p1,Point2f p2);
std::string type2str(int type); std::string type2str(int type);
#if 0
void computeStatistics(std::vector<float>& data,int size=-1); void computeStatistics(std::vector<float>& data,int size=-1);
#endif
void check_FB(const std::vector<Mat>& oldImagePyr,const std::vector<Mat>& newImagePyr, void check_FB(const std::vector<Mat>& oldImagePyr,const std::vector<Mat>& newImagePyr,
const std::vector<Point2f>& oldPoints,const std::vector<Point2f>& newPoints,std::vector<bool>& status); const std::vector<Point2f>& oldPoints,const std::vector<Point2f>& newPoints,std::vector<bool>& status);
void check_NCC(const Mat& oldImage,const Mat& newImage, void check_NCC(const Mat& oldImage,const Mat& newImage,
...@@ -337,6 +339,7 @@ Rect2d TrackerMedianFlowImpl::vote(const std::vector<Point2f>& oldPoints,const s ...@@ -337,6 +339,7 @@ Rect2d TrackerMedianFlowImpl::vote(const std::vector<Point2f>& oldPoints,const s
return newRect; return newRect;
} }
#if 0
void TrackerMedianFlowImpl::computeStatistics(std::vector<float>& data,int size){ void TrackerMedianFlowImpl::computeStatistics(std::vector<float>& data,int size){
int binnum=10; int binnum=10;
if(size==-1){ if(size==-1){
...@@ -351,6 +354,7 @@ void TrackerMedianFlowImpl::computeStatistics(std::vector<float>& data,int size) ...@@ -351,6 +354,7 @@ void TrackerMedianFlowImpl::computeStatistics(std::vector<float>& data,int size)
dprintf(("[%4f,%4f] -- %4d\n",mini+(maxi-mini)/binnum*i,mini+(maxi-mini)/binnum*(i+1),bins[i])); dprintf(("[%4f,%4f] -- %4d\n",mini+(maxi-mini)/binnum*i,mini+(maxi-mini)/binnum*(i+1),bins[i]));
} }
} }
#endif
void TrackerMedianFlowImpl::check_FB(const std::vector<Mat>& oldImagePyr, const std::vector<Mat>& newImagePyr, void TrackerMedianFlowImpl::check_FB(const std::vector<Mat>& oldImagePyr, const std::vector<Mat>& newImagePyr,
const std::vector<Point2f>& oldPoints, const std::vector<Point2f>& newPoints, std::vector<bool>& status){ const std::vector<Point2f>& oldPoints, const std::vector<Point2f>& newPoints, std::vector<bool>& status){
......
...@@ -93,8 +93,10 @@ inline int smoothedSum(const Mat& sum, const KeyPoint& pt, int y, int x, bool us ...@@ -93,8 +93,10 @@ inline int smoothedSum(const Mat& sum, const KeyPoint& pt, int y, int x, bool us
{ {
int rx = (int)(((float)x)*R(1,0) - ((float)y)*R(0,0)); int rx = (int)(((float)x)*R(1,0) - ((float)y)*R(0,0));
int ry = (int)(((float)x)*R(0,0) + ((float)y)*R(1,0)); int ry = (int)(((float)x)*R(0,0) + ((float)y)*R(1,0));
if (rx > 24) rx = 24; if (rx < -24) rx = -24; if (rx > 24) rx = 24;
if (ry > 24) ry = 24; if (ry < -24) ry = -24; if (rx < -24) rx = -24;
if (ry > 24) ry = 24;
if (ry < -24) ry = -24;
x = rx; y = ry; x = rx; y = ry;
} }
const int img_y = (int)(pt.pt.y + 0.5) + y; const int img_y = (int)(pt.pt.y + 0.5) + y;
......
...@@ -23,7 +23,6 @@ protected: ...@@ -23,7 +23,6 @@ protected:
std::vector<Mat> layers; std::vector<Mat> layers;
Octave(std::vector<Mat> layers); Octave(std::vector<Mat> layers);
virtual ~Octave(); virtual ~Octave();
std::vector<Mat> getLayers();
Mat getLayerAt(int i); Mat getLayerAt(int i);
}; };
...@@ -278,14 +277,6 @@ void Pyramid::Params::clear() ...@@ -278,14 +277,6 @@ void Pyramid::Params::clear()
*/ */
Pyramid::Octave::Octave(std::vector<Mat> _layers) : layers(_layers) {} Pyramid::Octave::Octave(std::vector<Mat> _layers) : layers(_layers) {}
/**
* Return layers of the Octave
*/
std::vector<Mat> Pyramid::Octave::getLayers()
{
return layers;
}
/** /**
* Return the Octave's layer at index i * Return the Octave's layer at index i
*/ */
......
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