Ask Your Question

Revision history [back]

Android line fit

I am having some trouble using the fitLine function for the library for android.

public void fit(Mat image){
        Imgproc.Canny(image, image, 80, 90);
        Top topHalf = image.submat(0, image.rows()/2, 0, image.cols());
        Mat fittedLine = new MatOfFloat4();
        Imgproc.fitLine(topHalf, fittedLine, Imgproc.CV_DIST_L2, 0, 0.01, 0.01);
}

Everytime my App runs the fitLine function, it stops working. I was wondering how exactly do I set up the fitLine function. I feel that I did not setup the "fittedLine" variable correctly. If possible, a simple example would be great.

Android line fit

I am having some trouble using the fitLine function for the library for android.

public void fit(Mat image){
        Imgproc.Canny(image, image, 80, 90);
        Top topHalf = image.submat(0, image.rows()/2, 0, image.cols());
        Mat fittedLine = new MatOfFloat4();
        Imgproc.fitLine(topHalf, fittedLine, Imgproc.CV_DIST_L2, 0, 0.01, 0.01);
}

Everytime my App runs the fitLine function, it stops working. I was wondering how exactly do I set up the fitLine function. I feel that I did not setup the "fittedLine" variable correctly. If possible, a simple example would be great.

Android line fit

I am having some trouble using the fitLine function for the library for android.

public void fit(Mat image){
        Imgproc.Canny(image, image, 80, 90);
        Top topHalf = image.submat(0, image.rows()/2, 0, image.cols());
        Mat fittedLine = new MatOfFloat4();
        Imgproc.fitLine(topHalf, fittedLine, Imgproc.CV_DIST_L2, 0, 0.01, 0.01);
}

Everytime my App runs the fitLine function, it stops working. I was wondering how exactly do I set up the fitLine function. I feel that I did not setup the "fittedLine" variable correctly. If possible, a simple example would be great.