How can I use indexed image in neural network ?
조회 수: 4 (최근 30일)
이전 댓글 표시
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
Walter Roberson
2018년 8월 12일
displayData does not appear to be a Mathworks routine, and also does not appear to be part of the File Exchange.
Walter Roberson
2018년 8월 12일
채택된 답변
Walter Roberson
2018년 8월 12일
"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
Walter Roberson
2018년 8월 30일
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)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Modify Image Colors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!