0

I am trying to do Data calibration of Hyperspectral Image of size e.g.,(400,400,150)i.e.,(rows. columns, bands) with standard references... dark image of size(100,400,150) and white Image of size (200,400,150) using the formula,
Calibrated_Data = (Image_data - dark Image) / (white Image - dark Image)

I am using the python, have tried to do using numpy but got an error,
"operands could not be broadcast together with shapes (400,400,150) (100,400,150)"

Also there is an another way to do it but not sure how can I do it in coding with different size matrices,
Calibrated_data(x, y, wavelengths) = data(x, y, wavelengths) - dark(x, wavelengths) / white(x, wavelengths) - dark(x, wavelengths)
Looking for some insights to solve this.
Thank you.

  • The first equation is not possible for images/matrices of different sizes. Not only in numpy but also mathematically. Is it possible that your images are of size (400,150) ? – joostblack Mar 08 '21 at 09:26
  • Yes, I am able to do that but the data_image is (400,400,150) and dark_image, white image of sizes (400,150) – Jr.Datascience Aspirant Mar 08 '21 at 09:29
  • what are your spatial dimensions and what are your spectral dimensions? I suspect that in your hyperspectral image your spatial dimensions are (400,150). But I could be wrong. – joostblack Mar 08 '21 at 09:34
  • Hii again, spatial dimensions are (400-lines, 400-samples) and spectral dimension is 150-bands – Jr.Datascience Aspirant Mar 08 '21 at 09:36
  • I am afraid that I cannot help you further as I do not know enough about this. I initially thought you had 2D images as in x-coordinates and y-coordinates and wavelengths. But I do not know how to calculate using lines and samples. – joostblack Mar 08 '21 at 09:41
  • For giving you some more information I have added those lines and samples because we scan and collect the data in that format. But you are right actually I have( x- coordinates, y-coordinates, wavelengths) What if I have same format as you mentioned, Is it possible to do calibration for that? – Jr.Datascience Aspirant Mar 08 '21 at 09:46
  • If you have x-coordinates and y-coordinates then you could use your first equation. Although then the white and dark image should have the same spacial and spectral conditions (same dimensions). source: https://hal.archives-ouvertes.fr/hal-00837756/document – joostblack Mar 08 '21 at 10:04
  • Thank you @joostblack, it was helpful to some extent! – Jr.Datascience Aspirant Mar 08 '21 at 14:19

0 Answers0