sr-metric
sr-metric copied to clipboard
Error using horzcat : Dimensions of arrays being concatenated are not consistent.
Hello, I am encountering an error while using your script. However this error happens for only one image.
path = 'E:\Documents\TFE\Results\Set_14\LR_bic_x4\comic.png';
im=imread(path);
score=quality_predict(im);
This command returns the following error:
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Error in feature_all (line 32)
f3=[t1 t2 t3];
Error in quality_predict (line 8)
[f1,f2,f3]=feature_all(im);
Error in demo (line 9)
score=quality_predict(im);
It appears that the "t3" has a size of "15x1" and t1,t2 "25x1"
Do you have an idea how to correct this?
It seems that the problem occurs when the input image's size is too small. Consider the following lines of code:
col=im2col(im3,[5 5],'distinct');
t3=svd(col);
The im2col function will divide the image into 5x5 blocks, then rearrange them into a 25 x B matrix, where each column correspond to a block. And the svd function (which compute the singular value of the col
matrix) will return a M x 1 matrix, where M is the rank of the input matrix.
If the image size is too small, col
will return fewer than 25 columns, so t3
will have fewer than 25 rows (which lead to the concatenation error)