這裏是代碼片段:轉換1通道墊至3通道墊
private void loadImage(String path)
{
originalImage = Highgui.imread(path);
Log.i(TAG, "Number Of Channels: " + originalImage.channels());
Mat rgbImage = new Mat();
sampledImage = new Mat();
Mat out = new Mat(); // Added
List<Mat> in = new ArrayList<>();// Added
in.add(originalImage);// Added
in.add(originalImage);// Added
in.add(originalImage);// Added
Core.merge(in, out);// Added
Log.i(TAG, "Number Of OUT Channels: " + out.channels());
Imgproc.cvtColor(originalImage, rgbImage, Imgproc.COLOR_BGR2RGB); // error here
originalImage
是1信道和我需要將其轉換爲3通道。從上面的代碼生成的out mat仍然是1通道。我如何將外面的墊子轉換成3聲道?