Mostra commenti meno recenti
For Image Quality Parameters I need to find NPCR for 2 images after encryption whose original image have 1 pixel difference. The code is:
% For Grayscale Jpeg Images
C=Cipher Image
C2c=Cipher Image after 1 Pixel difference in Original Image.
siz=M*M;
NPCR=0;
SSS=0;
for i=1:M
for j=1:M
if (C2(i,j)==C2c(i,j))
SSS=SSS;
else
SSS=SSS+1;
end
end
end
SSS=SSS/siz;
NPCR=SSS*100;
I get NPCR value=0.0015. Is my code not OK or the method for Cipher image. I should get a value around 99.67%
Suggest any solutions or error
4 Commenti
Renjith V Ravi
il 29 Dic 2016
I think the NPCR equation is wrong in your code
majed samir
il 1 Gen 2017
Modificato: Walter Roberson
il 1 Gen 2017
SSS=SSS/siz;
error
true is
SSS=siz/(siz+1)
LOKESH
il 6 Giu 2018
Parveiz Lone
il 12 Mag 2020
%% 3. NCPR score and p_value
npcr_score = sum( double( img_a(:) ~= img_b(:) ) ) / num_of_pix;
npcr_mu = ( largest_allowed_val ) / ( largest_allowed_val+ 1 );
npcr_var = ( ( largest_allowed_val) / ( largest_allowed_val+ 1 )^2 ) / num_of_pix;
npcr_pVal = normcdf(npcr_score, npcr_mu, sqrt( npcr_var ) );
npcr_dist = [ npcr_mu, npcr_var ];
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Encryption / Cryptography in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!