Would like to know how this code be vectorized:
for y=1:rows for x=1:cols if (segMat(y,x) == 255) Energy(y,x) = Energy(y,x) + motionMap(y,x); end endfor y=1:rows for x=1:cols delta(y,x) = kronDel(255, segMat(y,x)); endend
The kronDel function acts like the Kronecker delta.
Best Answer