I am trying to extract the horizontal / vertical lines from (incomplete) grid points. Here is simplified example:
% grid(): 2D matrix containing actual grid points, which are unknown
% points(): 1D matrix containing found grid points, which are incomplete
% assuming 5X5 grid
points = [grid(1,1);grid(1,2);grid(1,3);grid(1,4);
grid(2,1);grid(2,3);grid(2,4);grid(2,5);
grid(3,1);grid(3,2);grid(3,3);grid(3,4);grid(3,5);
grid(4,1);grid(4,2);grid(4,3);grid(4,4);grid(3,5);
grid(5,1);grid(5,2);grid(5,4);grid(5,5)];
The result what I expect is:
- Finding the line equations of each column & row by regression. In this case, the set contains 5 horizontal and 5 vertical equations: For example, param_row(5,2) and param_column(5,2) would be the parameter set for each 1D line (y=ax+b)
- Complete grid() matrix by calculating the cross point between horizontal and vertical equations. I this case, grid(1,5);grid(2,2);grid(5.3) should be obtained
Thanks for help.
EDIT:
https://drive.google.com/file/d/0B_UjxbISeZDrZDlWaV9ZaXVtbmc/view?usp=sharing
Here is the (binary) grid image what I should handle (I couldn't post image on the main text). The position of ON pixels are stored at point()
. In this image, grid()
are the set of cross points among the fitted horizontal / vertical lines. So, "Complete grid() matrix" means finding missed points on the image.