资源简介
KSVD OMP处理图像的程序,有效果演示
代码片段和文件信息
function I = displayDictionaryElementsAsImage(D numRows numColsXYsortVarFlag)
% function I = displayDictionaryElementsAsImage(D numRows numCols XY)
% displays the dictionary atoms as blocks. For activation the dictionary D
% should be given as also the number of rows (numRows) and columns
% (numCols) for the atoms to be displayed. X and Y are the dimensions of
% each atom.
borderSize = 1;
columnScanFlag = 1;
strechEachVecFlag = 1;
showImFlag = 1;
if (length(who(‘X‘))==0)
X = 8;
Y = 8;
end
if (length(who(‘sortVarFlag‘))==0)
sortVarFlag = 1;
end
numElems = size(D2);
if (length(who(‘numRows‘))==0)
numRows = floor(sqrt(numElems));
numCols = numRows;
end
if (length(who(‘strechEachVecFlag‘))==0)
strechEachVecFlag = 0;
end
if (length(who(‘showImFlag‘))==0)
showImFlag = 1;
end
%%% sort the elements if necessary.
%%% construct the image to display (I)
sizeForEachImage = sqrt(size(D1))+borderSize;
I = zeros(sizeForEachImage*numRows+borderSizesizeForEachImage*numCols+borderSize3);
%%% fill all this image in blue
I(::1) = 0;%min(min(D));
I(::2) = 0; %min(min(D));
I(::3) = 1; %max(max(D));
%%% now fill the image squares with the elements (in row scan or column
%%% scan).
if (strechEachVecFlag)
for counter = 1:size(D2)
D(:counter) = D(:counter)-min(D(:counter));
if (max(D(:counter)))
D(:counter) = D(:counter)./max(D(:counter));
end
end
end
if (sortVarFlag)
vars = var(D);
[Vindices] = sort(vars‘);
indices = fliplr(indices);
D = [D(:1:sortVarFlag-1)D(:indices+sortVarFlag-1)];
signs = sign(D(1:));
signs(find(signs==0)) = 1;
D = D.*repmat(signssize(D1)1);
D = D(:1:numRows*numCols);
end
counter=1;
for j = 1:numRows
for i = 1:numCols
% if (strechEachVecFlag)
% D(:counter) = D(:counter)-min(D(:counter));
% D(:counter) = D(:counter)./max(D(:counter));
% end
% if (columnScanFlag==1)
% I(borderSize+(i-1)*sizeForEachImage+1:i*sizeForEachImageborderSize+(j-1)*sizeForEachImage+1:j*sizeForEachImage1)=reshape(D(:counter)88);
% I(borderSize+(i-1)*sizeForEachImage+1:i*sizeForEachImageborderSize+(j-1)*sizeForEachImage+1:j*sizeForEachImage2)=reshape(D(:counter)88);
% I(borderSize+(i-1)*sizeForEachImage+1:i*sizeForEachImageborderSize+(j-1)*sizeForEachImage+1:j*sizeForEachImage3)=reshape(D(:counter)88);
% else
% Go in Column Scan:
I(borderSize+(j-1)*sizeForEachImage+1:j*sizeForEachImageborderSize+(i-1)*sizeForEachImage+1:i*sizeForEachImage1)=reshape(D(:counter)XY);
I(borderSize+(j-1)*sizeForEachImage+1:j*sizeForEachImageborderSize+(i-1)*sizeForEachImage+1:i*sizeForEachImage2)=reshape(D(:counter)XY);
I(borderSize+(j-1)*sizeForEachImage+1:j*sizeForEachImageborderSize+(i-1)*sizeFor
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 194172 2014-06-04 15:02 KSVD-OMP\Dictionary_peppers_sample5.mat
文件 3224 2007-01-25 08:39 KSVD-OMP\displayDictionaryElementsAsImage.m
文件 1357 2014-05-28 19:53 KSVD-OMP\KSVD.m
文件 954 2014-05-22 00:00 KSVD-OMP\OMP.m
文件 1083 2006-12-11 15:08 KSVD-OMP\OMPerr.m
目录 0 2014-06-08 16:49 KSVD-OMP
文件 185727 2014-06-02 21:26 KSVD-OMP\picturesample\barbara.png
文件 34985 2014-06-03 10:20 KSVD-OMP\picturesample\house.png
文件 719641 2014-05-12 23:44 KSVD-OMP\picturesample\lena.jpg
文件 40181 2014-06-03 10:10 KSVD-OMP\picturesample\peppers256.png
目录 0 2014-06-03 20:04 KSVD-OMP\picturesample
----------- --------- ---------- ----- ----
1181324 11
- 上一篇:研究自动导引车系统控制器设计与调度算法
- 下一篇:人工势场法的移动机器人路径规划
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论