# GetSegImage: Perform image segmentation In KoulMde: Koul's Minimum Distance Estimation in Regression and Image Segmentation Problems

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

• SegImgMat - a matrix as a result of the image segmentation.

• Estimated_S1 - an n1x2 matrix whose entries denote estimated coordinates of white pixels, corresponding to p1.

• Estimated_S2 - an n2x2 matrix whose entries denote estimated coordinates of black pixels, corresponding to p2.

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