Least squares fit of a rectangle to a given shape/boundary (Scripts) Publisher's description
from Onkar Raut
Based on - A simple method for fitting of bounding rectangle to closed regions - D. Chaudhuri a , A. Samal b
% Based on - A simple method for fitting of bounding rectangle to closed regions - D. Chaudhuri a , A. Samal b.
% fit_rectangle - Function provides a least squares fit to the
% given boundary points of an object of unknown shape.
% Inputs - Boundary elements that must be a Nx2 array. (atleast 3 required)
% Output -
% Function will return a struct consisting of the bounding points
% Function will return the equation of the diagonal in the form
% y = mx +c (giving back m and c foreach diagonal).
% Equation of the Bounding sides in the form y = mx +c
% Location of the centroid in cartesian coordinates
System Requirements:MATLAB 7.6 (R2008a)
Program Release Status: New Release
Program Install Support: Install and Uninstall