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

📄 sandboxscript.m

📁 Using the idea from Seam Carving for Content-Aware Image Resizing, the codes enables a selected im
💻 M
字号:
% Script file for experimenting with various seam functions
%
% Author: Danny Luong, 12/5/07

close all
clear all
X=imread('pagodas_small.jpg');
X=double(X)/255;
[rows cols dim]=size(X);

%get hsv image
Y=rgb2hsv(X);

%     figure(1)
%     imagesc(X)
%     axis equal

%find gradient image of luminance channel
E1=findEnergy(X);

    figure(2)
    imshow(E1)

%     
% E1=zeros(300,500);
% E1(120,:)=1;

%finds seam calculation image
S1=findSeamImg(E1);

    figure(4)
    imshow(S1,[min(S1(:)) max(S1(:))])

% Finds seam    
SeamVector=findSeam(S1);

%plot image with superimposed seam
SeamedImg=SeamPlot(E1,SeamVector);
    figure
    imshow(SeamedImg,[min(SeamedImg(:)) max(SeamedImg(:))])

%remove seam
SeamCutImg=SeamCut(X,SeamVector);

    figure
    imshow(SeamCutImg)

%find and remove N seams
M=removalMap(X,cols);
% MSeamedImg=SeamCut(X,M);
% figure
% imshow(MSeamedImg)

⌨️ 快捷键说明

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