Commit 6df203c4 authored by Alexander Shishkov's avatar Alexander Shishkov

Fixes for Linux compilation, small changes

parent c51b50b4
...@@ -59,8 +59,6 @@ enum ...@@ -59,8 +59,6 @@ enum
INPAINT_TELEA = 1 // A. Telea algorithm INPAINT_TELEA = 1 // A. Telea algorithm
}; };
CV_EXPORTS_W bool initModule_photo();
//! restores the damaged image areas using one of the available intpainting algorithms //! restores the damaged image areas using one of the available intpainting algorithms
CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask,
OutputArray dst, double inpaintRadius, int flags ); OutputArray dst, double inpaintRadius, int flags );
...@@ -91,11 +89,7 @@ public: ...@@ -91,11 +89,7 @@ public:
CV_WRAP virtual void setGamma(float gamma) = 0; CV_WRAP virtual void setGamma(float gamma) = 0;
}; };
class CV_EXPORTS_W TonemapLinear : public Tonemap CV_EXPORTS_W Ptr<Tonemap> createTonemapLinear(float gamma = 1.0f);
{
};
CV_EXPORTS_W Ptr<TonemapLinear> createTonemapLinear(float gamma = 1.0f);
// "Adaptive Logarithmic Mapping For Displaying HighContrast Scenes", Drago et al., 2003 // "Adaptive Logarithmic Mapping For Displaying HighContrast Scenes", Drago et al., 2003
...@@ -154,10 +148,10 @@ public: ...@@ -154,10 +148,10 @@ public:
class CV_EXPORTS_W AlignMTB : public ExposureAlign class CV_EXPORTS_W AlignMTB : public ExposureAlign
{ {
public: public:
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArrayOfArrays dst, CV_WRAP virtual void process(InputArrayOfArrays src, OutputArrayOfArrays dst,
const std::vector<float>& times, InputArray response) = 0; const std::vector<float>& times, InputArray response) = 0;
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArrayOfArrays dst) = 0; CV_WRAP virtual void process(InputArrayOfArrays src, OutputArrayOfArrays dst) = 0;
CV_WRAP virtual void calculateShift(InputArray img0, InputArray img1, Point& shift) = 0; CV_WRAP virtual void calculateShift(InputArray img0, InputArray img1, Point& shift) = 0;
CV_WRAP virtual void shiftMat(InputArray src, OutputArray dst, const Point shift) = 0; CV_WRAP virtual void shiftMat(InputArray src, OutputArray dst, const Point shift) = 0;
...@@ -197,7 +191,7 @@ class CV_EXPORTS_W ExposureMerge : public Algorithm ...@@ -197,7 +191,7 @@ class CV_EXPORTS_W ExposureMerge : public Algorithm
{ {
public: public:
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
const std::vector<float>& times, InputArray response) = 0; const std::vector<float>& times, InputArray response) = 0;
}; };
// "Recovering High Dynamic Range Radiance Maps from Photographs", Debevec, Malik, 1997 // "Recovering High Dynamic Range Radiance Maps from Photographs", Debevec, Malik, 1997
...@@ -205,8 +199,8 @@ public: ...@@ -205,8 +199,8 @@ public:
class CV_EXPORTS_W MergeDebevec : public ExposureMerge class CV_EXPORTS_W MergeDebevec : public ExposureMerge
{ {
public: public:
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
const std::vector<float>& times, InputArray response) = 0; const std::vector<float>& times, InputArray response) = 0;
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, const std::vector<float>& times) = 0; CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, const std::vector<float>& times) = 0;
}; };
...@@ -217,8 +211,8 @@ CV_EXPORTS_W Ptr<MergeDebevec> createMergeDebevec(); ...@@ -217,8 +211,8 @@ CV_EXPORTS_W Ptr<MergeDebevec> createMergeDebevec();
class CV_EXPORTS_W MergeMertens : public ExposureMerge class CV_EXPORTS_W MergeMertens : public ExposureMerge
{ {
public: public:
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst,
const std::vector<float>& times, InputArray response) = 0; const std::vector<float>& times, InputArray response) = 0;
CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst) = 0; CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst) = 0;
CV_WRAP virtual float getContrastWeight() const = 0; CV_WRAP virtual float getContrastWeight() const = 0;
......
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
// License Agreement // License Agreement
// For Open Source Computer Vision Library // For Open Source Computer Vision Library
// //
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners. // Third party copyrights are property of their respective owners.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
...@@ -232,4 +231,4 @@ CV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits, int exclude_range) ...@@ -232,4 +231,4 @@ CV_EXPORTS_W Ptr<AlignMTB> createAlignMTB(int max_bits, int exclude_range)
return new AlignMTBImpl(max_bits, exclude_range); return new AlignMTBImpl(max_bits, exclude_range);
} }
} }
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
// License Agreement // License Agreement
// For Open Source Computer Vision Library // For Open Source Computer Vision Library
// //
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners. // Third party copyrights are property of their respective owners.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
...@@ -71,4 +70,4 @@ Mat tringleWeights() ...@@ -71,4 +70,4 @@ Mat tringleWeights()
return w; return w;
} }
}; };
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
// License Agreement // License Agreement
// For Open Source Computer Vision Library // For Open Source Computer Vision Library
// //
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners. // Third party copyrights are property of their respective owners.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
...@@ -55,4 +54,4 @@ Mat tringleWeights(); ...@@ -55,4 +54,4 @@ Mat tringleWeights();
}; };
#endif #endif
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
// License Agreement // License Agreement
// For Open Source Computer Vision Library // For Open Source Computer Vision Library
// //
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners. // Third party copyrights are property of their respective owners.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
...@@ -260,4 +259,4 @@ Ptr<MergeMertens> createMergeMertens(float wcon, float wsat, float wexp) ...@@ -260,4 +259,4 @@ Ptr<MergeMertens> createMergeMertens(float wcon, float wsat, float wexp)
return new MergeMertensImpl(wcon, wsat, wexp); return new MergeMertensImpl(wcon, wsat, wexp);
} }
} }
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
// License Agreement // License Agreement
// For Open Source Computer Vision Library // For Open Source Computer Vision Library
// //
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners. // Third party copyrights are property of their respective owners.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
namespace cv namespace cv
{ {
class TonemapLinearImpl : public TonemapLinear class TonemapLinearImpl : public Tonemap
{ {
public: public:
TonemapLinearImpl(float gamma) : gamma(gamma), name("TonemapLinear") TonemapLinearImpl(float gamma) : gamma(gamma), name("TonemapLinear")
...@@ -93,7 +92,7 @@ protected: ...@@ -93,7 +92,7 @@ protected:
float gamma; float gamma;
}; };
Ptr<TonemapLinear> createTonemapLinear(float gamma) Ptr<Tonemap> createTonemapLinear(float gamma)
{ {
return new TonemapLinearImpl(gamma); return new TonemapLinearImpl(gamma);
} }
...@@ -115,7 +114,7 @@ public: ...@@ -115,7 +114,7 @@ public:
_dst.create(src.size(), CV_32FC3); _dst.create(src.size(), CV_32FC3);
Mat img = _dst.getMat(); Mat img = _dst.getMat();
Ptr<TonemapLinear> linear = createTonemapLinear(1.0f); Ptr<Tonemap> linear = createTonemapLinear(1.0f);
linear->process(src, img); linear->process(src, img);
Mat gray_img; Mat gray_img;
...@@ -286,7 +285,7 @@ public: ...@@ -286,7 +285,7 @@ public:
_dst.create(src.size(), CV_32FC3); _dst.create(src.size(), CV_32FC3);
Mat img = _dst.getMat(); Mat img = _dst.getMat();
Ptr<TonemapLinear> linear = createTonemapLinear(1.0f); Ptr<Tonemap> linear = createTonemapLinear(1.0f);
linear->process(src, img); linear->process(src, img);
Mat gray_img; Mat gray_img;
...@@ -363,4 +362,4 @@ Ptr<TonemapReinhardDevlin> createTonemapReinhardDevlin(float gamma, float contra ...@@ -363,4 +362,4 @@ Ptr<TonemapReinhardDevlin> createTonemapReinhardDevlin(float gamma, float contra
return new TonemapReinhardDevlinImpl(gamma, contrast, sigma_color, sigma_space); return new TonemapReinhardDevlinImpl(gamma, contrast, sigma_color, sigma_space);
} }
} }
\ No newline at end of file
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
// License Agreement // License Agreement
// For Open Source Computer Vision Library // For Open Source Computer Vision Library
// //
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. // Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Third party copyrights are property of their respective owners. // Third party copyrights are property of their respective owners.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
...@@ -61,9 +60,10 @@ void checkEqual(Mat img0, Mat img1, double threshold) ...@@ -61,9 +60,10 @@ void checkEqual(Mat img0, Mat img1, double threshold)
ASSERT_FALSE(max > threshold) << max; ASSERT_FALSE(max > threshold) << max;
} }
void loadExposureSeq(String path, vector<Mat>& images, vector<float>& times = vector<float>()) static vector<float> DEFAULT_VECTOR;
void loadExposureSeq(String path, vector<Mat>& images, vector<float>& times = DEFAULT_VECTOR)
{ {
ifstream list_file(path + "list.txt"); ifstream list_file((path + "list.txt").c_str());
ASSERT_TRUE(list_file.is_open()); ASSERT_TRUE(list_file.is_open());
string name; string name;
float val; float val;
...@@ -79,7 +79,7 @@ void loadExposureSeq(String path, vector<Mat>& images, vector<float>& times = ve ...@@ -79,7 +79,7 @@ void loadExposureSeq(String path, vector<Mat>& images, vector<float>& times = ve
void loadResponseCSV(String path, Mat& response) void loadResponseCSV(String path, Mat& response)
{ {
response = Mat(256, 3, CV_32F); response = Mat(256, 3, CV_32F);
ifstream resp_file(path); ifstream resp_file(path.c_str());
for(int i = 0; i < 256; i++) { for(int i = 0; i < 256; i++) {
for(int channel = 0; channel < 3; channel++) { for(int channel = 0; channel < 3; channel++) {
resp_file >> response.at<float>(i, channel); resp_file >> response.at<float>(i, channel);
...@@ -98,7 +98,7 @@ TEST(Photo_Tonemap, regression) ...@@ -98,7 +98,7 @@ TEST(Photo_Tonemap, regression)
float gamma = 2.2f; float gamma = 2.2f;
test_path += "tonemap/"; test_path += "tonemap/";
Ptr<TonemapLinear> linear = createTonemapLinear(gamma); Ptr<Tonemap> linear = createTonemapLinear(gamma);
linear->process(img, result); linear->process(img, result);
loadImage(test_path + "linear.png", expected); loadImage(test_path + "linear.png", expected);
result.convertTo(result, CV_8UC3, 255); result.convertTo(result, CV_8UC3, 255);
...@@ -156,7 +156,7 @@ TEST(Photo_MergeMertens, regression) ...@@ -156,7 +156,7 @@ TEST(Photo_MergeMertens, regression)
string test_path = string(cvtest::TS::ptr()->get_data_path()) + "hdr/"; string test_path = string(cvtest::TS::ptr()->get_data_path()) + "hdr/";
vector<Mat> images; vector<Mat> images;
loadExposureSeq(test_path + "exposures/", images); loadExposureSeq((test_path + "exposures/").c_str() , images);
Ptr<MergeMertens> merge = createMergeMertens(); Ptr<MergeMertens> merge = createMergeMertens();
......
...@@ -131,6 +131,15 @@ typedef Ptr<StereoMatcher> Ptr_StereoMatcher; ...@@ -131,6 +131,15 @@ typedef Ptr<StereoMatcher> Ptr_StereoMatcher;
typedef Ptr<StereoBM> Ptr_StereoBM; typedef Ptr<StereoBM> Ptr_StereoBM;
typedef Ptr<StereoSGBM> Ptr_StereoSGBM; typedef Ptr<StereoSGBM> Ptr_StereoSGBM;
typedef Ptr<Tonemap> Ptr_Tonemap;
typedef Ptr<TonemapDrago> Ptr_TonemapDrago;
typedef Ptr<TonemapReinhardDevlin> Ptr_TonemapReinhardDevlin;
typedef Ptr<TonemapDurand> Ptr_TonemapDurand;
typedef Ptr<AlignMTB> Ptr_AlignMTB;
typedef Ptr<CalibrateDebevec> Ptr_CalibrateDebevec;
typedef Ptr<MergeDebevec> Ptr_MergeDebevec;
typedef Ptr<MergeMertens> Ptr_MergeMertens;
typedef Ptr<cv::softcascade::ChannelFeatureBuilder> Ptr_ChannelFeatureBuilder; typedef Ptr<cv::softcascade::ChannelFeatureBuilder> Ptr_ChannelFeatureBuilder;
typedef SimpleBlobDetector::Params SimpleBlobDetector_Params; typedef SimpleBlobDetector::Params SimpleBlobDetector_Params;
......
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