diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 16:48:16 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 16:48:16 -0400 |
commit | 1953d28f5250b08bbfa7d44c438421ca4faac269 (patch) | |
tree | 8530ed8004613e2f5275037fe44de63cb6d6de0a | |
parent | c524c3707afcf9b033711995a5625680cde606b1 (diff) | |
download | wgmr-1953d28f5250b08bbfa7d44c438421ca4faac269.tar.gz wgmr-1953d28f5250b08bbfa7d44c438421ca4faac269.zip |
more points per beam
-rw-r--r-- | make_beam_trace.m | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/make_beam_trace.m b/make_beam_trace.m index c2257a6..f62168f 100644 --- a/make_beam_trace.m +++ b/make_beam_trace.m @@ -1,30 +1,28 @@ function img=make_beam_trace(beam, stop_point, border_limits, img) % img so far beam traced part - % border_limits has coordinates of left bottom and right top coners + [Ny,Nx]=size(img); + %% border_limits has coordinates of left bottom and right top coners xlb=border_limits(1); ylb=border_limits(2); xrt=border_limits(3); yrt=border_limits(4); - % beam start stop coordinates with respect to lower left border point + %% beam start stop coordinates with respect to lower left border point xb1=beam.origin(1)-xlb; yb1=beam.origin(2)-ylb; xb2=stop_point(1)-xlb; yb2=stop_point(2)-ylb; - % beam path coordinates - Nc=100; % number of coordinate points + %% beam path coordinates + Nc=1000; % number of coordinate points xb=linspace(xb1,xb2, Nc); yb=linspace(yb1,yb2, Nc); - % beam coordinate to image pixel coordinate - - [Ny,Nx]=size(img); - + %% beam coordinate to image pixel coordinate px=round(xb/(xrt-xlb)*(Nx-1) + 1); py=round(yb/(yrt-ylb)*(Ny-1) + 1); - % truncate to borders + %% truncate to borders py=py( (1<=px) & (px<=Nx) ); px=px( (1<=px) & (px<=Nx) ); |