split_image: This function splits the image into several others (Esta...

View source: R/split_image.R

split_imageR Documentation

This function splits the image into several others (Esta funcao divide a imagem em varias outras de acordo com os objetos que contem)

Description

Esta funcao permite dividir a imagem e obter medidas dos objetos

Usage

split_image(im,Seg,noise=0,CutImage=TRUE,lim=10,tolerance=1,ext=1,
  splitConnected=FALSE,colorBack=c(0,0,0) ,saveImage=TRUE,
  plot=T,col="red",cex=1,fileName="test.jpg")

Arguments

im

Este objeto deve conter uma imagem no formato do EBImage.

Seg

Este objeto deve ser obrigatoriamente uma matriz binaria, contendo os valores 0 (pixels do background) ou 1 (pixels do foreground)).

noise

E o numero de pixeis a partir do qual a funcao nao considerara como ruido.

CutImage

Se TRUE a imagem ao ser dividida ser cortada, englobando apenas o objeto de interesse

lim

Indica numero de pixels que sera acrescentada nas bordas da imagem cortada

tolerance

The minimum height of the object in the units of image intensity between its highest point (seed) and the point where it contacts another object (checked for every contact pixel). If the height is smaller than the tolerance, the object will be combined with one of its neighbors, which is the highest. Tolerance should be chosen according to the range of x. Default value is 1, which is a reasonable value if x comes from distmap.

ext

Radius of the neighborhood in pixels for the detection of neighboring objects. Higher value smoothes out small objects.

splitConnected

:Variavel do tipo logico. Se TRUE objetos encostados serao considerados diferentes.

colorBack

Deve ser um vetor com tres valores variando entre 0 a 1. Estes valores indicam reespectivamente os valores de r, g e b que substituirao os pixels indesejados nas imagens divididas.

saveImage

Se for TRUE serao salvas as imagens dividas.

plot

Indica se sera apresentada (TRUE) ou nao (FALSE) (default) a imagem segmentada

col

Indica a cor do numero sobreposto sobre a imagem segmentada

cex

Indica o tamanho do numero sobrepsosto sobre a imagem segmentada

fileName

endereco e/ou nome do arquivo a ser salvo com extensao .jpg

Value

Retorna a medida em pixels dos objetos contidos na imagem e varias fotos havendo em cada uma um objeto.

Author(s)

Alcinei Mistico Azevedo (Instituto de ciencias agrarias da UFMG)

See Also

segmentation_logit

Examples


#remove(list=ls())
#require(ExpImage)
im=read_image(example_image(3))
##mostrar imagem
plot(im)

g=gray_scale(im,"g",plot=TRUE)
Seg=segmentation(img.band = g,threshold = "otsu",selectHigher = FALSE,
fillHull = TRUE,plot = TRUE)

split_image(im=im,Seg=Seg,noise = 200,CutImage = FALSE,tolerance = 1,
saveImage = FALSE,plot = TRUE,col="blue",cex=2)


ExpImage documentation built on Jan. 6, 2023, 1:24 a.m.