QImage转cv::Mat:
cv::Mat TempCVImage;
m_srcQImage = img.copy();
qDebug() << "Image Format:" << m_srcQImage.format();
std::cout << "image format--:" << std::endl;
if (m_srcQImage.format() == QImage::Format_Indexed8) {
//黑白图
qDebug() << "Image Format:" << "QImage::Format_Indexed8";
TempCVImage = cv::Mat(m_srcQImage.height(), m_srcQImage.width(), CV_8UC1, (void*)m_srcQImage.constBits(), m_srcQImage.bytesPerLine());
} else