0 Replies - 1984 Views - Last Post: 08 January 2009 - 06:40 AM Rate Topic: -----

#1 addzy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-January 09

Converting a bitmap to a 2D intensity array then extracting a window f

Posted 08 January 2009 - 06:40 AM

Dear all

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};

}


Is This A Good Question/Topic? 0
  • +

Page 1 of 1