|






| |
|
1 |
Software |
|
NOTE: The following software is provided for research purposes only. You may not distribute this software in any form without the prior
approval of the University of California.
Copyright (C) 1999, The Regents of the University of California, Samsung Electronics Corporation.
All rights reserved. 6/19/99 Author: Yining Deng and B.S. Manjunath
THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER NOTORIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
Download (Click right mouse button and choose save link as) :
|
|
SUN
Solaris
|
SGI IRIX 6.3 |
Windows 95/98/NT
|
Source
code:
The following
source code jseg.zip (182 Kb), with supporting JPEG free source code
jpeg-6b.zip (743Kb), is provided for research purposes
only. You may not distribute this
software in any form without the prior approval of the University of California.
|
PC Windows:
The programs are built to "Console Application"
using visual C. You can use dos prompt to run the program and specify the
command line arguments.
To run the program, type ProgramName to show a list of command line
arguments:
Usage:
segdist {arguments} {options}
arguments
must be provided:
-i
file input media filename
-t
type input media type:
type
1,2,3 must provide image size
|
| ¡¡ |
1:
image yuv |
¡¡ |
5:
image ppm |
|
2:
image raw rgb |
6:
image jpg |
|
3:
image raw gray |
9:
image gif |
|
4:
image pgm |
¡¡ |
|
Options: |
|
-o
file factor |
output
image (region boundary superimposed} filename
output
image format same as input image
factor:
dim original image to show boundaries, 0-1.0 |
|
-rn
file |
output
region map filename, n type
3: image raw gray
9: image gif |
|
-s
height width |
image
height and width |
|
-q
thresh |
color
quantization threshold, 0-600, default automatic |
|
-m
thresh |
region
merge threshold, 0-1.0, default 0.4 |
|
-l
scale |
number
of scales, default automatic |
| |
Example:
segdist -i test.rgb -t 2 -o
test.seg.rgb 0.9 -s 128 192 -r9 test.map.gif -v test -q 255
The region map file is a gray-scale image. It labels the image pixels.
If pixel (0,0) belongs to region 1, its value is 1. The label starts at 1
and ends at the total number of regions. Your probably will only see black
when you try to view the map image. That's because most values are too
small. If you equalize the image, you'll see patches of regions. The
equalization changes the original pixel values though.
The region map is very useful for many applications, for example, if
you want to process all the pixels in a particular region of interest. On
the other hand, if you want to get the region boundaries, you need to do a
little job by yourself. For example, you can check if each pixel is of
same label as its neighboring pixels. If no, it indicates that pixel is at
the boundary.
Program limitation: The total number of regions in the image must be
less than 256 before the region merging process. This works for most
images smaller than 512x512.
Processing time will be about 10 seconds for an 192x128 image and 60
seconds for a 352x240 image. It will take several minutes for a 512x512
image. Minimum image size is 64x64.
|
| |
Optional Parameters
color quantization threshold - specify values 0-600, leave blank for automatic determination.
The higher the value, the less number of quantized colors in the image.
For color images, try 250. If you are unsatisfied with the result because
two neighboring regions with similar colors are not getting separated,
please try a smaller value say 150.
number of scales - The algorithm automatically determines the starting scale based on the
image size and reduces the scale to refine the segmentation results. If
you want to segment a small object in a large-sized image, use more number
of scales. If you want to have a coarse segmentation, use 1 scale only.
region merge threshold specify values 0.0-0.7, leave blank for default value 0.4.
If there are two neighboring regions having identical color, try smaller
values to avoid the merging. |
|