Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using horzcat : Dimensions of arrays being concatenated are not consistent. #5

Open
MLDrago opened this issue Apr 19, 2021 · 1 comment

Comments

@MLDrago
Copy link

MLDrago commented Apr 19, 2021

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?
comic

@xuanquang1999
Copy link

xuanquang1999 commented Apr 22, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants