Noise when turning off automatic gain control on the FLIR Lepton

Hi, thank you so much for your reply, and the first one is the output of the OpenMV system, here is the code snippet:

import sensor
import time

# Set the target temp range here
min_temp_in_celsius = 160.0
max_temp_in_celsius = 240.0

print("Resetting Lepton...")
# These settings are applied on reset
sensor.reset()
sensor.ioctl(sensor.IOCTL_LEPTON_SET_MEASUREMENT_MODE, True, True)
sensor.ioctl(
    sensor.IOCTL_LEPTON_SET_MEASUREMENT_RANGE, min_temp_in_celsius, max_temp_in_celsius
)
print(
    "Lepton Res (%dx%d)"
    % (
        sensor.ioctl(sensor.IOCTL_LEPTON_GET_WIDTH),
        sensor.ioctl(sensor.IOCTL_LEPTON_GET_HEIGHT),
    )
)
print(
    "Radiometry Available: "
    + ("Yes" if sensor.ioctl(sensor.IOCTL_LEPTON_GET_RADIOMETRY) else "No")
)

print("temperature range:", sensor.ioctl(sensor.IOCTL_LEPTON_GET_MEASUREMENT_RANGE))
print("Measure mode:", sensor.ioctl(sensor.IOCTL_LEPTON_GET_MEASUREMENT_MODE))

sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QQVGA)
#sensor.set_vflip(True)
sensor.skip_frames(time=5000)
clock = time.clock()


while True:
    clock.tick()  # Update the FPS clock.
    img = sensor.snapshot()  # Take a picture and return the image.
    print(clock.fps())  # Note: OpenMV Cam runs about half as fast when connected
    # to the IDE. The FPS should increase once disconnected.

The frame size is QQVGA, the same as the resolution of the FILR’s highest resolution (160x120). I am wondering what caused the black and white in the image as well.

The upper and lower black white may be caused by vacuum for perceive, the remote background doesn’t have any right measure value, and it shows in black and white, but it doesn’t make sense that there are black and white noise in the area with temperature. I am not sure whether it is caused by the sensor defect or wrong setup of the sensor.

I tried to take a thermal picture in the range of 25-40 degree as well, and the image(the first one below) in the low temperature mode ( with set of ‘‘sensor.ioctl(sensor.IOCTL_LEPTON_SET_MEASUREMENT_MODE, True)’’ ) looks better than the one in the high temperature mode (the second one below)

low temp mode.bmp (56.3 KB)
high temp mode.bmp (56.3 KB)

The image in high temperature mode shows a lot of black and white in the area of the clothes, maybe it is caused by the gain problem.

Thank you for your help in advance!