I have a statement trying to implement but confused on how to do so. This is my issue:
- I have an image where I have set some pixels of interest (region of interest) to the value
1
. So, we can say that we now have a set with the following values1s
where each1
here represents a particular location in the image.
C = [1 1 1 1 1 1 1 1 1 1];
For example, say img
for simplicity here is the matrix x
as follows:
x = [2 3 5; 5 4 5; 6 4 3; 6 5 4; 6 54 3; 6 5 3];
x
will have a degree of membership y
based on which we set some values to 1
. To clarify, for each pixel for which y
= 1
we set that pixel to 1
. So, let's say y
is:
y = [0 1 0; 0 1 1; 1 1 0; 0 0 1; 0 0 1; 1 1 1];
So, C
contains 10 1s
. For instance the first 1
represents the location x(1,2)
and so forth...
Now, I want to check the
4-neighbourhoods
of the pixels inC
but that at the same time not inC
. That is, on the surroundings.Now, for those pixels that belong to the surroundings and are four neighbors of
C
I want to select that pixelp
that minimizes the distance betweenx
andC
.
Is it clear now? Do you know how I can go around it?
Thanks.