All files included in this release are
Copyright (c) 1997-2000. The Regents of the University
of California (Regents). All Rights Reserved.

Permission to use, copy, modify, and distribute this software and its
documentation for educational, research, and not-for-profit purposes,
without fee and without a signed licensing agreement, is hereby
granted, provided that the above copyright notice, this paragraph and
the following two paragraphs appear in all copies, modifications, and
distributions. Contact The Office of Technology Licensing, UC Berkeley,
2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620, (510)
643-7201, for commercial licensing opportunities. Created by
Chad Carson, Serge Belongie, and Jitendra Malik, Department of Electrical
Engineering and Computer Sciences, University of California, Berkeley.
For technical information, contact carson@eecs.berkeley.edu.

IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF
ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION
TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.

=============================================================================

Files you need to change:

params.m
	The variables IMAGEPATH, DATAPATH, WEBPATH, and CDLIST
	specify the paths to use for images, features, etc.
	Each of the *PATH directories and the CDLIST file must exist 
	or you'll get an error. Set NUM_IMAGES to the total number of
	images to include.

cdlist_test.txt (or whatever is given in CDLIST in params.m)
	A list of all the CDs you want to process. Each CD is assumed
	to have 100 images; for example, the CD 108000 has images
	108000-108099.



To perform the feature extraction and save image descriptions, you
need to edit params.m and cdlist_test.txt and then run script.m in
Matlab. If you add more images (CDs) later, just add them to
cdlist.txt and rerun script.m--this will redo the processing only on
images that haven't yet been processed.

The script saves blobworld images and data files for each
processed image, for example:

108000/108001/108001_blobworld.jpeg
108000/108001/108001_mask.jpeg
108000/108001/108001_support.map
108000/108001/108001_bd.mat
108000/108001/108001_clean.mat
108000/108001/108001_blob1.jpeg
108000/108001/108001_blob1ring.pbm
108000/108001/108001_blob2.jpeg
108000/108001/108001_blob2ring.pbm

(It also saves 108000/index.html, which is a page of the images and
Blobworlds for all 100 images in the CD.)

108001_blobworld.jpeg is the Blobworld visualization.

108001_mask.jpeg is the original image with the region boundaries
shown in gray.

108001_support.map is a matrix of integers indicating the blob
membership of each pixel in the image.

108001_blob1.jpeg is the Blobworld with blob 1 circled.

108001_blob1ring.pbm is a PBM with the border of blob 1 equal to 1.


108001_bd.mat is a matlab data file with the following variables:

  CC                   192x128       196608  double array
  Xdim                   1x1              8  double array
  Ydim                   1x1              8  double array
  bd                     1x6          38368  struct array
  filename               1x63           126  char array
  support              192x128       196608  double array
  whole_aniso_hist       1x21           168  double array
  whole_color_hist       1x218         1744  double array
  whole_con_hist         1x21           168  double array

CC is a matrix indicating the blob membership of each pixel in the image.
Xdim, Ydim are the dimensions of the image.
bd is an array of structures containing the descriptors of each region.
filename is the location of the original image.
support is a matrix indicating the blob membership of each pixel in the
	image, with region boundaries labeled as 0.
the three *_hist vectors are the color and texture histograms of the
	whole image.


108001_clean.mat is similar to 108001_bd.mat and can be ignored.




Once all the images have been processed using script.m, if you want to
use the web server code to do Blobworld searching in those images, you
need run make_all_data_files.m to take the image data features and
create the overall data files to be used by the query code.

After you've done that, compile and run all six read_txt_write_bin*.c
programs in /elib/sys/test/httpd/cgi-bin/blobrank/write_bin_files/
(included in C_src_files.tar.gz) to transform the ASCII data files to
binary files which are needed by the Blobworld search code. (The code
is able to search much faster in the binary files than in the ASCII
files.)

You also need to copy all three sketch*.txt files to the location of
the data files, which is DATAPATH.
