This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat m = new Mat(@"C:\Users\Public\Pictures\Sample Pictures\tu.jpg"); | |
Cv2.ImShow("before", m); | |
Mat m2 = new Mat(m.Height, m.Width, MatType.CV_8UC3); | |
for (int i = 0; i < m2.Height; i++){ | |
for (int j = 0; j < m2.Width; j++){ | |
byte by = 255; | |
Vec3b pix = m2.At<Vec3b>(i, j); | |
pix[0]=0; //B | |
pix[1] = by; //G | |
pix[2]=0; //R | |
m2.Set<Vec3b>(i, j, pix); | |
} | |
} | |
Cv2.ImShow("after", m2); |
0 件のコメント:
コメントを投稿