Package org.opencv.ximgproc
Class EdgeDrawing
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.ximgproc.EdgeDrawing
-
public class EdgeDrawing extends Algorithm
Class implementing the ED (EdgeDrawing) CITE: topal2012edge, EDLines CITE: akinlar2011edlines, EDPF CITE: akinlar2012edpf and EDCircles CITE: akinlar2013edcircles algorithms EDGE DRAWING LIBRARY FOR GEOMETRIC FEATURE EXTRACTION AND VALIDATION Edge Drawing (ED) algorithm is an proactive approach on edge detection problem. In contrast to many other existing edge detection algorithms which follow a subtractive approach (i.e. after applying gradient filters onto an image eliminating pixels w.r.t. several rules, e.g. non-maximal suppression and hysteresis in Canny), ED algorithm works via an additive strategy, i.e. it picks edge pixels one by one, hence the name Edge Drawing. Then we process those random shaped edge segments to extract higher level edge features, i.e. lines, circles, ellipses, etc. The popular method of extraction edge pixels from the thresholded gradient magnitudes is non-maximal supressiun that tests every pixel whether it has the maximum gradient response along its gradient direction and eliminates if it does not. However, this method does not check status of the neighboring pixels, and therefore might result low quality (in terms of edge continuity, smoothness, thinness, localization) edge segments. Instead of non-maximal supression, ED points a set of edge pixels and join them by maximizing the total gradient response of edge segments. Therefore it can extract high quality edge segments without need for an additional hysteresis step.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EdgeDrawing(long addr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EdgeDrawing
__fromPtr__(long addr)
void
detectEdges(Mat src)
Detects edges and prepares them to detect lines and ellipses.void
detectEllipses(Mat ellipses)
Detects circles and ellipses.void
detectLines(Mat lines)
Detects lines.protected void
finalize()
void
getEdgeImage(Mat dst)
void
getGradientImage(Mat dst)
java.util.List<MatOfPoint>
getSegments()
void
setParams(EdgeDrawing_Params parameters)
sets parameters.-
Methods inherited from class org.opencv.core.Algorithm
clear, empty, getDefaultName, getNativeObjAddr, save
-
-
-
-
Field Detail
-
PREWITT
public static final int PREWITT
- See Also:
- Constant Field Values
-
SOBEL
public static final int SOBEL
- See Also:
- Constant Field Values
-
SCHARR
public static final int SCHARR
- See Also:
- Constant Field Values
-
LSD
public static final int LSD
- See Also:
- Constant Field Values
-
-
Method Detail
-
__fromPtr__
public static EdgeDrawing __fromPtr__(long addr)
-
detectEdges
public void detectEdges(Mat src)
Detects edges and prepares them to detect lines and ellipses.- Parameters:
src
- input image
-
getEdgeImage
public void getEdgeImage(Mat dst)
-
getGradientImage
public void getGradientImage(Mat dst)
-
getSegments
public java.util.List<MatOfPoint> getSegments()
-
detectLines
public void detectLines(Mat lines)
Detects lines.- Parameters:
lines
- output Vec<4f> contains start point and end point of detected lines. Note: you should call detectEdges() method before call this.
-
detectEllipses
public void detectEllipses(Mat ellipses)
Detects circles and ellipses.- Parameters:
ellipses
- output Vec<6d> contains center point and perimeter for circles. Note: you should call detectEdges() method before call this.
-
setParams
public void setParams(EdgeDrawing_Params parameters)
sets parameters. this function is meant to be used for parameter setting in other languages than c++.- Parameters:
parameters
- automatically generated
-
-