Description Usage Arguments Value Examples
Seperate an area of white pixels from a given image when there is some noise.
1 | GetSegImage(ImgMat, p1, p2)
|
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). |
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.
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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.