Rectangle Positioning Algorithm Simulation Based on Edge Detection and Hough Transform

Ping Xie*, Jiang Zhou
North China Electric Power University, Beijing, 102206, China

© 2014 Xie and Zhou

open-access license: This is an open access article distributed under the terms of the Creative Commons Attribution 4.0 International Public License (CC-BY 4.0), a copy of which is available at: ( This license permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

* Address correspondence to this author at the North China Electric Power University, Beijing, 102206, China; Tel: 0086-10-61772177; Fax: 0086-10-61772177; E-mail:


This paper proposes a new algorithm to extract the rectangle in images. It’s goal is to meet the requirement of the truck’s compartment positioning and assure that some works are done inside the truck’s compartment. Firstly, the Canny operator is used to calculate the edge of the image, because it is sensitive to the image texture features. Secondly, the Canny edge is transformed with the Hough transform algorithm. The peak points in the Hough parameter space indicate the straight lines which may be the elements of the compartment. The sides of the rectangle are the straight lines which meet the conditions of the actual size of the compartment. Finally, the four vertices of the rectangle are solved in accordance with the geometric constraint of rectangle. The simulation experiment shows that the algorithm is effective.

Keywords: Edge detecting, Hough transform, rectangle positioning, simulation.