考虑CV_IMAGE_ELEM的结果为QString

Considering the result of CV_IMAGE_ELEM as QString?

本文关键字:结果 QString ELEM CV IMAGE 考虑      更新时间:2023-10-16

我想在LineEdit中显示10x10窗口CV_IMAGE_ELEM的结果,其参数是QString。

我是否应该考虑以下问题:

for (int y=0;y<10;y++)
{
    for (int x=0;x<10;x++) //width
    {
        QString qstr= CV_IMAGE_ELEM(img_crop_mat, uchar, y, x*3+ 2);
        QString ctot= qstr + ctot;
        lineEdit_mat->setText(ctot + " ");
    }
    lineEdit_mat->setText("n");
}

谢谢。

尝试循环

myQString.append(QString("%1 ").arg((int) IPL_IMAGE_ELEM(...) ));

这是假设您想以数字格式打印图像数据。