Selection of pixel using selection box on image

I have an image with a black background and with many white spots everywhere. I just need to study the white pixel in the center. This studied area is at a distance of 50 pixels from the 4 edges of the image.

So I would like to select the white pixels inside this area. I defined the 4 corners (xi, xf, yi and yf) but how to select the white pixel in the studied area?

library(EBImage)
library(ggplot2)
image <- readImage('C:/Users/PC/Desktop/Cluster/Test.png')
display(image , method = "raster")

# definition of the 4 corner of the selection box
tolerance <- 50
xi <- 0 + tolerance
xf <- dim(image )[1] - tolerance
yi <- 0 + tolerance
yf <- dim(image )[2] - tolerance

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.