资源简介
纹理图像分割算法,即把一张纹理图像分割成许多样本,然后利用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
相关资源
- 基于MFC扩展CListCtrl子项显示图片并叠
- img写盘工具(roadkil‘s diskimage) v1.
- cximage的linux版本源码
- Cocos2d-x 3.x 头像选择器功能扩展Image
- PCNN TOOLBOX
- 双立方插值实现
- 图像处理 分析与机器视觉 源码
- 脉冲耦合神经网络工具箱PCNN-toolbox
- Image2Lcd+汉字取模,TFT助手
- PNG图片转Delphi中Image.Picture.data代码-工
- CImage 强大的图像处理类库
- 微软内部镜像封装工具:CDIMAGE 2.54 (版
- Modeling of rapeseed at maturity stage using 3
- ImageWatch2019.vsix
- Image Resizer
- swift-PSImageEditors一个简而至美的图片编
- ImageConverter(万能图片转换器)2009免
- ZedBoard REV_D的BOOT.BIN、devicetree.dtb、l
- Image Super-Resolution Via Sparse Representati
- Qt Openglwidget 显示图片纹理贴图
- 2-d and 3-d Image Registration: for Medical Re
- Universalimageloader
- stb_image库
- Markov random fields for vision and image proc
- 《图像分析中的马尔可夫随机场模型
- NeatImagePS MAC
- 实验三 ImageView和Switch的使用
- HDR_Code_Image.rar for opencv
- 数字空间中数学形态学——理论及应
- Digital.Image.Processing.4th.Edition.pdf part1
评论
共有 条评论