Ok. To be short suppose:
-
I have a monochrome image; And initially it represented in RGB color space.
-
I don’t know in what sequence I shall do this, but I need to convert image to YUV space (a) and load it into
PictureBoxcontrol (b) and make few color scribbles; -
And finally I need to learn/know somehow what pixels were colored.
And how do I draw lines/dots on loaded image in
PictureBox?
Have any ideas?
Converting a monochrome image from RGB to YUV is very simple:
Y is the luminance, calculated as
0.299 * R + 0.587 * G + 0.114 * B, but as R = G = B for a monochome image, it’s the same as(0.299+0.587+0.114) * Rwhich is simply1 * R.U is calculated as
0.436 * ((B - Y) / 0.886), but as Y = B it is always zero.V is calculated as
0.615 * ((R - Y) / 0.701), but as Y = R it is alwaus zero.To draw lines on a
Bitmapobject, you use theGraphics.FromImagemethod to create aGraphicsobject for it, then use theDrawLinemethod to draw lines.To draw pixels, use the
SetPixelmethod of theBitmapobject.