Matlab - Analisis de imagenes

   
Vista:

Analisis de imagenes

Publicado por David (1 intervención) el 13/11/2013 11:01:46
Hola,

Tengo este codigo matlab para analizar imagenes, pero no consigo refinar el problema. Tras ejecutarlo y analizar todas las imagenes aparece el siguiente error:

Undefined function 'my_ndims' for input arguments of type 'double'.

Error in func_compare (line 15)
if my_ndims(data{1}) == 2 % necessary for power spectra

Error in AnalyseImages (line 36)
func_compare(all_images, 'sd', nbins);



QUE PUEDO HACER?
Muchas gracias.


CODIGO MATLAB_________________________________


%% Load image data.
clear all; close all;
addpath('functions');

main_path = 'C:\Users\GarciaBu\Documents\MATLAB\Images_food\matlabcode_for_image_analysis\databaseExt\';
all_images = dir([main_path '*.jpg']);


for i = 1:length(all_images)
all_images(i).path = main_path;

[path, this_file, ext] = fileparts([main_path all_images(i).name]);
if str2num(this_file) < 1000
all_images(i).isFood = true;
else
all_images(i).isFood = false;
end

index(i) = str2num(this_file);
end

% Matlab's dir command does not list file names properly in numerical
% order. Use SORT to make sure that image number X corresponds to filename
% X.jpg.
[y,sortindex] = sort(index);
all_images = all_images(sortindex);

%% Run all analyses. Results will be stored in the all_images structure.
all_images = func_runanalysis(all_images);

%% Compare the distributions of food and non-food images. Instead of 'sd',
% you can also enter any of the image features that are computed by
% func_runanalysis. A Wilcoxon test is used for testing if food/non food
% images have different distributions.
nbins = 32;
func_compare(all_images, 'sd', nbins);

% Show the most extreme images for a sanity check. Again, you can do this
% for any feature computed by func_runanalysis.
func_plotexemplarpics(all_images, 'red', 0);
func_plotexemplarpics(all_images, 'norm_complexity', 1);

%% Write results to Excel
excel_matrix = {...
all_images.name;...
all_images.isFood;...
all_images.red;...
all_images.green;...
all_images.blue;...
all_images.objectsize;...
all_images.intensity;...
all_images.sd;...
all_images.complexity;...
all_images.norm_complexity;...
all_images.medianpow;...
}';
xlswrite('Results', excel_matrix)
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
información
Otras secciones de LWP con contenido de Matlab
- Código fuente de Matlab
- Cursos de Matlab
- Temas de Matlab
- Chat de Matlab
información
Códigos de Matlab
- Fixed Pivot
- Elige una carta
- DÍAS DE LA SEMANA