I am to doing some masking.
I am trying to move a matrix(B) of undefine size could be any MxM on a larger matrix (A).
For example I have 10 by 10 matrix(B) fill with zeros and i want to move this matrix through out Matrix(A) 1000x1000.
This matrix(A) 1000X1000 is a binary matrix that have circles represented by 0.
I am stuck on how to do this nested for loops to make this movement, and how to find out one if the circles in matrix(A) overlaps with the matrix(B) if dont know what side this Matrix B will be after computation.
can't use function such as
so far i have this set of steps:
g = rgb2gray(I);
for i=1:ROWS % find largest diameter
if temp >= d
if IB(I+u,j+v)==0 && B(r,c)==0
how to find the overlap??