opencv 3.0 LUT GPU加速

来源:互联网 发布:淘宝超级会员是几个钻 编辑:程序博客网 时间:2024/06/05 16:27

opencv 自带了一个查找表函数,可以实现并行快速查找的运算。有GPU加速功能

void LUT_test(){    Mat lookUpTable(1, 256, CV_8U);    uchar *ptr = lookUpTable.data;    for (int i=0; i<256; ++i)        ptr[i] = (i >> 1) << 1;   //color reduce        cout << lookUpTable << endl;    Mat input, output(3,3,CV_8U);    input = (Mat_<uchar>(3,3) << 1, 2, 3, 4, 5, 6, 7, 8, 9);    cout << input << endl;    LUT(input, lookUpTable, output);    cout << output << endl;}




0 0
原创粉丝点击