3
votes

I want to try view the image using spyder python as in:

skydrive share the image is:

  • uint16 (10-bit)
  • width:1376 pixel, height: 960 pixel
  • no header
  • bayer pattern blue-green, green-red

What python script is suitable?

Thanks.

1
Please have a try on this first and post the code snippet or error if you are facing some issue - RinoTom
Look here - will
also note that this is about "image processing" not about the "processing" programming language. - Mike 'Pomax' Kamermans
You could split this into 3 or 4 steps and each would be a question on its own. 1) How to read the image. 2) Bayer demosaicing. 3) Converting from a linear colorspace to something gamma corrected such as sRGB. 4) Applying white balance or color correction. - Mark Ransom
this is what I get from [link]kyb.tuebingen.mpg.de/?id=227 <!-- language: lang-none --> fin = open('001.raw', 'rb') s = fin.read() fin.close() arr = array.array('H', s) arr.byteswap() img = numpy.array(arr, dtype='uint16').reshape(960,1376) imshow(img, gray()); - bahgia minhat

1 Answers

4
votes

Here is one way.

Start with imports

from matplotlib import pyplot as plt
import numpy as np

Now allocate the space

image = np.empty((1376,960), np.uint16)

Read the image into your array:

image.data[:] = open('20_1-20ms.raw').read()

Display it:

plt.imshow(image)