last update 20 Sep 2009 |
00001 /* 00002 * Copyright (C) 1998-2006 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * 00006 * This file is part of the Computer Vision and Robotics Library (CVR-Lib) 00007 * 00008 * The CVR-Lib is free software; you can redistribute it and/or 00009 * modify it under the terms of the BSD License. 00010 * 00011 * All rights reserved. 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions are met: 00015 * 00016 * 1. Redistributions of source code must retain the above copyright notice, 00017 * this list of conditions and the following disclaimer. 00018 * 00019 * 2. Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * 00023 * 3. Neither the name of the authors nor the names of its contributors may be 00024 * used to endorse or promote products derived from this software without 00025 * specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00028 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00031 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00032 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00033 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00034 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00035 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00036 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00037 * POSSIBILITY OF SUCH DAMAGE. 00038 */ 00039 00040 00041 /** 00042 * \file cvrCsPresegmentation.h 00043 * \author Pablo Alvarado 00044 * \date 8.11.2001 00045 * $Id: cvrDocuSegmentation.h,v 1.3 2006/01/03 19:56:00 alvarado Exp $ 00046 */ 00047 00048 #ifndef _CVR_DOCU_SEGMENTATION 00049 #define _CVR_DOCU_SEGMENTATION 00050 00051 /** 00052 \page segmPage Segmentation Overview 00053 00054 Segmentation is a complex task, and the number of functors in the CVR-Lib 00055 that deal with segmentation grows... A few extra-notes are required. 00056 00057 There are two sorts of segmentation functors. Traditional 00058 "complete" algorithms and "blocks", with which you can build your 00059 own segmentation approach. There are also tools to convert the 00060 results from one representation to another. 00061 00062 \section completeSeg Complete Algorithms 00063 00064 The complete algorithms are: 00065 00066 - Threshold segmentation. Used to separate background from object 00067 (two-classes segmentation). You give a "window" for pixel values that 00068 should be recognized as object. The rest will be background. Some 00069 algorithms can choose automatically the threshold values. 00070 (see cvr::thresholdSegmentation, cvr::optimalThresholding) 00071 - Watershed segmentation. This sort of algorithms are widely used. Several 00072 implementations can be chosen using the functor parameters 00073 (see cvr::watershedSegmentation) 00074 - Comaniciu's Mean-Shift algorithm is also implemented. With it you 00075 can choose between quantization, oversegmentation and undersegmentation. 00076 (see cvr::meanShiftSegmentation) 00077 - Region growing for a two-classes segmentation problem can also be found 00078 here (see cvr::regionGrowing) 00079 00080 \section blockSeg Functional Blocks 00081 00082 There are several blocks, that can be used as part of a more complex 00083 segmentation approach. 00084 00085 - A statistical background model per pixel can detect a continuous background 00086 from a moving object or objects. 00087 (see cvr::backgroundModel) 00088 - A pre-segmentation approach is implemented, which finds regions 00089 using color quantization and marks as background the colors most 00090 used at the border in cvr::csPresegmentation. 00091 - Similar to the pre-segmentation is the cvr::kMeansSegmentation, but here 00092 no background is identified, only the color quantization and (optionally) 00093 the smoothing stages are done. 00094 - cvr::whiteningSegmentation uses the kMeansSegmentation to segment the 00095 original image and a transformed one, and combines the results of both. 00096 - Given a list of area points, where each object (or region) is represented 00097 by an cvr::areaPoints %object, it is possible to generate a so called 00098 similarity matrix using the cvr::similarityMatrix functor. Here a 00099 similarity measure will be generated for all adjacent objects. 00100 - With a similarity matrix it is possible to merge similar regions using 00101 the cvr::regionMerge %functor. 00102 00103 \section toolsSeg Tools for segmentation 00104 00105 Segmentation algorithms produce usually so called "masks", 00106 i.e. channels, where each pixel contains a label value. These masks 00107 can be considered for two classes problems, where only values of 00108 zero and not-zero will be differentiated, and "labeled" masks, where 00109 each value is considered as a different object. To extract the 00110 position of each single object in the image in an efficient way the 00111 functor \b cvr::objectsFromMask should be used. Sometimes the 00112 \b cvr::fastRelabeling %functor provides all functionality required for 00113 this task. 00114 00115 The cvr::boundingBox functor can use one of the pointLists extracted with 00116 cvr::objectsFromMask to produce a new image with only one object. 00117 00118 It is useful sometimes to generate a color %image, where each label 00119 found in the %segmentation is replaced by its mean color, producing 00120 an color quantized %image. Here, the functors cvr::usePalette and 00121 cvr::computePalette are helpful. 00122 */ 00123 00124 #endif 00125 00126 00127