You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sir,
I downloaded the VLFEAT 0.9.17 package and wanted to learn LBP algorithem. I found there is a Matlab LBP test program in "vlfeat-0.9.17.tar\vlfeat-0.9.17\vlfeat-0.9.17\toolbox\xtest\vl_test_lbp.m". But the test result seems not correct.
In function "test_one_on"
function test_one_on()
I = {} ;
I{1} = [0 0 0 ; 0 0 1 ; 0 0 0] ;
I{2} = [0 0 0 ; 0 0 0 ; 0 0 1] ;
I{3} = [0 0 0 ; 0 0 0 ; 0 1 0] ;
I{4} = [0 0 0 ; 0 0 0 ; 1 0 0] ;
I{5} = [0 0 0 ; 1 0 0 ; 0 0 0] ;
I{6} = [1 0 0 ; 0 0 0 ; 0 0 0] ;
I{7} = [0 1 0 ; 0 0 0 ; 0 0 0] ;
I{8} = [0 0 1 ; 0 0 0 ; 0 0 0] ;
for j=0:7
h = vl_lbp(single(I{j+1}), 3) ;
h = find(squeeze(h))
vl_assert_equal(h, j * 7 + 1) ;
end
I found in vllbp.c, this LBP object is created with transposed feature. For input array [0 0 0 ; 0 0 1 ; 0 0 0] , it assume the LBP value equal to 1. Abviously, the LBP value before quantizaiton is 00000001b, if the matrix is transposed, the LBP value before quantization is 00000100. The LBP value after quantizaiton is 14 which is not consistent with your result.
Could you check it?
Thank you,.
Adam
The text was updated successfully, but these errors were encountered:
I checked the code and test file and they seem correct to me. Please note that the transposed feature is turned on because MATLAB stores images in column major format, whereas VLFeat expects them in row major. Hence to VLFeat the MATLAB image looks transposed.
Hi Andrea,
Thanks a lot for your clear explanation. It is the Matlab array transfer principle which cause my confusion.
It is clear now.
Best regards,
Adam
From: Andrea Vedaldi [mailto:notifications@github.com]
Sent: Thursday, January 09, 2014 3:10 AM
To: vlfeat/vlfeat
Cc: Yao, Adam
Subject: Re: [vlfeat] LBP unit test seems produce incorrect result (#34)
Dear Adam,
thank you your message.
I checked the code and test file and they seem correct to me. Please note that the transposed feature is turned on because MATLAB stores images in column major format, whereas VLFeat expects them in row major. Hence to VLFeat the MATLAB image looks transposed.
Best.,
Andrea
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/34#issuecomment-31866945.
Hi Sir,
I downloaded the VLFEAT 0.9.17 package and wanted to learn LBP algorithem. I found there is a Matlab LBP test program in "vlfeat-0.9.17.tar\vlfeat-0.9.17\vlfeat-0.9.17\toolbox\xtest\vl_test_lbp.m". But the test result seems not correct.
In function "test_one_on"
function test_one_on()
I = {} ;
I{1} = [0 0 0 ; 0 0 1 ; 0 0 0] ;
I{2} = [0 0 0 ; 0 0 0 ; 0 0 1] ;
I{3} = [0 0 0 ; 0 0 0 ; 0 1 0] ;
I{4} = [0 0 0 ; 0 0 0 ; 1 0 0] ;
I{5} = [0 0 0 ; 1 0 0 ; 0 0 0] ;
I{6} = [1 0 0 ; 0 0 0 ; 0 0 0] ;
I{7} = [0 1 0 ; 0 0 0 ; 0 0 0] ;
I{8} = [0 0 1 ; 0 0 0 ; 0 0 0] ;
for j=0:7
h = vl_lbp(single(I{j+1}), 3) ;
h = find(squeeze(h))
vl_assert_equal(h, j * 7 + 1) ;
end
I found in vllbp.c, this LBP object is created with transposed feature. For input array [0 0 0 ; 0 0 1 ; 0 0 0] , it assume the LBP value equal to 1. Abviously, the LBP value before quantizaiton is 00000001b, if the matrix is transposed, the LBP value before quantization is 00000100. The LBP value after quantizaiton is 14 which is not consistent with your result.
Could you check it?
Thank you,.
Adam
The text was updated successfully, but these errors were encountered: