Merge regions

12 visualizaciones (últimos 30 días)
Marlene
Marlene el 12 de En. de 2012
Hi, I want to merge two regions if they are close to each other and their average intensity is similar.
if (| y1-y2 | <T & | M2-M1 |<t)
statement to merge
end
But I do not know how to write the statement for the merger of regions. Anyone know?
  3 comentarios
Marlene
Marlene el 12 de En. de 2012
regions are white in a binary image representing objects.
Walter Roberson
Walter Roberson el 12 de En. de 2012
Suppose you had two squares separated by a modest distance, with one of the two a bit up and to the right of the other. What would you like the merged region to look like in that case?

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 12 de En. de 2012
Something like this perhaps???:
if (meanOfRegion1 - meanOfRegion2) < maxAllowableDifference
mergedMask = region1Mask & region2Mask; % Assumes binary images.
mergedImage = originalImage; % Initialize new image.
mergedImage(~mergedMask) = 0; % Zero out everything outside the merged region.
end
  7 comentarios
Image Analyst
Image Analyst el 13 de En. de 2012
That's what we thought. So, yes, my code is essentially what you'd do and would "resolve the problem" if you choose to do it that way.
Walter Roberson
Walter Roberson el 13 de En. de 2012
Okay, so given that you have located two nearby regions that you want to merge, how do you want to merge them?
For example, suppose that one of the regions was a square, and three pixels to the right of it was the closest point of a circle of the same diameter. What should the merged region look like?

Iniciar sesión para comentar.

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by