How can I use indexed image in neural network ?

4 visualizaciones (últimos 30 días)
jawad ashraf
jawad ashraf el 11 de Ag. de 2018
Comentada: Walter Roberson el 30 de Ag. de 2018
I have converted RGB images into indexed images using function rgb2ind then I made their matrix and load it using the code
fprintf('Loading and Visualizing Data ...\n')
load('ClothingData.mat');
m = size(X, 1);
[sel] = randperm(size(X, 1)); % Randomly select 100 data points to display
sel = sel(1:100);
displayData(X(sel, :));
but it is throwing this error message
Warning: Size vector should be a
row vector with integer elements.
> In displayData at 30
In ex4 at 50
Error using reshape
Size arguments must be real
integers.
Please tell me how to fix this error, also can I use indexed images for neural network classification or not
  2 comentarios
Walter Roberson
Walter Roberson el 12 de Ag. de 2018
displayData does not appear to be a Mathworks routine, and also does not appear to be part of the File Exchange.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 12 de Ag. de 2018
"can I use indexed images for neural network classification or no"
Yes.
If you are doing pattern matching, you might even get a useful result. But don't expect anything useful even for pattern matching unless you passed a fixed colormap into rgb2ind(). And even in that case, if you did not do illumination correction, your results might be low quality.
  13 comentarios
jawad ashraf
jawad ashraf el 29 de Ag. de 2018
I am following the code of Andrew NGs assignment 3 and 4
Walter Roberson
Walter Roberson el 30 de Ag. de 2018
In order for the rgb2ind to be done consistently, you need to generate a colormap that you use for all of the images. For example you could pick one of the images and use
[first_ind_image, map] = rgb2ind(first_rgb_image);
and after that you would use
rgb2ind(other_image, map)
And then when you went to display, you would
colormap(map)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Modify Image Colors en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by