/**
    05Robot - Computer Vision Module

    @author P.Kaczmarek,J.Tomczynski,T.Mankowski
    @version 1.0 2017
*/
#ifndef CAMERACALIBRATIONWINDOW_H
#define CAMERACALIBRATIONWINDOW_H

#include <QWidget>
#include "ProcessorWindow.h"
#include "ui_CameraCalibrationWindow.h"
#include "ProcessorObject.h"
#include "ProcessorThread.h"

#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
/** \addtogroup ComputerVisionModule
 *  @{
 */
/**
 @brief Camera calibration window
 
 Preview and interface for camera calibration processor, allows selection of cameras and manual acquisition of images for calibration. Saves calibration data to camera-specific file.
 
 */
class CameraCalibrationWindow : public ProcessorWindow
{
	Q_OBJECT

public:
    /**
     @brief Default constructor, initializes camera calibration preview window
     
     @param pt corresponding ProcessorThread
     @param parent pointer to parent widget
     @param flags window flags
     */
    CameraCalibrationWindow(ProcessorThread*,QWidget *parent = 0, Qt::WindowFlags flags = 0);
    /**
     @brief Default destructor, cleans up
     */
	~CameraCalibrationWindow();
	/**
	 @brief Updates list of input cameras and processors

	 @param cameraList list of pointers to input CameraPreview objects
	 @param processorList list of pointers to input ProcessorWindow objects
	 */
	void updateLists(QList<CameraPreview*> cameraList, QList<ProcessorWindow*> processorList);

private:
	Ui::CameraCalibrationWindow ui;

    QList<CameraPreview*> pCameraList;
	
public slots:
    /**
     @brief Update displayed picture
     
     @param id Frame ID
     @param frame Pointer to picture
     */
	void frameIn(int id, cv::Mat* frame);
private slots:
	void applyLists();
	void acquire();
	void calibrate();

};
/** @}*/
#endif // MOCAP_H
