opencv split中的內(nèi)存

在opencv split中為生成的三個(gè)通道的數(shù)據(jù)生成了新的內(nèi)存區(qū)域
測(cè)試代碼如下

#include <opencv2/opencv.hpp>
#include <iostream>
#include <stdio.h>
using namespace cv;
int main(int argc, char const *argv[]){
    Mat dilate_element = getStructuringElement(MORPH_ELLIPSE, Size(90, 100));  //0.01-2ms
    Mat in_img = imread("/home/y/ck_wp/mp_camera/src/armor_detect/res/test_armor.jpg");
    printf("%x\n",in_img.data);
    imshow("origin",in_img);
    waitKey(0);
    Mat cha[3];
    split(in_img,cha);
    imshow("cha1 origin",cha[0]);
    waitKey(0);
    printf("%x\n",cha[0].data);
    printf("%x\n",cha[1].data);
    printf("%x\n",cha[2].data); 
    dilate(cha[0], cha[0], dilate_element, Point(-1,-1), 1); //原值通道二值化后膨脹
    imshow("cha1 change",cha[0]);
    waitKey(0);
    imshow("origin img after change",in_img);
    waitKey(0);
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容