pieye / nimbus-python

nimbus python bindings
GNU General Public License v3.0
3 stars 3 forks source link

IR image like in web-visualizer #9

Closed 9and3 closed 2 years ago

9and3 commented 2 years ago

Hello!

I was wondering how it would be possible to get the IR image as shown in the Nimbus 3D-visualizer (see image below): image I have tried the snippet proposed in the repo:

from nimbusPython import NimbusClient
import time

cli = NimbusClient.NimbusClient('192.168.1.38')
cli.enaRawMode(True)
time.sleep(1) #<-- there might be still some 3D images in the pipeline
header, img = cli.getImage()
imgType = int(header[NimbusClient.HeaderImgType])
if imgType == NimbusClient.NimbusImageRaw:
    print ("raw images received")
    print(img)
else:
    print ("something went wrong...")
    #-> repeat image readout (cli.getImage())

Without any succeess, it seems that enabling the Raw Mode isn working in my case. So I was wondering if there is any way to obtain or recompose the IR image matrix from the other image grabber:

header, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)

Many thanks for any suggestion or help!

bjajoh commented 2 years ago

Hi @9and3,

Raw Mode means actually sensor raw data. Which can't be visualized by the web interface and does only include the phase information of the actual imager. You probably want cli.enaRawMode(False) in order to see the sensor data in a meaningful representation.

In order to read the sensor data try that script mentioned earlier: from nimbusPython import NimbusClient cli = NimbusClient.NimbusClient("192.168.0.69") header, (ampl, radial, x, y, z, conf) = cli.getImage(invalidAsNan=True)

Simply visualize the ampl and you should have the intensity image.

9and3 commented 2 years ago

Hello @bjajoh , thank you once again for your prompt feedback. Indeed, I was able to build a uint8 matrix and visualize it, thank you for the help!