You can access the Image pixels in many ways:1. One using the Inbuilt macro2. One using the pointer to the image data3. Getting the raw data from the image. ============================================================Method 1: Using Inbuilt macro:CV_
要做一个抠图应用,所以随手做了个鼠标取色,代码如下: void mousePressed(){ int imgC = get(mouseX,mouseY); int R = (imgC >> 16) & 0xFF; int G = (imgC >> 8) & 0xFF; int B = imgC & 0xFF; println("Current position color: Red = "+R+", Green = "
int x, y; x = e.X; y = e.Y; Color pixel = MyImage.GetPixel(x, y); byte R = pixel.R; byte G = pixel.G; byte B = pixel.B; pixel_R.Text = R.ToString(); pixel_G.Text = G.ToString(); pixel_B.Text = B.ToString();