-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Test- EdgeDrawing, EDLines, EDPF, EDCircles algorithms
- Loading branch information
1 parent
e70a4c4
commit bb65b64
Showing
3 changed files
with
1,192 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
modules/ximgproc/include/opencv2/ximgproc/edge_drawing.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.