How can I use indexed image in neural network ?

4 vues (au cours des 30 derniers jours)
jawad ashraf
jawad ashraf le 11 Août 2018
Commenté : Walter Roberson le 30 Août 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 commentaires
Walter Roberson
Walter Roberson le 12 Août 2018
displayData does not appear to be a Mathworks routine, and also does not appear to be part of the File Exchange.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 12 Août 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 commentaires
jawad ashraf
jawad ashraf le 29 Août 2018
I am following the code of Andrew NGs assignment 3 and 4
Walter Roberson
Walter Roberson le 30 Août 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)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Modify Image Colors dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by