How to find horizontal and vertical lines in an image using Hough Transformation (OpenCV) in android?

This is the code I am using to do so

 Mat lines = new Mat();  Mat houghline = new Mat();  Mat imgIn = inputFrame.gray();  Imgproc.Canny(imgIn, houghline, 80, 100);  Imgproc.HoughLinesP(houghline, lines, 1, Math.PI / 180, 10);     for (int x = 0; x < lines.cols(); x++)     {         double[] vec = lines.get(0, x);         double x1 = vec[0],                 y1 = vec[1],                 x2 = vec[2],                 y2 = vec[3];         Point start = new Point(x1, y1);         Point end = new Point(x2, y2);         Log.i("*********************>", " " + x1 + " " + y1 + "" + x2 + "" + y2);          Imgproc.line(houghline, start, end, new Scalar(0, 255, 0, 255), 20);// here initimg is the original image.      } 

However i am getting only one line always . What is that i am doing wrong ? . Any help will be appreciated.

Replay

Category: android Time: 2016-07-30 Views: 3
Tags: android opencv

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.132 (s). 12 q(s)