#########################################################################
## 		CLUZO INIT FILE 
##
## This file is read at startup time by cluzo (currently called psbench).
##
## It describes 1) the various RDIFF tags 
##
##              (for instance the possible region subtypes, even if they 
##		 are not known to cluzo etc.)
##
##              2) the desired benchmarking
## 
##		(for instance how to treat a logo, as text or image; how 
## 		 to charge a segmentation mistake etc.)
##
## Lines that start with # are comments, and ignored by cluzo.
##
## Author: Berrin Yanikoglu
## 
#########################################################################
## 		RDIFF FILE DESCRIPTION
#########################################################################

## Region_Tag lists the possible tags for a region
## Tag_Domain lists the possible values for a tag
## This information is not used now, but it's an important
## description of the RDIFF file contents.
 
Region_Tag      R_TYPE R_SUBTYPE  R_NUMBER R_ATTACHMENT R_PARENT R_OUT_ORDER R_DRAW_TYPE R_NAME R_ATTRIBUTES

Tag_Domain	R_TYPE TEXT IMAGE IMG

Tag_Domain	R_SUBTYPE REG_TEXT HEADLINE HEADER FOOTER CAPTION DROPCAP
Tag_Domain 	R_SUBTYPE RAISEDCAP TIMESTAMP INSET SIDEBAR CELL TABLE FOOTNOTE
Tag_Domain 	R_SUBTYPE SUBTITLE TEXT_IN_IMAGE
Tag_Domain 	R_SUBTYPE HALFTONE GRAPHICS LINEART LOGO HRULE VRULE FRAMEBOX GRID
Tag_Domain 	R_SUBTYPE XYZ_BERRIN HANDDRAW 

Tag_Domain 	R_NUMBER int	
	
Tag_Domain 	R_ATTACHMENT int	

Tag_Domain 	R_PARENT int

Tag_Domain 	R_OUT_ORDER int 

Tag_Domain 	R_DRAW_TYPE BOX POLYGON

Tag_Domain 	R_NAME string

Tag_Domain 	R_ATTRIBUTES  REVERSE_VIDEO SHADED_BACKGROUND UNDERLINED
Tag_Domain 	R_ATTRIBUTES  CURVED-TEXT OUTLINED VERTICAL ANGLED BULLETS 
Tag_Domain 	R_ATTRIBUTES  CELL-TABLE TAB-TABLE PIE-CHART BAR-CHART
Tag_Domain	R_ATTRIBUTES  HAND-DRAWN INCOMPLETE

 DESCRIPTION
#########################################################################

## This section indicates the type of each subtype. So, it's really a 
## region's subtype that matters. For instance, we can make subtype LOGO
## of type TEXT, if we ever want to try reading LOGOs.
## If you add a new subtype here, please make sure to add it in the R_SUBTYPE
## domain above, as well.

Subtype_Of	REG_TEXT  TEXT
Subtype_Of	HEADLINE  TEXT
Subtype_Of	HEADER    TEXT
Subtype_Of	FOOTER    TEXT
Subtype_Of	CAPTION   TEXT
Subtype_Of	DROPCAP   TEXT
Subtype_Of	RAISEDCAP TEXT
Subtype_Of	TIMESTAMP TEXT
Subtype_Of	INSET     TEXT
Subtype_Of	SIDEBAR   TEXT
Subtype_Of	CELL      TEXT
Subtype_Of	TABLE     TEXT
Subtype_Of	FOOTNOTE  TEXT
Subtype_Of	SUBTITLE  TEXT
Subtype_Of	TEXT_IN_IMAGE TEXT

Subtype_Of	HALFTONE  IMG
Subtype_Of	GRAPHICS  IMG
Subtype_Of	LINEART   IMG
Subtype_Of	LOGO      TEXT
Subtype_Of	HRULE     IMG
Subtype_Of	VRULE     IMG
Subtype_Of	FRAMEBOX  IMG
Subtype_Of	GRID      IMG

# These are two custom-added subtypes
 
Subtype_Of	XYZ_BERRIN TEXT 
Subtype_Of	HANDDRAW  IMG

Hollow 		FRAMEBOX
Hollow 		INSET
Hollow 		SIDEBAR 

## This section indicates the desired benchmarking, i.e. the actions we
## want to evaluate. For instance, "Detecting R_SUBTYPE all" means that
## the segmentation should be able to distinguish (zone properly and 
## identify the subtype) between all region subtypes. If we just want to
## benchmark headline detection, we need "Detecting R_SUBTYPE HEADLINE"
## and if we just want to see whether TEXT versus IMAGE detection is 
## done properly, we need "Detecting R_TYPE all"

Detecting	R_TYPE all

## The "Ordering" tag indicates which types or subtypes we want properly
## ordered. "Ordering NONE" means ignore ordering mistakes; "Ordering all"
## means each region should be properly ordered (according to the partial
## ordering specified by the groundtruth file); and "Ordering TEXT" means
## we only care whether TEXT regions are ordered properly or not (i.e the
## ordering mistakes involving other types of regions will not be penalized.
## This is not used currently.

Ordering 	all

## The cost of a bad segmentation region can be constant, or proportional
## to its height, or area etc, depending on the type of correction (if any) 
## that would follow segmentation.
## In case of manual segmentation, the cost should be chosen as constant;
## in case of retyping, the cost depends on how much text should be retyped
## etc, hence the cost should be proportional to its area (on-pixel-count).
## In the case where segmentation quality for text zones is assessed
## based on how many text blocks need to be moved around to recover
## text in correct order, the cost can be proportional to the height 
## of the regions.

Cost_proportional_to	area

## Individual error costs for each region subtype, are specified below. 
## Currently there are 7 error types.
## The first line indicates that the cost of a vertically_split region 
## (any region) is 0. The next two lines indicates that the cost of a
## vertically_split image region is 10; hence the vertical split of all 
## the regions except for the image regions, are allowed (not penalized).

Weight_of_a 	Vertically_split	region	0
Weight_of_a 	Vertically_split	GRAPHICS 10
Weight_of_a 	Vertically_split	HALFTONE 10

Weight_of_a 	Vertically_merged  	region	0
Weight_of_a 	Horizontally_split 	region	10
Weight_of_a 	Horizontally_merged	region	20
Weight_of_a 	Horizontally_merged	VRULE 	0
Weight_of_a 	Horizontally_merged	FRAMEBOX 0

Weight_of_a 	Noise	 	    	region	5 
Weight_of_a 	Missed 			region 	30 

# The cost of not zoning individual cells of a table

Weight_of_a 	Missed                  CELL 	1   

# The cost of not zoning text inside an image

Weight_of_a 	Missed			TEXT_IN_IMAGE	1

## Mislabeling costs. Only when two regions (one from G one from S) match
## in a one-one fashion that their types are analyzed. This analysis is 
## based on what the target type for each region subtypes are. The targets
## are determined from the above line "Detecting R_TYPE all". For instance, 
## in this case, there is a mislabeling penalty only if a region's type 
## (text or image) is incorrect. If subtype detection was requested
## ("Detecting  R_SUBTYPE all" or "Detecting  R_SUBTYPE HEADLINE"), then 
## mislabeling the subtype of a region would also be penalized.

Weight_of_a     Mislabeled		region	1
Weight_of_a     Mislabeled		LOGO 	3

## Noise pixels' width threshold. When a run of pixels longer than this
## is found missed in a region, it is considered significant. This is 
## designed to prevent penalizing the segmentation for missing one or two 
## pixels (usually peripheral noise pixels that segmentation may not 
## include in the region).
## However, note that the image resolution is reduced in processing, so 
## the NoiseWidth corresponds to a longer run in the original image.

Threshold 	NoiseWidth 		0

#
#$Id: cluzo-init,v 1.5 1995/06/07 13:54:54 berrin Exp $
#
#$Log: cluzo-init,v $
# Revision 1.5  1995/06/07  13:54:54  berrin
# 	Put a lot more comments.
#
# Revision 1.4  1995/06/07  13:29:43  berrin
# 	Changed keyword Extra to Noise.
#
# Revision 1.3  1995/05/30  14:44:39  berrin
# 	Major changes of may, mainly extensions of the format.
#
# Revision 1.2  1995/04/20  01:15:41  berrin
# 	New error costs added.
#
# Revision 1.1  1995/04/14  13:37:10  berrin
# Initial revision
#
#

