[48] | 1 | /*********************************************************************
|
---|
| 2 | // created: 2013/10/25 - 19:36
|
---|
| 3 | // filename: Flea3Component.h
|
---|
| 4 | //
|
---|
| 5 | // author: Danilo Alves de Lima
|
---|
| 6 | // Copyright Heudiasyc UMR UTC/CNRS 6599
|
---|
| 7 | //
|
---|
| 8 | // version: $Id: $
|
---|
| 9 | //
|
---|
| 10 | // purpose:
|
---|
| 11 | *********************************************************************/
|
---|
| 12 |
|
---|
| 13 | #ifndef FLEA3COMPONENT_H
|
---|
| 14 | #define FLEA3COMPONENT_H
|
---|
| 15 |
|
---|
| 16 | #include "PtGreyCamerasExp.h"
|
---|
| 17 |
|
---|
| 18 | #include <fstream>
|
---|
| 19 | #include <qcoreevent.h>
|
---|
| 20 | #include <qthread.h>
|
---|
| 21 | #include <string>
|
---|
| 22 |
|
---|
| 23 | #include "Pacpus/kernel/ComponentBase.h"
|
---|
| 24 | #include "Pacpus/kernel/DbiteFile.h"
|
---|
| 25 | #include "Pacpus/PacpusTools/ShMem.h"
|
---|
| 26 |
|
---|
| 27 | #include "FlyCapture2.h"
|
---|
| 28 |
|
---|
| 29 | #include <QThread>
|
---|
| 30 | #include <QMutex>
|
---|
| 31 | #include <qdir.h>
|
---|
| 32 |
|
---|
| 33 | namespace pacpus {
|
---|
| 34 |
|
---|
| 35 | /** Class to provide the obstacle detection from a disparity map data */
|
---|
| 36 | class PTGREYCAMERAS_API Flea3Component: public QThread,
|
---|
| 37 | public ComponentBase
|
---|
| 38 | {
|
---|
| 39 | public:
|
---|
| 40 | //============================= DEFAULT ELEMENTS ===============================================
|
---|
| 41 | Flea3Component(QString name);
|
---|
| 42 | ~Flea3Component();
|
---|
| 43 |
|
---|
| 44 | void run();
|
---|
| 45 |
|
---|
| 46 | virtual void stopActivity(); /*!< to stop the processing thread */
|
---|
| 47 | virtual void startActivity(); /*!< to start the processing thread */
|
---|
| 48 | virtual ComponentBase::COMPONENT_CONFIGURATION configureComponent(XmlComponentConfig config);
|
---|
| 49 | //==============================================================================================
|
---|
| 50 |
|
---|
| 51 | protected:
|
---|
| 52 |
|
---|
| 53 | // Indicates that thread is running
|
---|
| 54 | bool is_running;
|
---|
| 55 |
|
---|
| 56 | public:
|
---|
| 57 |
|
---|
| 58 | /**
|
---|
| 59 | * Initialize default values
|
---|
| 60 | */
|
---|
| 61 | void InitDefault();
|
---|
| 62 |
|
---|
| 63 | private:
|
---|
| 64 | int cam_serial; // Camera serial to connect
|
---|
| 65 |
|
---|
| 66 | // Camera configuration
|
---|
| 67 | bool auto_FrameRate; // Set auto frame rate
|
---|
| 68 | double cam_FrameRate; // Frame rates in frames per second
|
---|
| 69 | bool auto_Gain; // Set auto gain
|
---|
| 70 | double cam_Gain; // Gain value in db
|
---|
| 71 | bool auto_Exposure; // Set auto exposure
|
---|
| 72 | double cam_Exposure; // Auto exposure in EV
|
---|
| 73 | bool auto_Shutter; // Set auto shutter
|
---|
| 74 | double cam_Shutter; // Shutter in miliseconds
|
---|
| 75 | bool auto_ExposurebyCode; // Set auto exposure by pos processing method
|
---|
| 76 | double cam_ExposurebyCode_tshold; // Pecentage of white pixels for threshold
|
---|
| 77 |
|
---|
| 78 | int cam_video_mode; // DCAM video modes
|
---|
| 79 | int cam_mode; // Camera modes for DCAM formats as well as Format7
|
---|
| 80 | int cam_PixelFormat; // Pixel formats available for Format7 modes
|
---|
| 81 | int cam_ColorProcessingAlgorithm; /**
|
---|
| 82 | * Color processing algorithms. Please refer to our knowledge base at
|
---|
| 83 | * article at http://www.ptgrey.com/support/kb/index.asp?a=4&q=33 for
|
---|
| 84 | * complete details for each algorithm.
|
---|
| 85 | */
|
---|
| 86 | int cam_start_point_left; // Image left point (for standard modes only)
|
---|
| 87 | int cam_start_point_top; // Image top point (for standard modes only)
|
---|
| 88 | int cam_width; // Image width (for standard modes only)
|
---|
| 89 | int cam_height; // image height (for standard modes only)
|
---|
| 90 | int cam_channels; // Image channels (depending of the color processing method)
|
---|
| 91 |
|
---|
| 92 | int image_compact; // Use jpeg format to save the images
|
---|
| 93 |
|
---|
| 94 | bool showdebug; // Show frame acquired
|
---|
| 95 |
|
---|
| 96 | int mMaxImageOutputSize; // Size of the input image data in the memory
|
---|
| 97 |
|
---|
| 98 | // Output directory
|
---|
| 99 | QDir mOutputDirectory;
|
---|
| 100 |
|
---|
| 101 | size_t img_mem_size; // Memory size for the image data
|
---|
| 102 |
|
---|
| 103 | bool use_shmem; // If is to use shared memory
|
---|
| 104 |
|
---|
| 105 | // Imput data
|
---|
| 106 | ShMem * shmem_image; // Shared memory control access to the image data
|
---|
| 107 |
|
---|
| 108 | DbiteFile mDbtImage;
|
---|
| 109 |
|
---|
| 110 | bool THREAD_ALIVE;
|
---|
| 111 | };
|
---|
| 112 |
|
---|
| 113 | }
|
---|
| 114 | #endif // FLEA3COMPONENT
|
---|