/** @brief Decodes and returns the grabbed video frame.

    @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty.
    @param flag it could be a frame index or a driver specific flag
    @return `false` if no frames has been grabbed

    The method decodes and returns the just grabbed frame. If no frames has been grabbed
    (camera has been disconnected, or there are no more frames in video file), the method returns false
    and the function returns an empty image (with %cv::Mat, test it with Mat::empty()).

    @sa read()

    @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video
    capturing structure. It is not allowed to modify or release the image! You can copy the frame using
    :ocvcvCloneImage and then do whatever you want with the copy.
     */
 bool I3ThermalSystem::retrieve(OutputArray image, int flag ) 
 { 
     image.create(288, 384, CV_16UC1);
     if (!image.isContinuous())
     {
         return false;
     }
     char c = 1;
     irFile.Write(&c, 1);
     int nb=irFile.Read(image.getMat().ptr(0), 384 * 288 * 2);
     return nb== 384 * 288 * 2;
 }