Error using containers.Map in matlab 2015a

1 visualizzazione (ultimi 30 giorni)
Rupok Kumar
Rupok Kumar il 15 Mag 2018
Commentato: Guillaume il 15 Mag 2018
I have got this error. Here i attached my code:
image = hdrread('Apartment_float_o15C.hdr');
[h,w,~] = size(image);
uint16_image = to_16_bit(image);
keys = unique(uint16_image);
[num_keys, ~] = size(keys);
values = (0:1:num_keys-1).';
map = containers.Map(keys, values);
inverse_map = containers.Map(values, keys);
%uint16_image_mapped = image2MappedImage(uint16_image, map);
%uint16_image_reversed = image2MappedImage(uint16_image_mapped, inverse_map);
image_mapped = to_single(uint16_image_mapped);
figure
histo = histogram(uint16_image,'BinWidth',1)
figure
mapped_histo = histogram(uint16_image_mapped,'BinWidth',1)
figure
reversed_histo = histogram(uint16_image_reversed,'BinWidth',1)
figure
imshow( tonemap(image_mapped), []);
result = image2MappedImage(uint16_image, map);
result = to_16_bit(image);
result = to_single(image);
result = getBinCounts(histo);
The error is here:
Error in hdr_OpenEXR_format (line 12)
map = containers.Map(keys, values);
can anyone help me out of this? Thanks in advance
  3 Commenti
Rupok Kumar
Rupok Kumar il 15 Mag 2018
Modificato: Rupok Kumar il 15 Mag 2018
It works in R2018a but not working in my version which is R2015a. The error shoes that:
Error using containers.Map
NaN-valued key is not allowed for this container.
Error in hdr_OpenEXR_format (line 12)
map = containers.Map(keys, values);
What i need to change, could you help me please?
Guillaume
Guillaume il 15 Mag 2018
What does
any(isnan(keys))
return?

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by