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

資源簡介

通過鼠標選擇所需檢測點,然后將離檢測點最近的外邊緣框出。

資源截圖

代碼片段和文件信息

clear?all
I?=?imread(‘1.jpg‘);
im?=?rgb2gray(I);
figure(1)

imshow(I‘border‘‘tight‘‘initialmagnification‘‘fit‘);

axis?normal

%?x=800;y=1000;
[yxbutton]?=?ginput(1);

thresh?=?graythresh(im);
im2?=?im2bw(imthresh);

im?=?double(im);
u?=?(im/thresh).^2;
ft?=?find(im>thresh);
ma?=?max(im(:));
u(ft)?=?((ma-im(ft))/(ma-thresh)).^2;
%?imshow(uint8(im));
r?=?4;
temp?=?u;
[hl]?=?size(im);
uc?=?0.99;

if?r>=2
????for?k?=?1:r
???????for?i?=?1:h
??????????for?j?=?1:l
?????????????if?temp(ij)?<=?uc
?????????????????temp(ij)?=?temp(ij).^2/uc;
?????????????else
?????????????????temp(ij)?=?1-(1-temp(ij).^2)/(1-uc);
?????????????end
??????????end
???????end
????end
end
X1?=?thresh*sqrt(temp);
X1(ft)?=?ma-sqrt(temp(ft))*(ma-thresh);
X2?=?X1-min(X1(:));
f?=?edge(uint8(X2)‘canny‘);
f?=?imfill(f‘hole‘);
str?=?strel(‘disk‘5);
ima?=?imdilate(fstr);
ima?=?imerode(imastr);
ima?=?bwareaopen(ima300);

x?=?fix(x);
y?=?fix(y);
if(ima(xy)==0)
????ima?=?~ima;
end
[Lm]=?bwlabel(ima8);
ima_temp?=?zeros(hl);
mm?=?L(xy);

ft?=?find(L==mm);
ima_temp(ft)?=?1;

ima_temp?=?imfill(ima_temp‘hole‘);
xx?=?bwperim(ima_temp);
count?=?0;
xi?=?cell(1);
yi?=?cell(1);
for?i=1:h
????for?j=1:l
????????if?xx(ij)==1;
????????????count?=?count+1;
????????????xi{1}(count)?=?i;
????????????yi{1}(count)?=?j;
????????end
????end
end
xx?=?xi{1}(:);
yy?=?yi{1}(:);
imshow(I);
hold?on
%?xx?=?[xx(:);xx(1)];
plot([yy;yy(1)][xx;xx(1)]‘.r‘)
%?????if?m~=0
%?????for?ii=1:m
%?????????rectangle(‘position‘status(ii).BoundingBox‘edgecolor‘‘r‘);
%?????end?
%?????end
%?for?i?=?1:500
%?????rectangle(‘Position‘[x-i/2y-i/2ii]‘curvature‘[00]‘edgecolor‘‘r‘);
%?end
%?px?=?fix(x);
%?py_but?=?fix(y);
%?py_top?=?fix(y);
%?while(1)
%????if?f(pxpy_top)~=1
%????????py_top?=?py_top-1;
%????elseif?py_top?==0
%????????break;
%????else
%????????break;
%????end
%?end
%?while(1)
%????if?f(pxpy_but)~=1
%????????py_but?=?py_but-1;
%????elseif?py_but?==l
%????????break;
%????else
%????????break;
%????end
%?end
%?figure(1)
%?imshow(ima);
%?hold?on
%?
%?plot(py_toppy_but‘r‘);
%?a=cell(1);
%?b?=cell(1);
%?count?=?1;
%?ed=[-1?-1;0?-1;1?-1;1?0;1?1;0?1;-1?1;-1?0];?%從左上角像素,逆時針搜索
%?imgn=zeros(hl);????????%邊界標記圖像
%?imgn(pxpy)?=?2;
%?while(1)
%?????a{1}(count)?=?px;
%?????b{1}(count)?=?py;
%?????
%?????for?k?=?1:8
%????????tmpi?=?a{1}(count)+ed(k1);????????%八鄰域臨時坐標
%????????tmpj?=?b{1}(count)+ed(k2);?
%????????if?f
%?????end
%?????count?=?count+1;
%?end

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????384520??2016-01-21?10:19??1.jpg
?????文件??????429044??2016-01-21?10:20??10.jpg
?????文件??????239889??2016-01-21?10:19??3.jpg
?????文件??????239889??2016-01-21?10:19??5.jpg
?????文件??????223057??2016-01-21?10:20??6.jpg
?????文件??????384520??2016-01-21?10:20??9.jpg
?????文件????????2468??2016-02-27?09:26??bianyuan.m

評論

共有 條評論