opencv-c++
c++ opencv中table(1,256,CV_8UC3)更改为LUT(),通过三个通道进行显示Mat table(1,256,CV_8UC3);
vector<Mat> bgr_planes;
split(table,bgr_planes); //通道分离,生成bgr_planesp,bgr_planes,bgr_planes.
uchar *p=bgr_planes.ptr();
merge(bgr_planes,table);
------------------------------------------------------------------------------------------------------
#include "opencv2/opencv.hpp"
using namespace std;
using namespace cv;
int main()
{
Mat table(1, 256, CV_8U);
Mat a = imread("C:\\Users\\Administrator\\Desktop\\yingxiang\\tupian\\Lenna.jpg", IMREAD_GRAYSCALE);
uchar* p = table.ptr();
for (int i = 0; i < 256; i++)
{
if (i > 100 && i <= 192)
p = 0;
else
p = i;
}
Mat b;
LUT(a, table, b);
imshow("NEW IMAGE", b);
waitKey(0);
return 0;
}
结合两段代码进行图片三通道显示。
跪求大神,万分感谢!!!! {:10_266:}{:10_266:}{:10_266:}我不会
页:
[1]