亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fchcode.m

?? Image Processing Toolbox
?? M
字號:
function  c = fchcode(b, conn, dir)
%FCHCODE Computes the Freeman chain code of a boundary.
%   C = FCHCODE(B) computes the 8-connected Freeman chain code of a
%   set of 2-D coordinate pairs contained in B, an np-by-2 array. C
%   is a structure with the following fields: 
%
%     c.fcc    = Freeman chain code (1-by-np)
%     c.diff   = First difference of code c.fcc (1-by-np)
%     c.mm     = Integer of minimum magnitude from c.fcc (1-by-np)
%     c.diffmm = First difference of code c.mm (1-by-np)
%     c.x0y0   = Coordinates where the code starts (1-by-2) 
%
%   C = FCHCODE(B, CONN) produces the same outputs as above, but
%   with the code connectivity specified in CONN. CONN can be 8 for
%   an 8-connected chain code, or CONN can be 4 for a 4-connected
%   chain code. Specifying CONN=4 is valid only if the input
%   sequence, B, contains transitions with values 0, 2, 4, and 6,
%   exclusively.
%       
%   C = FHCODE(B, CONN, DIR) produces the same outputs as above, but,
%   in addition, the desired code direction is specified. Values for
%   DIR can be: 
%
%     'same'      Same as the order of the sequence of points in b.
%                 This is the default.
%
%     'reverse'   Outputs the code in the direction opposite to the 
%                 direction of the points in B.  The starting point 
%                 for each DIR is the same.
%
%   The elements of B are assumed to correspond to a 1-pixel-thick,
%   fully-connected, closed boundary. B cannot contain duplicate
%   coordinate pairs, except in the first and last positions, which
%   is a common feature of boundary tracing programs. 
%
%   FREEMAN CHAIN CODE REPRESENTATION
%   The table on the left shows the 8-connected Freeman chain codes 
%   corresponding to allowed deltax, deltay pairs. An 8-chain is
%   converted to a 4-chain if (1) if conn = 4; and (2) only
%   transitions 0, 2, 4, and 6 occur in the 8-code.  Note that
%   dividing 0, 2, 4, and 6 by 2 produce the 4-code. 
%
%       -----------------------  ----------------
%       deltax | deltay | 8-code  corresp 4-code
%       -----------------------  ----------------
%         0        1       0            0
%        -1        1       1
%        -1        0       2            1
%        -1       -1       3
%         0       -1       4            2
%         1       -1       5
%         1        0       6            3
%         1        1       7
%       -----------------------  ----------------
%
%   The formula z = 4*(deltax + 2) + (deltay + 2) gives the following
%   sequence corresponding to rows 1-8 in the preceding table: z =
%   11,7,6,5,9,13,14,15. These values can be used as indices into the
%   table, improving the speed of computing the chain code. The
%   preceding formula is not unique, but it is based on the smallest
%   integers (4 and 2) that are powers of 2. 

%   Copyright 2002-2004 R. C. Gonzalez, R. E. Woods, & S. L. Eddins
%   Digital Image Processing Using MATLAB, Prentice-Hall, 2004
%   $Revision: 1.6 $  $Date: 2003/11/21 14:34:49 $

% Preliminaries.
if nargin == 1 
   dir = 'same'; 
   conn = 8;
elseif nargin == 2 
   dir = 'same';
elseif nargin == 3   
   % Nothing to do here.
else 
   error('Incorrect number of inputs.')
end
[np, nc] = size(b);
if np < nc 
   error('B must be of size np-by-2.'); 
end

% Some boundary tracing programs, such as boundaries.m, output a
% sequence in which the coordinates of the first and last points are
% the same. If this is the case, eliminate the last point. 
if isequal(b(1, :), b(np, :))
   np = np - 1;
   b = b(1:np, :);
end

% Build the code table using the single indices from the formula 
% for z given above:
C(11)=0; C(7)=1; C(6)=2; C(5)=3; C(9)=4;
C(13)=5; C(14)=6; C(15)=7;

% End of Preliminaries.

% Begin processing.
x0 = b(1, 1);
y0 = b(1, 2);
c.x0y0 = [x0, y0];

% Make sure the coordinates are organized sequentially:
% Get the deltax and deltay between successive points in b. The 
% last row of a is the first row of b.
a = circshift(b, [-1, 0]);

% DEL = a - b is an nr-by-2 matrix in which the rows contain the
% deltax and deltay between successive points in b. The two 
% components in the kth row of matrix DEL are deltax and deltay 
% between point (xk, yk) and (xk+1, yk+1).  The last row of DEL 
% contains the deltax and deltay between (xnr, ynr) and (x1, y1),
% (i.e., between the last and first points in b).
DEL = a - b;

% If the abs value of either (or both) components of a pair 
% (deltax, deltay) is greater than 1, then by definition the curve 
% is broken (or the points are out of order), and the program 
% terminates.
if any(abs(DEL(:, 1)) > 1) | any(abs(DEL(:, 2)) > 1);
   error('The input curve is broken or points are out of order.')
end

% Create a single index vector using the formula described above.
z = 4*(DEL(:, 1) + 2) + (DEL(:, 2) + 2);

% Use the index to map into the table. The following are
% the Freeman 8-chain codes, organized in a 1-by-np array.
fcc = C(z);

% Check if direction of code sequence needs to be reversed.
if strcmp(dir, 'reverse')
   fcc = coderev(fcc); % See below for function coderev.
end

% If 4-connectivity is specified, check that all components
% of fcc are 0, 2, 4, or 6.
if conn == 4
   val = find(fcc == 1 | fcc == 3 | fcc == 5 | fcc ==7 );
   if isempty(val)
      fcc = fcc./2;
   else
      warning('The specified 4-connected code cannot be satisfied.')
   end
end

% Freeman chain code for structure output.
c.fcc = fcc;

% Obtain the first difference of fcc.
c.diff = codediff(fcc,conn); % See below for function codediff.

% Obtain code of the integer of minimum magnitude.
c.mm = minmag(fcc); % See below for function minmag.

% Obtain the first difference of fcc
c.diffmm = codediff(c.mm, conn);

%-------------------------------------------------------------------%
function cr = coderev(fcc)
%   Traverses the sequence of 8-connected Freeman chain code fcc in
%   the opposite direction, changing the values of each code
%   segment. The starting point is not changed. fcc is a 1-by-np
%   array.

% Flip the array left to right.  This redefines the starting point 
% as the last point and reverses the order of "travel" through the 
% code.
cr = fliplr(fcc);

% Next, obtain the new code values by traversing the code in the 
% opposite direction. (0 becomes 4, 1 becomes 5, ... , 5 becomes 1, 
% 6 becomes 2, and 7 becomes 3).
ind1 = find(0 <= cr & cr <= 3);
ind2 = find(4 <= cr & cr <= 7);
cr(ind1) = cr(ind1) + 4;
cr(ind2) = cr(ind2) - 4;

%-------------------------------------------------------------------%
function z = minmag(c)
%MINMAG Finds the integer of minimum magnitude in a chain code.
%   Z = MINMAG(C) finds the integer of minimum magnitude in a given
%   4- or 8-connected Freeman chain code, C. The code is assumed to
%   be a 1-by-np array.

% The integer of minimum magnitude starts with min(c), but there 
% may be more than one such value. Find them all,
I = find(c == min(c));
% and shift each one left so that it starts with min(c).
J = 0;
A = zeros(length(I), length(c));
for k = I;
   J = J + 1;
   A(J, :) = circshift(c,[0 -(k-1)]);
end

% Matrix A contains all the possible candidates for the integer of
% minimum magnitude. Starting with the 2nd column, succesively find
% the minima in each column of A. The number of candidates decreases
% as the seach moves to the right on A.  This is reflected in the
% elements of J.  When length(J)=1, one candidate remains.  This is
% the integer of minimum magnitude.  
[M, N] = size(A);
J = (1:M)';
for k = 2:N
   D(1:M, 1) = Inf;
   D(J, 1) = A(J, k);
   amin = min(A(J, k));
   J = find(D(:, 1) == amin);
   if length(J)==1
      z = A(J, :);
      return
   end
end
    
%-------------------------------------------------------------------%
function d = codediff(fcc, conn)
%CODEDIFF Computes the first difference of a chain code.
%   D = CODEDIFF(FCC) computes the first difference of code, FCC. The
%   code FCC is treated as a circular sequence, so the last element
%   of D is the difference between the last and first elements of
%   FCC.  The input code is a 1-by-np vector. 
%
%   The first difference is found by counting the number of direction
%   changes (in a counter-clockwise direction) that separate two
%   adjacent elements of the code. 

sr = circshift(fcc, [0, -1]); % Shift input left by 1 location.
delta = sr - fcc;
d = delta;
I = find(delta < 0);
 
type = conn;
switch type
case 4 % Code is 4-connected
   d(I) = d(I) + 4;
case 8 % Code is 8-connected
   d(I) = d(I) + 8;
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区在线看| 日韩欧美在线影院| 久久疯狂做爰流白浆xx| 亚洲最大成人综合| 久久精品夜色噜噜亚洲a∨| 欧美区在线观看| 91在线小视频| 国产精品一区二区无线| 亚洲bt欧美bt精品| 一区二区三区在线观看视频| 欧美国产乱子伦| 精品久久久久久综合日本欧美| 91精品1区2区| 99视频有精品| 欧美电影一区二区| 色综合天天综合给合国产| 国产福利精品一区二区| 久久激情五月婷婷| 日韩在线卡一卡二| 亚洲国产精品久久人人爱| 国产精品麻豆久久久| 久久嫩草精品久久久久| 欧美r级在线观看| 777亚洲妇女| 欧美日韩国产色站一区二区三区| 91色视频在线| 91久久精品日日躁夜夜躁欧美| av在线播放成人| 99久久精品国产一区| 成人精品视频.| 粉嫩高潮美女一区二区三区| 狠狠色综合播放一区二区| 激情五月播播久久久精品| 美女视频黄 久久| 蜜臀av性久久久久蜜臀av麻豆| 日本成人在线视频网站| 天天影视网天天综合色在线播放| 亚洲一区二区三区国产| 亚洲成人在线网站| 亚洲国产三级在线| 天堂成人免费av电影一区| 日韩精品乱码免费| 美女精品一区二区| 激情五月婷婷综合网| 国产成人综合在线观看| 成人激情图片网| 91免费版pro下载短视频| 99国产精品国产精品久久| 91国偷自产一区二区开放时间 | 美女www一区二区| 久久国产麻豆精品| 国产乱码精品一区二区三区av| 国产九色sp调教91| 成人av在线一区二区| 国产无人区一区二区三区| 欧美国产日本视频| 亚洲伦在线观看| 亚洲18色成人| 麻豆国产欧美日韩综合精品二区 | 在线观看一区不卡| 欧美无乱码久久久免费午夜一区| 欧美疯狂性受xxxxx喷水图片| 精品国产免费一区二区三区四区 | 奇米综合一区二区三区精品视频| 久久精品国产成人一区二区三区| 国产美女在线观看一区| 成人看片黄a免费看在线| 91福利在线免费观看| 欧美精品久久99久久在免费线 | 国产精品无人区| 一区二区免费视频| 久久99久久99小草精品免视看| 成人av片在线观看| 欧美群妇大交群中文字幕| 久久精品夜色噜噜亚洲aⅴ| 亚洲最新视频在线观看| 精品影视av免费| 99精品欧美一区二区三区综合在线| 欧美久久高跟鞋激| 国产视频一区二区在线观看| 亚洲精品乱码久久久久久黑人| 免费成人av在线| 91丨porny丨蝌蚪视频| 欧美日韩大陆一区二区| 国产日产精品一区| 婷婷综合五月天| 成人18视频日本| 91精品啪在线观看国产60岁| 国产精品成人免费在线| 久久av资源网| 久久精品欧美日韩| 亚洲国产精品影院| 国产精品一区二区三区99| 欧美主播一区二区三区| 国产夜色精品一区二区av| 性久久久久久久久久久久| 懂色av一区二区三区免费观看 | 精品国产污污免费网站入口| 亚洲日本乱码在线观看| 国产精品一区二区91| 欧美福利一区二区| 亚洲欧美日韩电影| 国产aⅴ综合色| 欧美一级国产精品| 五月天网站亚洲| 91久久人澡人人添人人爽欧美| 国产无一区二区| 韩国在线一区二区| 日韩三级中文字幕| 午夜精品免费在线| 欧洲亚洲国产日韩| 国产精品成人在线观看| 国产91综合网| 久久美女高清视频| 精品一区二区久久| 欧美一级国产精品| 蜜桃在线一区二区三区| 欧美精品亚洲一区二区在线播放| 亚洲在线视频免费观看| 99r国产精品| 国产精品成人一区二区艾草| 成人理论电影网| 国产精品日韩精品欧美在线| 国产乱码精品一区二区三区忘忧草 | 国产成人夜色高潮福利影视| 精品久久久久一区二区国产| 免费黄网站欧美| 日韩一二三区不卡| 蜜桃视频在线一区| 精品精品欲导航| 精品午夜久久福利影院| 欧美xxxx老人做受| 精品一区二区三区在线观看国产| 91精品国产综合久久久蜜臀粉嫩 | 一区二区三区在线免费播放| 99国产精品久久久久久久久久| 国产精品国产三级国产a| 成人黄页毛片网站| 中文字幕一区二| 色呦呦国产精品| 夜夜嗨av一区二区三区网页| 欧美亚男人的天堂| 亚洲va天堂va国产va久| 欧美一级在线观看| 激情欧美日韩一区二区| 久久蜜臀中文字幕| 国产91精品精华液一区二区三区| 国产精品久久久久久久蜜臀| 91在线视频18| 婷婷国产v国产偷v亚洲高清| 51精品秘密在线观看| 国产精品原创巨作av| 自拍av一区二区三区| 欧美丝袜丝交足nylons| 蜜臀av一级做a爰片久久| 国产欧美日韩卡一| 日本韩国欧美国产| 青青草国产精品亚洲专区无| 26uuu色噜噜精品一区二区| 成人激情免费电影网址| 亚洲国产精品综合小说图片区| 欧美一区二区美女| www.视频一区| 水蜜桃久久夜色精品一区的特点| 日韩欧美成人一区| 不卡的av网站| 首页亚洲欧美制服丝腿| 国产亚洲视频系列| 欧美视频一区二区在线观看| 韩国精品免费视频| 国产精品国产三级国产普通话99| 欧美性三三影院| 国产在线不卡一卡二卡三卡四卡| 中文字幕在线视频一区| 欧美日韩精品综合在线| 国产成人精品在线看| 午夜激情久久久| 国产欧美一区二区精品性色 | 国产乱码一区二区三区| 亚洲精品国产品国语在线app| 日韩一区二区在线观看视频| av一区二区三区在线| 麻豆成人91精品二区三区| 亚洲视频一区二区在线| 精品人在线二区三区| 在线观看不卡视频| 成人一区二区三区视频在线观看| 午夜电影一区二区| 综合自拍亚洲综合图不卡区| 欧美xxxx在线观看| 欧美人妖巨大在线| 91麻豆精东视频| 国产乱码精品一区二区三区五月婷 | 欧美色欧美亚洲另类二区| 国产成人av网站| 免费欧美日韩国产三级电影| 一二三区精品视频| 国产欧美日韩另类一区| 日韩欧美成人午夜| 56国语精品自产拍在线观看|