Why is my array in MATLAB saturated with a value of 255?

This is my code:

arr = zeros(fx-10,1);
frm = frams(x).cdata;
for k=1:fx-10
    for i=1:10
        for j=1:fy
            arr(k) = arr(k)+ abs(frm(k+i-1,j)-model(i,j))
        end
    end
end

Why does an array get only up to 255 values?

I am trying to determine:

 arr = zeros(fx-10,1,'int64');

and code failure:

??? Undefined function or method 'plus' for input arguments of type 'Int64'.

+3
source share
1 answer

arr double, , , frm model, UINT8, 255. arr, , , double-to arr. UINT8 , 255.

, DOUBLE frm model, double before . - :

arr(k) = arr(k) + abs(double(frm(k+i-1,j))-double(model(i,j)));
+5

Source: https://habr.com/ru/post/1759134/


All Articles