/*M///////////////////////////////////////////////////////////////////////////////////////1//2// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.3//4// By downloading, copying, installing or using the software you agree to this license.5// If you do not agree to this license, do not download, install,6// copy or use the software.7//8//9// Intel License Agreement10// For Open Source Computer Vision Library11//12// Copyright (C) 2000, Intel Corporation, all rights reserved.13// Third party copyrights are property of their respective owners.14//15// Redistribution and use in source and binary forms, with or without modification,16// are permitted provided that the following conditions are met:17//18// * Redistribution's of source code must retain the above copyright notice,19// this list of conditions and the following disclaimer.20//21// * Redistribution's in binary form must reproduce the above copyright notice,22// this list of conditions and the following disclaimer in the documentation23// and/or other materials provided with the distribution.24//25// * The name of Intel Corporation may not be used to endorse or promote products26// derived from this software without specific prior written permission.27//28// This software is provided by the copyright holders and contributors "as is" and29// any express or implied warranties, including, but not limited to, the implied30// warranties of merchantability and fitness for a particular purpose are disclaimed.31// In no event shall the Intel Corporation or contributors be liable for any direct,32// indirect, incidental, special, exemplary, or consequential damages33// (including, but not limited to, procurement of substitute goods or services;34// loss of use, data, or profits; or business interruption) however caused35// and on any theory of liability, whether in contract, strict liability,36// or tort (including negligence or otherwise) arising in any way out of37// the use of this software, even if advised of the possibility of such damage.38//39//M*/4041#ifndef __CREATESAMPLES_UTILITY_HPP__42#define __CREATESAMPLES_UTILITY_HPP__4344#define CV_VERBOSE 14546/*47* cvCreateTrainingSamples48*49* Create training samples applying random distortions to sample image and50* store them in .vec file51*52* filename - .vec file name53* imgfilename - sample image file name54* bgcolor - background color for sample image55* bgthreshold - background color threshold. Pixels those colors are in range56* [bgcolor-bgthreshold, bgcolor+bgthreshold] are considered as transparent57* bgfilename - background description file name. If not NULL samples58* will be put on arbitrary background59* count - desired number of samples60* invert - if not 0 sample foreground pixels will be inverted61* if invert == CV_RANDOM_INVERT then samples will be inverted randomly62* maxintensitydev - desired max intensity deviation of foreground samples pixels63* maxxangle - max rotation angles64* maxyangle65* maxzangle66* showsamples - if not 0 samples will be shown67* winwidth - desired samples width68* winheight - desired samples height69*/70#define CV_RANDOM_INVERT 0x7FFFFFFF7172void cvCreateTrainingSamples( const char* filename,73const char* imgfilename, int bgcolor, int bgthreshold,74const char* bgfilename, int count,75int invert = 0, int maxintensitydev = 40,76double maxxangle = 1.1,77double maxyangle = 1.1,78double maxzangle = 0.5,79int showsamples = 0,80int winwidth = 24, int winheight = 24 );8182void cvCreateTestSamples( const char* infoname,83const char* imgfilename, int bgcolor, int bgthreshold,84const char* bgfilename, int count,85int invert, int maxintensitydev,86double maxxangle, double maxyangle, double maxzangle,87int showsamples,88int winwidth, int winheight, double maxscale );8990/*91* cvCreateTrainingSamplesFromInfo92*93* Create training samples from a set of marked up images and store them into .vec file94* infoname - file in which marked up image descriptions are stored95* num - desired number of samples96* showsamples - if not 0 samples will be shown97* winwidth - sample width98* winheight - sample height99*100* Return number of successfully created samples101*/102int cvCreateTrainingSamplesFromInfo( const char* infoname, const char* vecfilename,103int num,104int showsamples,105int winwidth, int winheight );106107/*108* cvShowVecSamples109*110* Shows samples stored in .vec file111*112* filename113* .vec file name114* winwidth115* sample width116* winheight117* sample height118* scale119* the scale each sample is adjusted to120*/121void cvShowVecSamples( const char* filename, int winwidth, int winheight, double scale );122123#endif //__CREATESAMPLES_UTILITY_HPP__124125126