Hi, I am a beginner in Matlab, I try to read my picture that I cropped with paint and convert it to double, and I obtain:
135x194x3 double with
sans=double(imread('aft2.jpg'));
I want to use it with the function normxcorr2, and I have the error message:
Error using normxcorr2Expected input number 1, T, to be two-dimensional.
Then, I try to convert it with rgb2gray to eliminate the "x3" :
sans=rgb2gray(double(imread('aft2.jpg')));
but it gives me 135×194 double of 1. (my matrix is only composed of the value 1). I obtain this error message:
The values of TEMPLATE cannot all be the same.
So I tried to change my line :
sans=double(rgb2gray(imread('aft2.jpg')));
and it seems that it is working but I dont understand why and what is the difference if I invert rgb2gray and double.
Thank you for your help Aude
Best Answer