Hough transformation and Detecting parallel lines

4 ビュー (過去 30 日間)
Elie
Elie 2014 年 2 月 13 日
編集済み: Nitin 2014 年 2 月 16 日
how can i compare edge of a rectangle with a theoretical line straight line and see if they are parallel and if they are not i want to rotate the rectangle until the side of it is parallel to the line. should i use hough transformation or what method best suites this application. Thank you.

回答 (1 件)

Nitin
Nitin 2014 年 2 月 16 日
編集済み: Nitin 2014 年 2 月 16 日
I = imread('rectangle.jpg');
I2 = rgb2gray(I);
%Get the 2 lines
I3 = I2 > 60 & I2 < 75;
% Clean image
I4 = bwareaopen(I3,20);
%Search for lines in image and estimate angle between them using Hough

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by