View source: R/proximityFilter.R
proximityFilter | R Documentation |
In order to identify objects within a specified proximity, it is essential to
calculate their respective centers, which serve to determine their proximity.
Pairs that are in close proximity will be discarded.
(Input can be obtained by objectDetection
function)
proximityFilter(centers, coordinates, radius = "auto", elongation = 2)
centers |
center coordinates of objects (mx|my|value data frame) |
coordinates |
all coordinates of the objects (x|y|value data frame) |
radius |
distance from one center in which no other centers are allowed (in pixels) (numeric / 'auto') |
elongation |
factor by which the radius should be multiplied to create the area of exclusion (default 2) |
The automated radius calculation in the proximityFilter
function is based on the presumption of circular-shaped objects. The radius
is calculated using the following formula:
\sqrt{\frac{A}{\pi}}
where A is the area of the detected objects. The function will exclude objects that are too close by extending the calculated radius by one radius length beyond the assumed circle, effectively doubling the radius to create an exclusion zone. Therefore the elongation factor is set to 2 by default, with one radius covering the object and an additional radius creating the area of exclusion.
list of 2 objects:
Center coordinates of remaining objects.
All coordinates of remaining objects.
res_objectDetection <- objectDetection(beads,
alpha = 1,
sigma = 0)
res_proximityFilter <- proximityFilter(
res_objectDetection$centers,
res_objectDetection$coordinates,
radius = "auto"
)
changePixelColor(
beads,
res_proximityFilter$coordinates,
color = "darkgreen",
visualize = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.