Error using bitxor Inputs must be signed or unsigned integers of the same class or scalar doubles.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
CODE:
info = dicominfo('brain_001.dcm');
t = dicomread(info);
figure(4)
imshow(t,[]);
title('ORIGINAL IMAGE')
p=randi([0 65536],256,256);
c=int16(p);
[a1,a2]=size(t);
for i=1:a1 %ENCRYPTION
for j=1:a2
x(i,j)=bitxor(t(i,j),c(i,j));
Error occurred:
Error using bitxor
Inputs must be signed or unsigned integers of the same class or scalar doubles.
Error in RDHEDIBSBDE (line 14)
x(i,j)=bitxor(t(i,j),c(i,j));
1 commentaire
Walter Roberson
le 8 Mai 2021
What is class(t)?
Warning: randi 0 65536 is a span of 65537 values. You then int16 the values but int16 can only store -32768 to +32767 and half of your values are above that.
Réponses (0)
Voir également
Catégories
En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!