⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inputs.cc

📁 不错的shijuegezong的程序
💻 CC
字号:
// copied stuff from pte's Inputs.h  nts on Thu Oct 25 14:28:52 2001#include "Inputs.h"#include "Image.h"#include "Calibration.h"#include "XMLRegionSource.h"#include "ConfigurationManager.h"#include "text_output.h"#include "BufferedSlaveImageSource.h"#include "PnmSource.h"#include "BufferedSlaveXMLRegionSource.h"#include "NumberedFileSource.h"#include "RegionSet.h"#include "JPEGSource.h"namespace ReadingPeopleTracker{Inputs::Inputs(ConfigurationManager *configuration_manager){    video_image_source = NULL;        // external motion input: set to NULL and false for now    external_motion_image_source = NULL;    external_xml_region_source = NULL;        skip_non_existing =	configuration_manager->register_bool("SKIP_NON_EXISTING",					     true, &skip_non_existing,					     true, "Inputs",					     "Shall we tolerate (skip) non-existing input files ? \Useful when you have 0000.jpg, 0001.jpg, 0007.jpg etc");        max_skip_non_existing =	configuration_manager->register_int("MAX_SKIP_NON_EXISTING", 3,					    &max_skip_non_existing, true,					    "Inputs",					    "Maximum number of non-existing input files to \tolerate (skip) before assuming end of sequence");        video_image_source_filename =	configuration_manager->register_string("VIDEO_IMAGE_SOURCE_FILENAME",					       NULL, &video_image_source_filename,					       false, "Inputs",					       "Filename for a cameras video source.");        last_frame_id = (frame_id_t)	configuration_manager->register_int("LAST_FRAME_ID", 0,					    &last_frame_id, false,					    "inputs",					    "Frame id (number) for the end frame of a video source.");        calibration_filename =	configuration_manager->register_string("CALIBRATION_FILENAME",					       NULL, &calibration_filename,					       false, "Inputs",					       "Filename for a camera calibration data.");        external_motion_image_source_filename =	configuration_manager->register_string("MOTION_IMAGE_SOURCE_FILENAME",					       NULL, &external_motion_image_source_filename,					       false, "Inputs",					       "Optional filename for external motion image input.");        external_background_image_source_filename =	configuration_manager->register_string("BACKGROUND_IMAGE_SOURCE_FILENAME",					       NULL, &external_background_image_source_filename,					       false, "Inputs",					       "Optional (numbered) filename for external background image input.");        external_xml_region_source_filename =	configuration_manager->register_string("XML_REGION_SOURCE_FILENAME",					       NULL, &external_xml_region_source_filename,					       false, "Inputs",					       "Optional (numbered) filename for external XML region input.");        occlusion_resample_shift = 	configuration_manager->register_int("OCCLUSION_RESAMPLE_SHIFT", 2,					    &occlusion_resample_shift,					    true, "Inputs", 					    "Resample image dimensions by 2^n for occlusion handling");        quick_occlusion_reasoning =	configuration_manager->register_bool("QUICK_OCCLUSION_REASONING",					     true, &quick_occlusion_reasoning,					     true, "Inputs",					     "Draw people as rectangles for speed in occlusion reasoning?");    }Inputs::~Inputs(){    if (video_image_source != NULL) delete video_image_source;    if (external_motion_image_source != NULL) delete external_motion_image_source;    if (external_xml_region_source != NULL) delete external_xml_region_source;    if (external_background_image_source != NULL) delete external_background_image_source;    if (calibration != NULL) delete calibration;}void Inputs::setup_inputs(){    //  1 - Set up video input    setup_image_source_input(video_image_source_filename,			     video_image_source,			     skip_non_existing,			     max_skip_non_existing);        if (video_image_source == NULL)    {	cerror << "Inputs::setup_inputs(): Error opening Video Image Source.  Cannot work without. "	       << endl;	exit(1);    }            //  2 - Set up input from external motion detector if requested...    //  2a - motion images    setup_image_source_input(external_motion_image_source_filename,			     external_motion_image_source,			     skip_non_existing,			     max_skip_non_existing);        //  2b - background images    setup_image_source_input(external_background_image_source_filename,			     external_background_image_source,			     skip_non_existing,			     max_skip_non_existing);        //  2c - XML Regions    setup_xml_region_source_input(external_xml_region_source_filename,				  external_xml_region_source);        // 3 - set up camera calibration    if (calibration_filename != NULL)    {	calibration = new Calibration(calibration_filename,				      video_image_source->get_ydim());    }    else	calibration = NULL;  // signal non-existence of Calibration    }// set up buffered slave and input source as specified by a filename//   returns whether some valid input has been set up.bool Inputs::setup_image_source_input(char *input_filename,				      ImageSource *&input_source,				      bool skip_non_existing,            // = false				      frame_id_t max_skip_non_existing)  // = 3{    // set default value NULL, thereby signalling not available [yet]    input_source = NULL;        // buffered slave (if available, it will be returned as the input_source)    BufferedSlaveImageSource *slave_source = NULL;    bool need_slave_source = false;        if (input_filename == NULL)	return false;        //    //  1 - check for special filename "slave".  The syntax for this is    //      either "slave" or "slave," followed by a filename.    if (strcasecmp(input_filename, "slave") == 0)    {	// use buffered slave input which is not fed input?	cerror << "Inputs::setup_image_source_input: "	       << "A slave without file input makes no sense. " << endl	       << "  The requested input was 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -