How to Find Bit Error Rate for an Image?

조회 수: 24 (최근 30일)
ahmed alshammari
ahmed alshammari 2012년 4월 5일
편집: Walter Roberson 2020년 6월 12일
I am working in a project and I do not know how to get the BER between my orignal image and the one received.
so basically If do this
A=imread('m.jpg)
B=imread('m.jpg)
(n,R)=biterr(a,b)
I should get zero ber but this method is not working for me and i am getting an error message. Can somebody help please.
Thanks
  댓글 수: 4
Walter Roberson
Walter Roberson 2012년 4월 10일
편집: Walter Roberson 2020년 6월 12일
Actually biterr() *is* a MATLAB function
You need to tell us what the error message is.
Please also tell us class(A), class(B), size(A), size(B)
ahmed alshammari
ahmed alshammari 2012년 4월 10일
??? Error using ==> de2bi at 159
Specified number of columns must be scalar.
Error in ==> biterr>toBinary at 299
b = de2bi(a(:), num_bits);
Error in ==> biterr at 216
a2 = toBinary(a, num_bits);
Error in ==> untitled2 at 6
[n,R]=biterr(a,b);
I do not have the first three commands in my code I do not know where matlab brought them from. and the pictures are same size because they are the same <540*720*3 unit8>. Please help me if you know any other way to find bit error rate for 2 similar jpg images.

댓글을 달려면 로그인하십시오.

답변 (1개)

Tasos Giannoulis
Tasos Giannoulis 2017년 1월 27일
You are receiving this error because your inputs are 3-dimensional, while BITERR works at most with 2-D data.
More important, BITERR works with the equivalent binary representation. For example,
>> biterr(8, 7)
ans =
4
because 8 = 1000 and 7 = 0111, therefore all 4 bits are different.
Is this what you want? Or do you want to count the number of "pixels" that are different? If your goal is the latter, then you can use this code:
>> sum( sum( A ~= B ) ) / numel(A)
which counts the number of differing numbers and calculates their ratio.
  댓글 수: 1
ARUN SANKARAN
ARUN SANKARAN 2020년 6월 9일
Can u send me the complete codes ?
Thx you...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Test and Measurement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by