Skip to content

Commit

Permalink
-Test- EdgeDrawing, EDLines, EDPF, EDCircles algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
sturkmen72 committed Dec 3, 2019
1 parent e70a4c4 commit bb65b64
Show file tree
Hide file tree
Showing 3 changed files with 1,192 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/ximgproc/include/opencv2/ximgproc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "ximgproc/sparse_match_interpolator.hpp"
#include "ximgproc/structured_edge_detection.hpp"
#include "ximgproc/edgeboxes.hpp"
#include "ximgproc/edge_drawing.hpp"
#include "ximgproc/seeds.hpp"
#include "ximgproc/segmentation.hpp"
#include "ximgproc/fast_hough_transform.hpp"
Expand Down
66 changes: 66 additions & 0 deletions modules/ximgproc/include/opencv2/ximgproc/edge_drawing.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.

#ifndef __OPENCV_EDGE_DRAWING_HPP__
#define __OPENCV_EDGE_DRAWING_HPP__

#include <opencv2/core.hpp>

namespace cv
{
namespace ximgproc
{

struct StackNode
{
int r, c; // starting pixel
int parent; // parent chain (-1 if no parent)
int dir; // direction where you are supposed to go
};

// Used during Edge Linking
struct Chain
{
int dir; // Direction of the chain
int len; // # of pixels in the chain
int parent; // Parent of this node (-1 if no parent)
int children[2]; // Children of this node (-1 if no children)
cv::Point *pixels; // Pointer to the beginning of the pixels array
};

class CV_EXPORTS_W EdgeDrawing : public Algorithm
{
public:

enum GradientOperator
{
PREWITT = 0,
SOBEL = 1,
SCHARR = 2,
LSD = 3
};

CV_WRAP virtual void apply(InputArray image) = 0;
CV_WRAP virtual void getEdgeImage(OutputArray dst) = 0;
CV_WRAP virtual void getAnchorImage(OutputArray dst) = 0;
CV_WRAP virtual void getSmoothImage(OutputArray dst) = 0;
CV_WRAP virtual void getGradImage(OutputArray dst) = 0;

CV_WRAP virtual int getSegmentNo() = 0;
CV_WRAP virtual int getAnchorNo() = 0;

CV_WRAP virtual std::vector<Point> getAnchorPoints() = 0;
CV_WRAP virtual std::vector<std::vector<Point> > getSegments() = 0;

virtual ~EdgeDrawing() { }
};


CV_EXPORTS_W Ptr<EdgeDrawing> createEdgeDrawing(
int _gradThresh = 20, int _anchorThresh = 0, int _scanInterval = 1,
int _minPathLen = 10, double _sigma = 1.0, bool _sumFlag = true);

}
}
#endif
Loading

0 comments on commit bb65b64

Please sign in to comment.