GetSegImage {KoulMde}R Documentation

Perform image segmentation

Description

Seperate an area of white pixels from a given image when there is some noise.

Usage

GetSegImage(ImgMat, p1, p2)

Arguments

ImgMat

- a matrix whose entries are pixel values of the image.

p1

- a known value of white pixel (usually 1).

p2

- a known value of black pixel (usually 0).

Value

A list of information of a segmented image.

Examples



######## Generate a 10x10 black-and-white rectangle image with some noise
nx=10
ny=10
Type=1
bNoise=TRUE
sig_noise=0.1
lst = GenImg(nx,ny,Type, bNoise, sig_noise)
ImgMat = lst$ImgMat
image(ImgMat, axes = FALSE, col = grey(seq(0, 1, length = 256)))

######## Perform image segmentation
p1=1     ### value of a white pixel
p2=0     ### value of a black pixel


lst = GetSegImage(ImgMat, p1, p2)
EstImgMat = lst$SegImgMat
image(EstImgMat, axes = FALSE, col = grey(seq(0, 1, length = 256)))



[Package KoulMde version 3.2.1 Index]