-
Notifications
You must be signed in to change notification settings - Fork 1
JPBitMap
user29A edited this page Jan 4, 2022
·
7 revisions
Class for converting 2D image data arrays to bitmaps, including three layer images for color image bitmaps, and single layers as grayscale or artificial color.
public static unsafe Bitmap ArrayToBmp(double[,] image, int scaling, int colour, bool invert, double[] DImCLim, int WinWidth, int WinHeight, bool invertYaxis)
Convert a single layer 2D image to grayscale bitmap object.
-
image
The image data array -
scaling
Data scaling: 0 = linear; 1 = square root; 2 = squared; 3 = log. -
colour
Artificial color mapping: 0 = grayscale; 1 = jet; 2 = winter; 3 = lines (detects contours and edges). -
invert
Invert tone...i.e. black becomes white. -
DImCLim
The image contrast limits. A 2-element vector which clips the low (element 1) and high (element 2) values of the image array when forming the bitmap. Suggest [mean(image)-0.5stdv(image) mean(image)+5stdv(image)] -
WinWidth
If it is a small image required, the function will bin if necessary. If no binning desired then set to Int32.Maxvalue. -
WinHeight
If it is a small image required, the function will bin if necessary. If no binning desired then set to Int32.Maxvalue. -
invertYaxis
Flip the image vertically...i.e. about the central horizontal axis.
public static unsafe Bitmap RGBBitMap(double[,] R, double[,] G, double[,] B)
Convert three 2D arrays representing R (reg), G (green), and B (blue) channels to a color image Bitmap. The R,G,B arrays must already be scaled to 24Bpp Bitmap range, i.e. values between 0 - 255.
-
R
The RED channel array. -
G
The GREEN channel array. -
B
The BLUE channel array.