I am trying to convert a bitmap to y intensity 2D array in c# . Then from the 2D array I want to extract a window and save its intensity sum value (all intensity values) in a single variable. But it not working, Does anyone know how I can display the content of my 2D intensity array seeing that I am using a form or how to display my extracted window intensity values to check the final sum comes out right .
All help is very appreciated
Here is my code so far
int iix, iiy;
double[,] IntensityArray;
IntensityArray = new double[160, 140];
Bitmap RRR = new Bitmap("File Location");
for (iix = 0; iix < 160; iix++)
{
for (iiy = 0; iiy < 140; iiy++)
{
IntensityArray[iix, iiy] = .299 * LLL.GetPixel(iix, iiy).R + .587 * LLL.GetPixel(iix, iiy).G + .114 * LLL.GetPixel(iix, iiy).B;
}
// here i am extracting a window from the centre of the image
for (ix = 40; ix < 46; ix++)
{
double D1 = IntensityArray[70,ix];
double D2 = IntensityArray[71,ix];
double D3 = IntensityArray[71,ix];
//i would now like to add my results together in one variable so i can obtain
//the total intensity value for my window
double TOT-Intensity =new double {D1+D2+D3};
}

New Topic/Question
This topic is locked




MultiQuote


|