【发布时间】:2018-03-08 16:00:28
【问题描述】:
谁能告诉我这个c++代码sn-p的正确java代码:
output.at(x, y) = target.at(dx, dy);
我已经尝试过这个 java 代码,它们正在置换像素但没有清楚地显示图像:
output.put(x, y, target.get(dx, dy));
【问题讨论】:
标签: image-processing overlay opencv3.0 alphablending
谁能告诉我这个c++代码sn-p的正确java代码:
output.at(x, y) = target.at(dx, dy);
我已经尝试过这个 java 代码,它们正在置换像素但没有清楚地显示图像:
output.put(x, y, target.get(dx, dy));
【问题讨论】:
标签: image-processing overlay opencv3.0 alphablending
对于一个通道图像,例如灰度; 0~255
获取像素值
double pixelValue = image.get(i,j)[0];
设置像素值
image.put(i,j,230);
对于 3 通道图像,例如RGB(3个值0~255)
获取一个像素(double[] 数组会有 3 个值)
double[] pixelValue = image.get(i,j);
设置一个具有 3 个 RGB 值的像素
image.put(i,j,255,250,100); // yellow color
【讨论】: