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

📄 image_to_matrix.m

📁 kmeans clustering in matlab
💻 M
字号:
function [imatrix, index] = image_to_matrix(data)%% converts an array structure of the form data(:,:).image% to an n x d matrix, where each row is a raster-vector% representation of data(:,:).image.[m n] = size(data);[nx ny] = size(data(1,1).image);
count = 1;
for i=1:m   for j=1:n      [inx iny] = size(data(i,j).image);      if inx==nx & iny==ny            imatrix(count,:) = reshape(data(i,j).image, 1, nx*ny);            index(count,1) = i;            index(count,2) = j;            count = count + 1;    	end               endend
fprintf('%d images in total\n',count-1);

⌨️ 快捷键说明

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