transformation between Qimage and cv::Mat