# Abrindo a imagem
im=read_image(example_image(3),plot=TRUE)
#Obtendo a escalad e cinza
m=gray_scale(im,method = "r/rgb",plot=TRUE)
#Obtendo a mascara
seg=segmentation(m,treshold = 0.50,selectHigher = TRUE,fillHull = TRUE,plot=TRUE)
#Excluindo o objeto
exclude_object(im,mask=seg,valueTarget = 0,color=c(r=0.95,g=0.94,b=0.94))
if (FALSE) {
#dilatando o objeto e excluindo-o
seg2=dilate_image(seg,n=5)
exclude_object(im,mask=seg2,valueTarget = 0,color=c(r=0.95,g=0.94,b=0.94))
exclude_object(im,mask=seg2,valueTarget = 1,color=c(r=0.95,g=0.94,b=0.94))
# Segmentar e excluir clicando sobre a imagem.
exclude_object(im,valueTarget = 1,color=c(r=0.95,g=0.94,b=0.94))
}
Run the code above in your browser using DataLab