资源简介
这是一个closed-form 抠图算法,有界面,在matlab2011b下写的,可以扣灰度图和才速度,注意图像大小为400*400
代码片段和文件信息
%%
filename=cell(16); %文件名字的类型是cell类型,6个
filename(1)={‘平口刀001.tif‘};%source gray image name
filename(2)={‘平口刀002.tif‘};%image size3499*3677
filename(3)={‘平口刀003.tif‘};%三角刀三角刀口刀
filename(4)={‘平口刀004.tif‘};
filename(5)={‘平口刀005.tif‘};
filename(6)={‘平口刀006.tif‘};
%%
partdir(1)={‘平口刀001\‘};%三角刀三角刀三角刀
partdir(2)={‘平口刀002\‘};
partdir(3)={‘平口刀003\‘};
partdir(4)={‘平口刀004\‘};
partdir(5)={‘平口刀005\‘};
partdir(6)={‘平口刀006\‘};%三角刀三角刀三角刀三角刀面
%%
s_row=700; %三角刀三角刀三角刀三角刀定为400*400
s_column=700;
%%
for vv=1:6
PathPart=[‘F:\WoodCutHand\img\‘partdir{vv}‘Part\‘] ; %part parth
img=imread([‘F:\WoodCutHand\SourceGrayImage\‘filename{vv}]);%source gray image path
[rowcol]=size(img);
%三角刀三角刀三角刀三角刀三角刀三角刀三角刀三角刀三角刀所示
% 1 10 17
% 2 11 18
% 3 12 19
% 4 13 20
% 5 14 21
% 8 15 22
% 9 16 23 三角刀三角刀s_row和s_column三角刀三角刀
%三角刀三角刀三角刀三角刀三角刀三角刀三角刀三角刀三角刀三角刀的,
tmpcol=col;
a=1;%the filename begin with 1
while(1)%colo以s_column的步长进行递减>>>>>>>>>>>>>>>>>>>>>>>>>>the direcatioanry
if tmpcol-s_column>0%here we set image size is 400*400
%%这里开始的最左边几列进行拆分的数据,
temprow=row;%inithal the vale of the row
while(1)%这里的while是控制row的增加
if temprow-s_row>0%图像的高度和宽度都等于s_row和s_colomn
tmpimg=img(row-temprow+1:row-temprow+s_rowcol-tmpcol+1:col-tmpcol+s_column);
imwrite(tmpimg[PathPartnum2str(a)‘.bmp‘]); %here write part combine alpha image
a=a+1;
temprow=temprow-s_row;
else%高度不够s_row的高度,
tmpimg=img(row-temprow+1:rowcol-tmpcol+1:col-tmpcol+s_column);
imwrite(tmpimg[PathPartnum2str(a)‘.bmp‘]);
a=a+1; %最后一个块,不需要再减了
break;%结束这里的while循环,
end;%when the first big col is finish
end;% end of while row search
tmpcol=tmpcol-s_column;
%%最左边s_width倍数整数列拆分结束
else%image width is less than 400only one coloum
%从这里开始,最后的一列的数据
%最后一列的数据因为是不够s_width的宽度,
%在这里所有的数据都需要进行才分
%最后一列的拆分,一定是小雨s_width但是高度是保持不变的
%%
temprow=row;%recover the row of the image
while(1)%这里的while是控制row的增加
if temprow-s_row>0%图像的宽度不够s_colomun的宽度,高度等于s_row
tmpimg=img(row-temprow+1:row-temprow+s_rowcol-tmpcol+1:col);
imwrite(tmpimg[PathPartnum2str(a)‘.bmp‘]); %here write part combine alpha image
a=a+1;
temprow=temprow-s_row;
else%高度和宽度都不够s_row和s_columun,
tmpimg=img(row-tmpcol+1:rowcol-tmpcol+1:col);
imwrite(tmpimg[PathPartnum2str(a)‘.bmp‘]);
break;%结束这里的while的循环,跳到else循环的结构中
end;%when the first big col is finish
end;% end of while row search
break;%这里结束整个else的循环,结束了一幅图像的拆分
%%最后几列拆分结束
end;%结束最后一列的数据,和if相对应
end;%一幅图像拆分结束,进入下一次循环进行检测下一幅图像,和while(1)对应
end;%结束对每
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-12-06 21:51 Closed Form Matting 抠图软件-matlab2011b界面\
目录 0 2012-12-06 21:51 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\
目录 0 2012-12-06 21:51 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\+miscFns\
文件 416 2011-07-30 22:58 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\+miscFns\extractDirName.m
文件 407 2011-07-30 22:58 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\+miscFns\extractDirPath.m
目录 0 2012-12-06 21:51 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\@uidata\
文件 1413 2012-06-15 15:31 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\@uidata\uidata.m
文件 2666 2012-12-06 21:55 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\README
文件 4540 2012-10-22 16:15 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\allmatting.m
文件 412 2012-10-22 20:47 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\autoMatting.m
文件 394 2012-10-28 22:52 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\autoMatting2.m
文件 6089 2012-10-29 11:20 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\comparePA.m
文件 300 2006-04-20 15:59 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\downSmpIm.m
文件 2146 2006-04-20 16:23 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\getGMatByMask.m
文件 1709 2012-10-28 22:52 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\getLaplacian.m
文件 2869 2012-07-26 15:14 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\getLaplacian1.m
文件 1192 2006-04-20 17:09 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\getLinearCoeff.m
文件 137 2006-04-20 16:30 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\imIndexToVect.m
文件 274 2012-10-14 15:55 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\solveAlpha.m
文件 904 2012-07-26 15:54 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\solveAlphaC2F.m
文件 1112 2006-04-20 17:40 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\solveFB.m
文件 236 2012-10-29 22:42 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\test.m
文件 10157 2012-12-02 18:19 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\ui.fig
文件 25448 2012-12-06 10:55 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\ui.m
文件 267 2006-04-20 15:59 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\upSampleAlphaUsingImg.m
文件 1056 2006-04-20 17:51 Closed Form Matting 抠图软件-matlab2011b界面\ClosedMatting\upSmpIm.m
文件 3522 2012-12-03 19:34 Closed Form Matting 抠图软件-matlab2011b界面\CreatePart.m
文件 2002 2012-12-06 10:06 Closed Form Matting 抠图软件-matlab2011b界面\RecoverImg.m
文件 2290 2012-11-29 23:50 Closed Form Matting 抠图软件-matlab2011b界面\RecoverImgR.m
文件 52034 2012-11-29 17:21 Closed Form Matting 抠图软件-matlab2011b界面\图像分块说明文档.docx
相关资源
- matlab批量抠图
-
Matlab code of IEEE 802.15.4 MAC la
yer Perf - matlab开发-Xfoilformatlab
- 两幅图像的互信息的matlab代码
- 分数阶傅里叶变换fractional fourier tra
- Nonsubsampled Contourlet Transform 非下采样
- beamforming basicm mattlab 波束成形经典算
- knn matting 国外写的knn-matting
- 基于互信息的图像配准+棋盘格显示配
- 常规波束形成 matl
- 剪切波变换 (shearlet transform)
- random-hough-transform 利用随机霍夫变换进
- passage-3 本程序是mazen.O的经典论文:
- mimo radar OFDM Chirp waveform design 产生OF
- Shearlet_transform 基于多尺度几何分析的
- imageCorrectForm 建立几何畸变模型
- ridgelet_transform 一个用于图像描述表示
- spectralMattingCode 用于数字抠图的源代码
- beamformer 基于自适应天线阵理论
- matting 图像抠图是将图像的目标物体从
- softmatting 本文提出了一个关于图像抠
- Bayes-Matting 抠图中最为经典和基本的算
- Stationary-wavelet-transform
- A-Multi-UAV-Simulation-for-Formation 对无人机
- Tetrolet_Transform Tetrolet变换的原代码
- chirp-fourier-transform chirp fourier transfor
- Multi-agent-formation 可以实现多智能体编
- Wavelet_EntropyinformationLZC 脑电处理中
- Beamforming-Algorithm 目前最全的自适应波
- BEAMFORMING-Matlab 波束形成MATLAB程序
评论
共有 条评论