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})
find_package(Caffe)
......@@ -8,7 +10,9 @@ else()
message(STATUS "Caffe: NO")
endif()
find_package(Protobuf)
if(NOT BUILD_PROTOBUF)
find_package(Protobuf)
endif()
if(Protobuf_FOUND)
message(STATUS "Protobuf: YES")
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
} // 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
* value.
*/
#define CVVISUAL_LOCATION \
::cvv::impl::CallMetaData(__FILE__, __LINE__, \
CVVISUAL_FUNCTION_NAME_MACRO)
#define CVVISUAL_LOCATION ::cvv::impl::CallMetaData(__FILE__, __LINE__, CV_Func)
#endif
......@@ -67,14 +67,14 @@ void changedPixelImage(const cv::Mat& mat0, const cv::Mat& mat1, cv::Mat& out)
template<int Depth, int Channels>
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>;
cv::Mat result=cv::Mat::zeros(mat0.rows, mat0.cols,CV_8U);
bool same;
PixelInType* in0;
PixelInType* in1;
const PixelInType* in0;
const PixelInType* in1;
for(int i=0;i<result.rows;i++)
{
for(int j=0;j<result.cols;j++)
......
......@@ -12,7 +12,7 @@ TEST(LocationTest, FileLineFunction)
auto locationMacroResult = CVVISUAL_LOCATION;
size_t line = __LINE__ - 1;
auto file = __FILE__;
auto fun = CVVISUAL_FUNCTION_NAME_MACRO;
auto fun = CV_Func;
EXPECT_EQ(locationMacroResult.isKnown, true);
EXPECT_EQ(locationMacroResult.file, file);
EXPECT_EQ(locationMacroResult.line, line);
......
......@@ -79,7 +79,9 @@ add_definitions(-DCNN_NO_SERIALIZATION -DCNN_USE_CAFFE_CONVERTER)
# NOTE: In case that proto files already exist,
# this is not needed anymore.
find_package(Protobuf QUIET)
if(NOT BUILD_PROTOBUF)
find_package(Protobuf QUIET)
endif()
if(NOT ${Protobuf_FOUND})
message(STATUS "Module opencv_dnn_modern disabled because Protobuf is not found")
......
......@@ -121,7 +121,7 @@ Mat loadPLYSimple(const char* fileName, int withNormals)
{
float* data = cloud.ptr<float>(i);
int col = 0;
for (; col < withNormals ? 6 : 3; ++col)
for (; col < (withNormals ? 6 : 3); ++col)
{
ifs >> data[col];
}
......
......@@ -83,7 +83,9 @@ private:
Rect2d vote(const std::vector<Point2f>& oldPoints,const std::vector<Point2f>& newPoints,const Rect2d& oldRect,Point2f& mD);
float dist(Point2f p1,Point2f p2);
std::string type2str(int type);
#if 0
void computeStatistics(std::vector<float>& data,int size=-1);
#endif
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);
void check_NCC(const Mat& oldImage,const Mat& newImage,
......@@ -337,6 +339,7 @@ Rect2d TrackerMedianFlowImpl::vote(const std::vector<Point2f>& oldPoints,const s
return newRect;
}
#if 0
void TrackerMedianFlowImpl::computeStatistics(std::vector<float>& data,int size){
int binnum=10;
if(size==-1){
......@@ -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]));
}
}
#endif
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){
......
......@@ -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 ry = (int)(((float)x)*R(0,0) + ((float)y)*R(1,0));
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 (rx < -24) rx = -24;
if (ry > 24) ry = 24;
if (ry < -24) ry = -24;
x = rx; y = ry;
}
const int img_y = (int)(pt.pt.y + 0.5) + y;
......
......@@ -23,7 +23,6 @@ protected:
std::vector<Mat> layers;
Octave(std::vector<Mat> layers);
virtual ~Octave();
std::vector<Mat> getLayers();
Mat getLayerAt(int i);
};
......@@ -278,14 +277,6 @@ void Pyramid::Params::clear()
*/
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
*/
......
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