predict_RF | R Documentation |
This function classifies pixels in images from a random forest model (Esta funcao classifica pixels em imagens a partir de um modelo de random forest).
predict_RF(im,model,col="rand",plot=TRUE)
im |
: Image that will be segmented (Imagem que sera segmentada). |
model |
: Model adjusted by the "segmentation RF" function (Modelo ajustado pela funcao "segmentation_RF"). |
col |
: Vector with the desired colors in the segmentation. If it's "rand" it will be random colors (Vetor com as cores desejadas na segmentacao. Se for "rand" serao cores aleatorias). |
plot |
: Logical value, if TRUE, the image will be displayed (Valor logico, se for TRUE a imagem sera apresentada). |
Returns the segmented image (Retorna a imagem segmentada).
Alcinei Mistico Azevedo (Instituto de ciencias agrarias da UFMG)
segmentation_RF
, segmentation_logit
#Carregando imagens de exemplo
im=read_image(example_image(3))
Fundo=read_image(example_image(4))
Folha=read_image(example_image(5))
Ref=read_image(example_image(6))
paleta=list(Fundo=Fundo,Folha=Folha,Referencia=Ref)
col=c("black","green","red")
#### Criando imagem
Image=segmentation_RF(im=im,
palette=paleta,
return="image",
NumMax=1000,
col=col,
seed=NULL,
norma=1,
plot=TRUE)
#Criando um modelo
model=segmentation_RF(im=im,
palette=paleta,
return="model",
NumMax=1000,
col=col,
seed=NULL,
norma=1,
plot=FALSE)
image=predict_RF(im,model,col="rand",plot=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.