資源簡介
在圖像拼接過程中對于旋轉的圖像需要進行對數極坐標變換,該程序可以實現這種功能。
代碼片段和文件信息
%function?[routgb]?=?LHimlogpolar(imageNrhoNthetaMethodCenterShape)
function?[routgb]?=?LHimlogpolar(varargin)
%IMLOGPOLAR?Compute?logarithmic?polar?transformation?of?image.
%???B?=?IMLOGPOLAR(ANRHONTHETAMETHOD)?computes?the?logarithmic
%???polar?transformation?of?image?A?generating?a?log?polar?image
%???of?size?NRHO?by?NTHETA.?METHOD?describes?the?interpolation
%???method.?METHOD?is?a?string?that?can?have?one?of?these?values:
%
%????????‘nearest‘?(default)?nearest?neighbor?interpolation
%
%????????‘bilinear‘?bilinear?interpolation
%
%????????‘bicubic‘?bicubic?interpolation
%
%???If?you?omit?the?METHOD?argument?IMLOGPOLAR?uses?the?default
%???method?of?‘nearest‘.?
%
%???B?=?IMLOGPOLAR(ANRHONTHETAMETHODCTR)?assumes?that?the?2x1
%???vector?CTR?contains?the?coordinates?of?the?origin?in?image?A.?
%???If?CTR?is?not?supplied?the?default?is?CTR?=?[(m+1)/2(n+1)/2]
%???where?A?has?n?rows?and?m?columns.
%
%???B?=?IMLOGPOLAR(ANRHONTHETAMETHODCTRSHAPE)?where?SHAPE?is?a
%???string?that?can?have?one?of?these?values:
%
%????????‘full‘?-?returns?log?polar?transformation?containing?ALL
%?????????????????pixels?from?image?A?(the?circumscribed?circle
%?????????????????centered?at?CTR)
%
%????????‘valid‘?-?returns?log?polar?transformation?containing?only
%?????????????????pixels?from?the?largest?inscribed?circle?in?image?A
%?????????????????centered?at?CTR.
%
%???If?you?omit?the?SHAPE?argument?IMLOGPOLAR?uses?the?default?shape
%???of?‘valid‘.?If?you?specify?the?shape?‘full‘?invalid?values?on?the
%???periphery?of?B?are?set?to?NaN.
%
%???Class?Support
%???-------------
%???The?input?image?can?be?of?class?uint8?or?double.?The?output
%???image?is?of?the?same?class?as?the?input?image.
%
%???Example
%???-------
%????????I?=?imread(‘ic.tif‘);
%????????J?=?imlogpolar(I6464‘bilinear‘);
%????????imshow(I)?figure?imshow(J)
%
%???See?also?IMCROP?IMRESIZE?IMROTATE.
%???Nathan?D.?Cahill?8-16-01?modified?from:
%???Clay?M.?Thompson?8-4-92
%???Copyright?1993-1998?The?MathWorks?Inc.?All?Rights?Reserved.
%???$Revision:?5.10?$?$Date:?1997/11/24?15:35:33?$
%?Grandfathered:
%???Without?output?arguments?IMLOGPOLAR(...)?displays?the?transformed
%???image?in?the?current?axis.?
%?Outputs:?A???????the?input?image
%???????????Nrho????the?desired?number?of?rows?of?transformed?image
%???????????Ntheta?the?desired?number?of?columns?of?transformed?image
%???????????Method?interpolation?method?(nearestbilinearbicubic)
%???????????Center?origin?of?input?image
%???????????Shape???output?size?(fullvalid)
%???????????Class???storage?class?of?A
[ImagerowscolsNrhoNthetaMethodCenterShapeClassIn]?=?LHparse_inputs(varargin{:});
threeD?=?(ndims(Image)==3);?%?Determine?if?input?includes?a?3-D?array
if?threeD
???[rgb]?=?LHtransformImage(ImagerowscolsNrhoNthetaMethodCenterShape);
???if?nargout==0?
??????imshow(rgb);
??????return;
???elseif?nargout==1
??????if?strcmp(Class
評論
共有 條評論