资源简介
纹理图像分割算法,即把一张纹理图像分割成许多样本,然后利用imagequilting算法,重新生成另一张纹理图像,这样可以求出样本的平均值进行排序,直接运行程序 imagequilt.m 即可看到效果
代码片段和文件信息
%function Y = imagequilt(X tilesize n overlap err)
%Performs the Efros/Freeman Image quilting algorithm on the input
%
%Inputs
% X: The source image to be used in synthesis
% tilesize: the dimensions of each square tile. Should divide size(X) evenly
% n: The number of tiles to be placed in the output image in each dimension
% overlap: The amount of overlap to allow between pixels (def: 1/6 tilesize)
% err: used when computing list of compatible tiles (def: 0.1)
function Y = imagequilt()
X = imread(‘bamboo.tif‘);X = double(X);
tilesize=10;
n=20;
overlap=3;
err=0.1;
if( length(size(X)) == 2 )
X = repmat(X [1 1 3]);%make X into 3 channels
elseif( length(size(X)) ~= 3 )
error(‘Input image must be 2 or 3 dimensional‘);
end;
simple = 0;
if( nargin < 5 )
err = 0.002;
end;
if( nargin < 4 )
overlap = round(tilesize / 4);
end;
% if( size(X1) ~= size(X2) )
% error(‘Must be square‘);
% end;
if( overlap >= tilesize )
error(‘Overlap must be less than tilesize‘);
end;
destsize = n * tilesize - (n-1) * overlap % the destination image‘s col number
Y = zeros(destsize destsize 3);
for i=1:n
for j=1:n
startI = (i-1)*tilesize - (i-1) * overlap + 1;
startJ = (j-1)*tilesize - (j-1) * overlap + 1;
endI = startI + tilesize -1;
endJ = startJ + tilesize -1;
%Determine the distances from each tile to the overlap region
%This will eventually be replaced with convolutions
distances = zeros( size(X1)-tilesize size(X2)-tilesize );
useconv = 0;
if( useconv == 0 )
%Compute the distances from the template to target for all ij
for a = 1:size(distances1)
v1 = Y(startI:endI startJ:endJ 1:3);
for b = 1:size(distances2)
v2 = X(a:a+tilesize-1b:b+tilesize-1 1:3);
distances(ab) = myssd( double((v1(:) > 0)) .* (v1(:) - v2(:)) );
%distances(ab) = D;
end;
end;
else
%Compute the distances from the source to the left overlap region
if( j > 1 )
distances = ssd( X Y(startI:endI startJ:startJ+overlap-1 1:3) );
distances = distances(1:end 1:end-tilesize+overlap);
end;
%Compute the distance from the source to top overlap region
if( i > 1 )
Z = ssd( X Y(startI:startI+overlap-1 startJ:endJ 1:3) );
Z = Z(1:end-tilesize+overlap 1:end);
if( j > 1 ) distances = distances + Z;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6466 2015-12-04 15:50 1.jpg
文件 19254 2013-06-07 17:11 bamboo.tif
文件 6796 2015-12-04 15:50 flower.jpg
文件 6555 2016-04-08 16:21 imagequilt.m
文件 1588 2013-06-07 17:11 mincut.m
文件 9009131 2013-06-07 17:11 quilting.pdf
文件 61830 2016-05-14 21:19 result.bmp
文件 632 2013-06-07 17:11 ssd.m
文件 45218 2016-05-14 21:19 Y.mat
文件 105 2016-04-09 09:30 要求.txt
----------- --------- ---------- ----- ----
9157575 10
- 上一篇:真题试卷1999-2018(无2012).rar
- 下一篇:网站视频破解工具.rar
相关资源
- pread_image_data.rar
- Image processing and analysis variational PDE
- 荔枝派Nano可用RNDIS的4.19 linux内核版本
- 飞机大战图片素材包呀.rar
- IrfanView插件 CADImage 已注册无水印授权
- 图像融合算法大全 image fusion
- CXImage 类库
- ImageJ安装学习资料
- 经典的图像修复代码 Inpainting
- 图像配准的一本好书:我已经从头到
- 相关系数法影像匹配
- 使用Imageloader加载bmob上的图片
- GPUImage多种滤镜的使用示范以及美颜滤
- Statck_image.zip
- 原文+代码DnCNN for Image Denoising
- VS2010 用CxImage读入各种图片格式后在内
- ImageMagick-6.3.6-6-Q16-windows-dll.exe
- 运动历史图motion history image,MHI
- Poisson Image Editing泊淞图像编辑论文原
- 0k6410B的zImage
- FreeImage图形库说明文档(中文版+英文
- mui图片预览Dome.rar
- Image Mastering API 2 for Windows xp Vista W
- ImageWatch-VS2013.vsix
- guided image filting
- creating Capsule Wardrobes from Fashion Images
- Image_Processing_with_ImageJ,_Second_Edition
-
ImageRegistrationba
sedonSIFT.rar - 混合图像Exp1_Hybrid_Images
- image caption 实现keras
评论
共有 条评论