在R中图像的特定区域中选择像素

问题描述

我的图像有黑色背景,到处都有许多白色斑点。我只需要研究中心区域的白色像素。这个研究区域是一个矩形,每个边缘与图像的边缘相距50个像素。

所以我想选择该区域内的白色像素。我定义了四个角(xi,xf,yi和yf),但是如何在研究区域中选择白色像素?

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

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...