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

📄 crop_images.m

📁 kmeans clustering in matlab
💻 M
字号:
function cropped_images = crop_images(images,x1,x2,y1,y2);
%
% function to take CS 175 data structure of images and to
% crop each image so that the lowerleft corner has
% coordinate [x1,y1] and the upper right corner has coordinate [x2,y2]


[n1 n2] = size(images);  % assumes that data structure is a 2d array

cropped_images = images;

for i=1:n1;
    for  j=1:n2;
        oldimage = images(i,j).image;
        if size(oldimage,1)>1
        cropped_images(i,j).image = oldimage(x1:x2,y1:y2);
        end
    end
end

⌨️ 快捷键说明

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