資源簡介
matlab代碼
實現了matlab平臺下的極線校正算法
很有效 界面友好

代碼片段和文件信息
function?val?=?bilinear_interpolate(im?rc)
%BILINEAR_INTERPOLATE?performs?bilinear?interpolation.
%
%???val?=?bilinear_interpolate(im?rc)?returns?the?bilinearly?interpolated
%???pixel?values?at?the?given?list?of?positions?rc.
%
%???Input?arguments:
%???-?im?should?be?a?m-by-n-by-3?(colour)?image?or?a?m-by-n?(grey?scale)?image.
%???-?rc?should?be?a?2-by-k?matrix?where?k?is?the?number?of?positions
%?????whose?values?are?to?be?computed?via?bilinear?interpolation.??The?first
%?????row?of?the?matrix?should?contain?the?row-coordinates?and?the?second?row?the
%?????column-coordinates?of?these?positions.??It?is?important?that?all?the
%?????(rowcolumn)-positions?stored?in?the?matrix?rc?are?within?the?boundary
%?????of?the?image?im.
%
%???Output?argument:
%???-?val?is?the?output?k-by-3?(if?image?im?has?3?colour?bands)?or?k-by-1
%?????(if?image?im?is?a?grey?scale?image)?matrix?containing?the?interpolated?pixel
%?????values.
%
%Created?July?2002.
%Last?modified?September?2003.
%
%Copyright?Du?Huynh
%The?University?of?Western?Australia
%School?of?Computer?Science?and?Software?Engineering
nrows?=?size(im1);??ncols?=?size(im2);
%?number?of?bands?(3?for?coloured?images;?1?for?gray?scale?images)
nobands?=?size(im3);
%?check?that?all?the?entries?in?matrix?rc?are?within?the?boundary?of?image?im.
if?sum(rc(1:)?1?|?rc(1:)?>?nrows?|?rc(2:)?1?|?rc(2:)?>?ncols)
???error(‘bilinear_interpolate:?elements?of?the?rc?matrix?must?be?within?the?image?boundary‘);
end
%?The?four?corner?points?used?in?the?bilinear?interpolation:
%??c4??????c3
%??+--------+
%??|????????|
%??|?o??????|?????(a?point?o?which?is?stored?in?a?column?vector?of?rc
%??|????????|?????and?the?two?corner?points?used?for?its?bilinear?interpoation)
%??+--------+
%??c1??????c2
%?The?row-column?coordinate?system?is?used.??All?the?corner?points?c1?c2?c3
%?and?c4?are?two?vectors?whose?1st?components?contains?the?row?coordinates
%?and?2nd?components?contains?the?column?coordinates.
%?note?that?we?should?have?given?a?small?margin?for?variable?rc
%?so?that?the?four?corner?pixels?surrounding?rc?are?within?the
%?image?boundary?of?im.??This?condition?should?be?enforced?in?the
%?caller?of?this?function.
c4?=?(floor(rc));
c2?=?(ceil(rc));
c3?=?([c4(1:);?c2(2:)]);
c1?=?([c2(1:);?c4(2:)]);
%?d(diffRC_idx)?=?(rc(diffRC_idx)?-?c1)?./?(c4?-?c1?+?eps);
%
%?the?interpolation?procedure?above?fails?for?those?points?in
%?rc?whose?x-?or?y-?component?is?a?whole?number?(in?which?case
%?the?respective?components?of?these?points?in?the?c1?and?c4?matrices
%?would?be?the?same.??the?formula?for?d?below?would?cause?a?division
%?by?zero?problem.
sameC_idx?=?find(c2(2:)?==?c4(2:));
sameR_idx?=?find(c2(1:)?==?c4(1:));
diffRC_idx?=?find(c2(1:)?~=?c4(1:)?&?c2(2:)?~=?c4(2:));
%?now?the?formula?for?d?can?be?safely?applied...
d(:diffRC_idx)?=?(rc(:diffRC_idx)?-?c4(:diffRC_idx))?./?...
???(c2(:diffRC_idx)?-?c4(:diffRC_idx)?+?eps);
d(2s
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3888??2003-12-05?10:27??極線矯正_很有效\bilinear_interpolate.m
?????文件???????1584??2003-09-22?19:55??極線矯正_很有效\calib1.dat
?????文件??????31395??2002-07-16?17:26??極線矯正_很有效\calib1.jpg
?????文件???????1584??2003-09-22?19:55??極線矯正_很有效\calib2.dat
?????文件??????29239??2002-07-16?17:26??極線矯正_很有效\calib2.jpg
?????文件???????4247??2003-12-11?16:28??極線矯正_很有效\example.m
?????文件???????9290??2005-06-28?15:27??極線矯正_很有效\fundmatrix_nonlin.m
?????文件???????2242??2003-12-08?18:50??極線矯正_很有效\index.html
?????文件????????423??2003-12-11?16:23??極線矯正_很有效\in_range.m
?????文件?????921654??2000-11-03?18:05??極線矯正_很有效\j1.bmp
?????文件????????220??2003-09-20?00:30??極線矯正_很有效\j1.dat
?????文件?????921654??2000-11-03?18:05??極線矯正_很有效\j2.bmp
?????文件????????220??2003-09-20?00:30??極線矯正_很有效\j2.dat
?????文件???????1333??2003-12-11?16:23??極線矯正_很有效\kb_input.m
?????文件???????5738??2005-07-14?14:31??極線矯正_很有效\lmeds.m
?????文件???????6956??2005-07-13?10:46??極線矯正_很有效\lmeds_options.m
?????文件????????502??1999-04-28?16:24??極線矯正_很有效\pflat.m
?????文件???????1635??2003-12-11?16:28??極線矯正_很有效\rectification_angle.m
?????文件???????1993??2003-12-11?16:28??極線矯正_很有效\rectification_H.m
?????文件???????2492??2004-01-18?20:38??極線矯正_很有效\rectification_transf.m
?????文件???????3040??2012-12-26?14:34??極線矯正_很有效\rectify_im.asv
?????文件???????3040??2012-12-26?14:35??極線矯正_很有效\rectify_im.m
?????文件???????4339??2003-12-11?16:28??極線矯正_很有效\rectify_images.m
?????文件????????377??2003-12-02?17:29??極線矯正_很有效\skew.m
????..A.SH.?????16384??2013-01-16?20:34??極線矯正_很有效\Thumbs.db
?????目錄??????????0??2013-04-25?20:25??極線矯正_很有效
-----------?---------??----------?-----??----
??????????????1975469????????????????????26
評論
共有 條評論