GetSegImage: Perform image segmentation

Description Usage Arguments Value Examples

View source: R/ImgSeg.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
######## 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)))

KoulMde documentation built on Jan. 13, 2021, 3:01 p.m.

Related to GetSegImage in KoulMde...