predict_RF {ExpImage}R Documentation

Pixel classification by Random Forest methodology (Classificacao de pixels pela metodologia Random Forest)

Description

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).

Usage

predict_RF(im,model,col="rand",plot=TRUE)

Arguments

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).

Value

Returns the segmented image (Retorna a imagem segmentada).

Author(s)

Alcinei Mistico Azevedo (Instituto de ciencias agrarias da UFMG)

See Also

segmentation_RF , segmentation_logit

Examples



#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)



[Package ExpImage version 0.10.1 Index]