no message

master
zcy 2022-05-18 02:19:46 +08:00
parent 74aa46fbd2
commit cd72125f29
2 changed files with 8 additions and 11 deletions

1
.gitignore vendored
View File

@ -40,3 +40,4 @@ client/janus_gateway_win/x64/
client/janus_gateway_win/janus_win/x64/
client/janus_gateway_win/.vs/
client/janus_gateway_win/usocket_test/x64/
client/build-webrtc_capture-Desktop_Qt_5_15_2_MSVC2019_64bit-Debug/

View File

@ -149,14 +149,11 @@ cv::Mat *QImage2cvMat(QImage image)
case QImage::Format_ARGB32_Premultiplied:
mat = new cv::Mat(image.height(),
image.width(),
CV_8UC4,
image.bits(),
image.bytesPerLine());
CV_8UC4);
memcpy(mat->data,image.bits(),image.bytesPerLine()*image.height());
break;
case QImage::Format_RGB888:
mat = new cv::Mat(image.height(), image.width(), CV_8UC3, (void*)image.bits(), image.bytesPerLine());
// cv::cvtColor(mat, mat, CV_BGR2RGB);
break;
case QImage::Format_Indexed8:
mat = new cv::Mat(image.height(), image.width(), CV_8UC1, (void*)image.bits(), image.bytesPerLine());
@ -177,14 +174,13 @@ void MainWindow::on_pushButton_2_clicked()
qDebug()<<"format is "<<image.format();
// cv::Mat Img;
// Img.create(pix.height()*3/2,
// pix.width(), CV_8UC1);
// memcpy(Img.data, pix.data_ptr().data(),
// pix.height()*pix.width()*sizeof(unsigned char)*3/2);
// qDebug()<<"pixmap size is "<<pix.size();
cv::Mat pic = *QImage2cvMat(image);
// qDebug()<<pic.size().width<<image.size();
try{
cv::imshow("img", pic);
}catch (std::exception &e){
qDebug()<<e.what();
}
cv::waitKey(1);
this->processed_picture->setPixmap(QPixmap::fromImage(image));
}