一、图像像素赋值
Python:
image = cv2.imread("image path")
image[row, col, :] = image2[row, col, :]
image[row, col, 0] = image2[row, col, 0] # B
image[row, col, 1] = image2[row, col, 1] # G
image[row, col, 2] = image2[row, col, 2] # R
C++
cv::Mat image = cv::imread("image path");
image.at<cv::Vec3b>(row, col) = image2.at<cv::Vec3b>(row, col)
image.at<cv::Vec3b>(row, col)[0] = image2.at<cv::Vec3b>(row, col)[0]; // B
image.at<cv::Vec3b>(row, col)[0] = image2.at<cv::Vec3b>(row, col)[1]; // G
image.at<cv::Vec3b>(row, col)[0] = image2.at<cv::Vec3b>(row, col)[2]; // R