Qt5+opencv操作图像镜像显示和旋转显示

    QPixmap src;
    src.load("1.bmp");

    QMatrix matrix;
    matrix.rotate(-90.0);//逆时针旋转90度
    src= src.transformed(matrix,Qt::FastTransformation);
    
    QImage src_1= src.toImage();
    src_1=src_1.mirrored(false, true);//镜像
    src= QPixmap::fromImage(src_1);

    QPixmap fitpixmaps=src.scaled(ui->label->size(), Qt::KeepAspectRatio, 
    Qt::SmoothTransformation);
    ui->label->setPixmap(fitpixmaps);
    ui->label->setAlignment(Qt::AlignCenter);
    ui->label->show();

 

你可能感兴趣的:(Qt,OpenCV)