You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			36 lines
		
	
	
		
			644 B
		
	
	
	
		
			C
		
	
		
		
			
		
	
	
			36 lines
		
	
	
		
			644 B
		
	
	
	
		
			C
		
	
| 
								 
											3 years ago
										 
									 | 
							
								#pragma once
							 | 
						||
| 
								 | 
							
								#include <QThread>
							 | 
						||
| 
								 | 
							
								#include <QDebug>
							 | 
						||
| 
								 | 
							
								#include <opencv2/opencv.hpp>
							 | 
						||
| 
								 | 
							
								#include <opencv2/imgproc/types_c.h>
							 | 
						||
| 
								 | 
							
								#include "SyncQueue.h"
							 | 
						||
| 
								 | 
							
								#include "ASyncQueue.h"
							 | 
						||
| 
								 | 
							
								#include "common.h"
							 | 
						||
| 
								 | 
							
								#include <QObject>
							 | 
						||
| 
								 | 
							
								#include "alg.h"
							 | 
						||
| 
								 | 
							
								class WorkThread : public QThread
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								        Q_OBJECT
							 | 
						||
| 
								 | 
							
								signals:
							 | 
						||
| 
								 | 
							
									void display_image(cv::Mat);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 | 
							
									WorkThread(QObject *parent = 0): QThread(parent)
							 | 
						||
| 
								 | 
							
									{
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
									}
							 | 
						||
| 
								 | 
							
									~WorkThread();
							 | 
						||
| 
								 | 
							
												
							 | 
						||
| 
								 | 
							
									void init();
							 | 
						||
| 
								 | 
							
									void start_work();
							 | 
						||
| 
								 | 
							
									void stop();
							 | 
						||
| 
								 | 
							
								protected:
							 | 
						||
| 
								 | 
							
									void run();
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 | 
							
									SyncQueue<std::pair<std::string, cv::Mat> >* p_save_queue;
							 | 
						||
| 
								 | 
							
									SyncQueue<cv::Mat>* p_image_queue;
							 | 
						||
| 
								 | 
							
									ASyncQueue<bool>* p_result_queue;
							 | 
						||
| 
								 | 
							
									Alg* m_alg_ptr;
							 | 
						||
| 
								 | 
							
									bool b_quit;
							 | 
						||
| 
								 | 
							
								};
							 |