|
Overlay Algorithms
Creating Bitmaps from Camera Images
Before bitmap manipulation can be performed, the camera images must be converted into bitmaps. A framegrabber acquires an image by digitizing the camera signal and writing the data into a memory buffer. This buffer cannot be directly displayed in a Microsoft Window. These data, usually referred to as pixels (picture elements) must first be converted into a color bitmap from 8-bit monochrome and copied into a window with a header attached. Use the windows API, Create Device Independent Bitmap. You must also create a palette of 256 shades of gray corresponding to the range of values of the 8-bit intensity value of the monochrome pixels.
HBITMAP CreateDIBitmap (hdc, lpbmih, dwinit, lpvBits, lpbmi, fnColorUse)
hdchandle of device context lpbmihpoints to BITMAPINFOHEADER dwinitinitializes bitmap with values of lpvbits and lpbmi lpvbitspoints to a byte array of bitmap values lpbmipoints to structure describing dimensions and color formats fnColorUsespecify that bmicolors are indices to palette
Return Handle to bitmap
Draw the image on the screen by putting the bitmap in a window with a device context of the monitor parameters. To display a grayscale image in 24-bit color format the 8-bit intensity value from the digitizing framegrabber is equal for red, green and blue. This will produce shades of gray from 00:00:00, black, to FF:FF:FF , white.
Page 1 2 3 4 5 6 |