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 ) - tolerance yi <- 0 + tolerance yf <- dim(image ) - tolerance