中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 關(guān) 閉

        新聞中心

        EEPW首頁(yè) > 工控自動(dòng)化 > 設(shè)計(jì)應(yīng)用 > 基于OpenCV的人臉識(shí)別設(shè)計(jì)方案

        基于OpenCV的人臉識(shí)別設(shè)計(jì)方案

        作者: 時(shí)間:2012-07-17 來(lái)源:網(wǎng)絡(luò) 收藏

        然后利用start()函數(shù)開(kāi)啟QTimer 定時(shí)器,每隔一段時(shí)間發(fā)送信號(hào)調(diào)用自定義的槽函數(shù),該槽函數(shù)用cvGrab()從視頻流中抓取一幀圖像放入緩存,再利用CvRetrieve()從內(nèi)部緩存中將幀圖像讀出用于接下來(lái)的處理與顯示。在qt 中顯示之前,需將IplImage* source 轉(zhuǎn)換為QPixmap 類(lèi)型。

        uchar *qImageBuffer = NULL;

        /*根據(jù)圖像大小分配緩沖區(qū)*/

        qImageBuffer = (uchar*) malloc(source-》width *

        source->height * 4 * sizeof(uchar));

        /*將緩沖區(qū)指針拷貝到存取Qimage 的指針中*/

        uchar *QImagePtr = qImageBuffer;

        /* 獲取源圖像內(nèi)存指針*/Const uchar*

        iplImagePtr=reinterpret_cast/uchar*》>(source->imageDat

        a);

        /*通過(guò)循環(huán)將源圖像數(shù)據(jù)拷貝入緩沖區(qū)內(nèi)*/

        for (int y = 0; y source->height; ++y){

        for (int x = 0; x source->width; ++x){

        QImagePtr[0] = iplImagePtr[0];

        QImagePtr[1] = iplImagePtr[1];

        QImagePtr[2] = iplImagePtr[2];

        QImagePtr[3] = 0;

        QImagePtr += 4;

        iplImagePtr += 3; }

        iplImagePtr+=source->widthStep–3*source->width; }

        /*將Qimage 轉(zhuǎn)換為Qpixmap*/QPixmap local =

        QPixmap::fromImage(QImage(qImageBuffer,source-》wi

        dth,source-》height, QImage::Format_RGB32));

        /*釋放緩沖區(qū)*/

        free(qImageBuffer);

        最后利用QLabel 的setPixmap()函數(shù)進(jìn)行顯示。

        c++相關(guān)文章:c++教程


        cvt相關(guān)文章:cvt原理


        全息投影相關(guān)文章:全息投影原理


        評(píng)論


        相關(guān)推薦

        技術(shù)專(zhuān)區(qū)

        關(guān)閉