Commit e4cfe59a authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #74 from znah/to_python

[WIP] Effort to expose new contributions into python
parents 9c1f398d 4ba60f02
......@@ -3495,7 +3495,7 @@ bool isValidPair(Mat &grey, Mat &lab, Mat &mask, vector<Mat> &channels, vector<
Point center_i(i->rect.x+i->rect.width/2, i->rect.y+i->rect.height/2);
Point center_j(j->rect.x+j->rect.width/2, j->rect.y+j->rect.height/2);
float centroid_angle = (float)atan2(center_j.y-center_i.y, center_j.x-center_i.x);
float centroid_angle = (float)atan2((float)(center_j.y-center_i.y), (float)(center_j.x-center_i.x));
int avg_width = (i->rect.width + j->rect.width) / 2;
float norm_distance = (float)(j->rect.x-(i->rect.x+i->rect.width))/avg_width;
......
......@@ -57,44 +57,44 @@ enum EdgeAwareFiltersList
/*Interface for DT filters*/
class CV_EXPORTS DTFilter : public Algorithm
class CV_EXPORTS_W DTFilter : public Algorithm
{
public:
virtual void filter(InputArray src, OutputArray dst, int dDepth = -1) = 0;
CV_WRAP virtual void filter(InputArray src, OutputArray dst, int dDepth = -1) = 0;
};
typedef Ptr<DTFilter> DTFilterPtr;
/*Fabric function for DT filters*/
CV_EXPORTS
CV_EXPORTS_W
Ptr<DTFilter> createDTFilter(InputArray guide, double sigmaSpatial, double sigmaColor, int mode = DTF_NC, int numIters = 3);
/*One-line DT filter call*/
CV_EXPORTS
CV_EXPORTS_W
void dtFilter(InputArray guide, InputArray src, OutputArray dst, double sigmaSpatial, double sigmaColor, int mode = DTF_NC, int numIters = 3);
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
/*Interface for Guided Filter*/
class CV_EXPORTS GuidedFilter : public Algorithm
class CV_EXPORTS_W GuidedFilter : public Algorithm
{
public:
virtual void filter(InputArray src, OutputArray dst, int dDepth = -1) = 0;
CV_WRAP virtual void filter(InputArray src, OutputArray dst, int dDepth = -1) = 0;
};
/*Fabric function for Guided Filter*/
CV_EXPORTS Ptr<GuidedFilter> createGuidedFilter(InputArray guide, int radius, double eps);
CV_EXPORTS_W Ptr<GuidedFilter> createGuidedFilter(InputArray guide, int radius, double eps);
/*One-line Guided Filter call*/
CV_EXPORTS void guidedFilter(InputArray guide, InputArray src, OutputArray dst, int radius, double eps, int dDepth = -1);
CV_EXPORTS_W void guidedFilter(InputArray guide, InputArray src, OutputArray dst, int radius, double eps, int dDepth = -1);
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
class CV_EXPORTS AdaptiveManifoldFilter : public Algorithm
class CV_EXPORTS_W AdaptiveManifoldFilter : public Algorithm
{
public:
/**
......@@ -103,23 +103,23 @@ public:
* @param dst Adaptive-manifold filter response.
* @param src_joint Image for joint filtering (optional).
*/
virtual void filter(InputArray src, OutputArray dst, InputArray joint = noArray()) = 0;
CV_WRAP virtual void filter(InputArray src, OutputArray dst, InputArray joint = noArray()) = 0;
virtual void collectGarbage() = 0;
CV_WRAP virtual void collectGarbage() = 0;
static Ptr<AdaptiveManifoldFilter> create();
CV_WRAP static Ptr<AdaptiveManifoldFilter> create();
};
//Fabric function for AM filter algorithm
CV_EXPORTS Ptr<AdaptiveManifoldFilter> createAMFilter(double sigma_s, double sigma_r, bool adjust_outliers = false);
CV_EXPORTS_W Ptr<AdaptiveManifoldFilter> createAMFilter(double sigma_s, double sigma_r, bool adjust_outliers = false);
//One-line Adaptive Manifold filter call
CV_EXPORTS void amFilter(InputArray joint, InputArray src, OutputArray dst, double sigma_s, double sigma_r, bool adjust_outliers = false);
CV_EXPORTS_W void amFilter(InputArray joint, InputArray src, OutputArray dst, double sigma_s, double sigma_r, bool adjust_outliers = false);
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
CV_EXPORTS
CV_EXPORTS_W
void jointBilateralFilter(InputArray joint, InputArray src, OutputArray dst, int d, double sigmaColor, double sigmaSpace, int borderType = BORDER_DEFAULT);
}
......
......@@ -137,9 +137,9 @@ namespace xphoto
{
CV_Assert( src.type() == CV_MAKE_TYPE(CV_32F, 3) );
cv::Matx33f mt(cvInvSqrt(3), cvInvSqrt(3), cvInvSqrt(3),
cvInvSqrt(2), 0.0f, -cvInvSqrt(2),
cvInvSqrt(6), -2.0f*cvInvSqrt(6), cvInvSqrt(6));
cv::Matx33f mt(cvInvSqrt(3.0f), cvInvSqrt(3.0f), cvInvSqrt(3.0f),
cvInvSqrt(2.0f), 0.0f, -cvInvSqrt(2.0f),
cvInvSqrt(6.0f), -2.0f*cvInvSqrt(6.0f), cvInvSqrt(6.0f));
cv::transform(src, dst, mt);
......
......@@ -75,7 +75,7 @@ namespace xphoto
++depth;
int bins = 16; // number of bins at each histogram level
int nElements = int( pow(bins, depth) );
int nElements = int( pow((float)bins, (float)depth) );
// number of elements in histogram tree
for (size_t i = 0; i < src.size(); ++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