91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 7KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-29
  • 語言: Matlab
  • 標簽: matlab??

資源簡介

mathwork上的有關廣義霍夫變換學習的代碼,其中的輸入變量需要自己更改。

資源截圖

代碼片段和文件信息

function?[score??y?x?]?=?Generalized_hough_transform(IsItm)?
%Find?template/shape?Itm?in?greyscale?image?Is?using?generalize?hough?trasform

%Use?generalized?hough?transform?to?find?Template/shape?binary?image?given?in?binary?image?Itm?in?grayscale?image?Is?(greyscale?image)

%Is?is?greyscale??picture?were?the?template?Itm?should?be?found?
%Itm?is?bool?edge?image?of?the?template?with?edges?markedd?ones
%Return?the?xy?location??cordniates??which?gave?the?best?match?
%Also?return?the?score?of?each?this?point?(number?of?point?matching)

%The?xy?are?the?cordinates?in?image?Is?in?which?the??the?top?left?edge?of?image?Itm?(11)?should?be?positioned?in?order?to?give?the?best?match

%Is=imread(‘‘);
%Itm=imread(‘‘);
%if?nargin<3?thresh=1;end;

%--------------------------create?edge?and?system?edge?images------------------------------------------------------------------------------------------------------------------------

%Is=rgb2gray(Is);

Iedg=edge(Is‘canny‘);?%?Take?canny?edge?images?of?Is?with?automatic?threshold
%}
%--------------------------------------------------------------------------------------------------------------------------------------
[y?x]=find(Itm>0);?%?find?all?yx?cordinates?of?all?points?equal?1?inbinary?template?image?Itm
nvs=size(x);%?number?of?points?in?the??template?image
%-------------------Define?Yc?and?Xc?----------------------------------------------
Cy=1;%round(mean(y));%?find?object?y?center?note?that?any?reference?point?will?do?so?the?origin?of?axis?hence?1?could?be?used?just?as?well
Cx=1;%round(mean(x));%?find?object?z?center?note?that?any?reference?point?will?do?so?the?origin?of?axis?hence?1?could?be?used?just?as?well

%------------------------------create?gradient?map?of?Itm?distrobotion?between?zero?to?pi?%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GradientMap?=?gradient_direction(?Itm?);

%%%%%%%%%%%%%%%%%%%%%%%Create?an?R-Table?of?Itm?gradients?to??parameter?space?in?parameter?space.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%---------------------------create?template?descriptor?array------------------------------------
MaxAngelsBins=30;%?devide?the?angel?space?to?MaxAngelsBins?uniformed?space?bins
MaxPointsPerangel=nvs(1);%?maximal?amount?of?points?corresponding?to?specific?angel

PointCounter=zeros(MaxAngelsBins);%?counter?for?the?amount?of?edge?points?associate?with?each?angel?gradient
Rtable=zeros(MaxAngelsBinsMaxPointsPerangel2);?%?assume?maximum?of?100?points?per?angle?with?MaxAngelsBins?angles?bins?between?zero?and?pi?and?xy?for?the?vector?to?the?center?of?each?point
%?the?third?adimension?are?vector?from?the?point?to?the?center?of?the?vessel

%------------------fill?the??angel?bins?with?points?in?the?Rtable---------------------------------------------------------
for?f=1:1:nvs(1)
????bin=round((GradientMap(y(f)?x(f))/pi)*(MaxAngelsBins-1))+1;?%?transform?from?continues?gradient?angles?to?discrete?angle?bins?and?
????PointCounter(bin)=PointCounter

評論

共有 條評論