title: How do I obtain intersection points between a line and a boundary in MATLAB?
body: <p>I have a binary image of a human. In MATLAB, boundary points and the center of the image are also defined, and they are two column matrices. Now I want to draw lines from the center to the boundary points so that I can obtain all points of intersection between these lines and the boundary of the image.  How can I do that?  Here is the code I have so far:
  The code that is written just to get the  one intersection point if anyone can help please</p>
  
  <pre><code>clear all  
  close all  
  clc
  BW = im2bw(imread('C:\fyc-90_1-100.png'));
  BW = imfill(BW,'holes');  
  [Bw m n]=preprocess(BW);  
  [bord sk pr_sk]=border_skeleton(BW);  
  boundry=bord;        
  L = bwlabel(BW);  
  s = regionprops(L, 'centroid');  
  centroids = cat(1, s.Centroid);
  </code></pre>