Image conversion in OpenCV C#
问题 Image<bgr,byte> WeightedImg; . . double color; for (int i = 0; i < dataArray.Length; i++){ color = dataArray[i, 2]; WeightedImg.Bitmap.SetPixel(x, y,Color.FromArgb((int)Math.Ceiling(color * R), (int)Math.Ceiling(color * G),(int)Math.Ceiling(color * B))); } this line: WeightedImg.Bitmap.SetPixel(x, y,Color.FromArgb((int)Math.Ceiling(color * R), (int)Math.Ceiling(color * G),(int)Math.Ceiling(color * B))); makes the program crash .. I want to set a pixel in a WeightedImg according to a double