Example usage for org.opencv.imgproc Imgproc HoughLines

List of usage examples for org.opencv.imgproc Imgproc HoughLines

Introduction

In this page you can find the example usage for org.opencv.imgproc Imgproc HoughLines.

Prototype

public static void HoughLines(Mat image, Mat lines, double rho, double theta, int threshold, double srn,
            double stn, double min_theta, double max_theta) 

Source Link

Usage

From source file:OCV_HoughLines.java

License:Open Source License

@Override
public void run(ImageProcessor ip) {
    // src//www.  j a  v a2s .  c  o  m
    int imw = ip.getWidth();
    int imh = ip.getHeight();
    byte[] src_ar = (byte[]) ip.getPixels();

    // mat
    Mat src_mat = new Mat(imh, imw, CvType.CV_8UC1);
    Mat dst_lines = new Mat();

    // run
    src_mat.put(0, 0, src_ar);

    double resAng = CV_PI / resAngFact;
    double minTheta = CV_PI / 360.0 * minDeg;
    double maxTheta = CV_PI / 360.0 * maxDeg;
    Imgproc.HoughLines(src_mat, dst_lines, resDist, resAng, minVotes, divDist, divAng, minTheta, maxTheta);

    // fin
    showData(dst_lines, imw, imh);
}

From source file:houghtransform.transform_process.OpenCV.java

@Override
public void houghTransform(Mat edges) {
    Imgproc.HoughLines(edges, lines, 1, Math.PI / 180, 100, 0, 0, 0, Math.PI);
}