IdentifyWorker.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "scan_common.h"
  3. #include "basic_struct_private.h"
  4. #include "..\Identifier\Identifier.h"
  5. class CIdentifyWorker:public IService
  6. {
  7. public:
  8. enum IDENTIFY_STATE {
  9. IS_WAITING,
  10. IS_IDENTIFING
  11. };
  12. public:
  13. CIdentifyWorker(void);
  14. ~CIdentifyWorker(void);
  15. void SetUseQr(bool bUseQr, const std::string&strQr);
  16. IDENTIFY_STATE GetIdentifyState(){ return m_identify_state;}
  17. BOOL Identify(const IplImage * img, OMR_RESULT * out_result, result_buffer_state * presult_buffer_state);
  18. BOOL Identify(const IplImage * img, OMR_RESULT * out_result, result_buffer_state * presult_buffer_state, int schema_index, const std::vector<Point2f>& muban, const std::vector<Point2f>& shijuan);
  19. void LoadSchema(const boost::shared_ptr<const ISCH_Schema>& schema);
  20. private:
  21. IDENTIFY_STATE m_identify_state;
  22. identify::CIdentifier m_Identifier;
  23. IplImage * m_img;
  24. OMR_RESULT * m_out_result;
  25. result_buffer_state * m_presult_buffer_state;
  26. int m_schema_index;
  27. std::vector<Point2f> m_muban;
  28. std::vector<Point2f> m_shijuan;
  29. enum IDENTIFY_TASK_TYPE{
  30. ITT_NORMARL,
  31. ITT_MANUALMATCH,
  32. }m_identify_task_type;
  33. public:
  34. virtual BOOL Start(void);
  35. protected:
  36. virtual ServiceState OnRunning( void );
  37. virtual ServiceState OnStarting( void );
  38. };