⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showpyramid.m

📁 利用matlab实现彩色图像的分割。算法主要是利用聚类算法。
💻 M
字号:
function tower = showPyramid(pyr, distances)% M = SHOWPYRAMID(PYR) displays the multiscale pyramid of images% created by CREATEPYRAMID. PYR is an MxNx3xL matrix containing the% LAB values for the L levels in the pyramid and distances contains% the L distances.%% Jeff Walters & Angi Chau% Feb 2003% pyr is height x width x 3 x evels[h,w,c,levels] = size(pyr);% we need the whitepoint to convert from LAB spaceRGB_WHITE = [1 1 1]';whiteXYZ = changeColorSpace(RGB_WHITE, cmatrix('rgb2xyz'));% white point always has Y=100whiteXYZ = whiteXYZ./whiteXYZ(2)*100;load displayGamma;figure;for ind=1:levels    subplot(levels,1,ind);        % convert from lab values to RGB values    thisXYZ = lab2xyz(pyr(:,:,:,ind), whiteXYZ);    imgLinearRGB = changeColorSpace(thisXYZ, cmatrix('xyz2rgb'));        % correct for silly RGB values%     indices = find(imgLinearRGB < 0);%     imgLinearRGB(indices) = 0;%     indices = find(imgLinearRGB>1);%     imgLinearRGB(indices) = 1;    % gamma correct for monitor    imgRGB = dac2rgb(imgLinearRGB,invGamma);        % display    imagesc(imgRGB./255);    axis image;    axis off;    title(sprintf('distance=%d',distances(ind)));end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -