Jump to content

Ravi

Members
  • Gesamte Inhalte

    11
  • Benutzer seit

  • Letzter Besuch

Posts erstellt von Ravi

  1. Hi, 

    • Ich habe eine andere Thermal Imaging Bricklet. Ich habe es damit versucht und es hat funktioniert. Mit dieser Kamera habe ich es zum ersten Mal versucht. 
    • brickd --version: 2.4.1
      Brick Viewer Version: 2.4.12
      Aber andere Thermal Imaging Bricklet funktionieren einwandfrei. 
    • Ich habe den Sensor überprüft und alles sieht gut aus. 
    • Ich habe das Bricklet mit HAT Zero verbunden und den Brick Viewer geöffnet. Den Connect Button gedrückt. Es verbindet sich mit dem HAT Zero und dem Bricklet. Es zeigt mir aber nicht die Temperaturwerte an und es ist nicht möglich die ROI auszuwählen. 
  2. Hallo, 
    Ich verwende das Thermal Imaging Bricklet und den HAT Zero Brick mit dem Raspberry Pi 4 B.  
    Wenn ich das Bricklet über den Brick Viewer verbinde, zeigt es die Temperaturwerte nicht an. Es zeigt nur "TBD" an. Bitte sehen Sie sich den Screenshot im Anhang an. 
    Was kann das Problem sein? 

    Danke!

    IR_Camera_Error.png

  3. Hi, 

    I am using thermal sensor and HAT Zero with Raaspberry Pi. I wanted to set ROI from my python script to get temperature. I have tried setting the ROI using ti.set_spotmeter_config(first_column=20, first_row = 20, last_column = 40, last_row = 40).  It is giving me this kind of error. 

        TypeError: set_spotmeter_config() takes 2 positional arguments but 5 were given

    How can I resolve this error? 

    code: 

     

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-

    #
    # Shows live thermal image video in Tk window
    #

    HOST = "localhost"
    PORT = 4223
    UID = "LcZ" # Change XYZ to the UID of your Thermal Imaging Bricklet

    from tinkerforge.ip_connection import IPConnection
    from tinkerforge.bricklet_thermal_imaging import BrickletThermalImaging

    import math
    import time
    try:
        from Tkinter import Tk, Canvas, PhotoImage, mainloop, Label # Python 2
        from Queue import Queue, Empty
    except:
        from tkinter import Tk, Canvas, PhotoImage, mainloop, Label # Python 3
        from queue import Queue, Empty

    from PIL import Image, ImageTk

    WIDTH  = 80
    HEIGHT = 60
    SCALE  = 10 # Use scale 5 for 400x300 window size (change for different size). Use scale -1 for maximized mode

    image_queue = Queue()

    # Creates standard thermal image color palette (blue=cold, red=hot)
    def get_thermal_image_color_palette():
        palette = []

        for x in range(256):
            x /= 255.0
            palette.append(int(round(255*math.sqrt(x))))                  # RED
            palette.append(int(round(255*pow(x, 3))))                     # GREEN
            if math.sin(2 * math.pi * x) >= 0:
                palette.append(int(round(255*math.sin(2 * math.pi * x)))) # BLUE
            else:
                palette.append(0)

        return palette

    # Callback function for high contrast image
    def cb_high_contrast_image(image):
        # Save image to queue (for loop below)
        global image_queue
        image_queue.put(image)

    def on_closing(window, exit_queue):
        exit_queue.put(True)
        

    if __name__ == "__main__":
        ipcon = IPConnection() # Create IP connection
        ti = BrickletThermalImaging(UID, ipcon) # Create device object
        ipcon.connect(HOST, PORT) # Connect to brickd
        print (ti.get_spotmeter_config())
        ti.set_spotmeter_config(20,20,40,40)
        # Don't use device before ipcon is connected

        # Register illuminance callback to function cb_high_contrast_image
        ti.register_callback(ti.CALLBACK_HIGH_CONTRAST_IMAGE, cb_high_contrast_image)

        # Enable high contrast image transfer for callback
        ti.set_image_transfer_config(ti.IMAGE_TRANSFER_CALLBACK_HIGH_CONTRAST_IMAGE)
        
        # Create Tk window and label
        window = Tk()
        
        # Run maximized
        if SCALE == -1:        
            window.geometry("%dx%d+0+0" % (window.winfo_screenwidth(), window.winfo_screenheight()))
            window.update() # Update to resize the window
            
            w, h = window.winfo_width(), window.winfo_height()
            SCALE = min(w // WIDTH, h // HEIGHT)

        label = Label(window)
        label.pack()

        image = Image.new('P', (WIDTH, HEIGHT))
        # This puts a color palette into place, if you 
        # remove this line you will get a greyscale image.
        image.putpalette(get_thermal_image_color_palette())
        #ti.set_spotmeter_config(120,310,360,510)
        
        
        exit_queue = Queue()
        window.protocol("WM_DELETE_WINDOW", lambda: on_closing(window, exit_queue))

        while True:        
            try:
                exit_queue.get_nowait()
                break # If the exit_queue is not empty, the window was closed.
            except Empty:
                pass
            
            # Get image from queue (blocks as long as no data available)
            image_data = image_queue.get(True)

            # Use original width/height to put data and resize again afterwards
            image = image.resize((WIDTH, HEIGHT))
            image.putdata(image_data)
            image = image.resize((WIDTH*SCALE, HEIGHT*SCALE), Image.ANTIALIAS)

            # Translate PIL Image to Tk PhotoImageShow and show as label
            photo_image = ImageTk.PhotoImage(image)
            label.configure(image=photo_image)
            
            y = ti.get_statistics()
            z = ((y[0][1]*655)/65535)- 273
            print (z)
            
            window.update()
            
        window.destroy()

  4. Hi, 

    I am using HAT zero Brick and Thermal sensor by FLIR. I am using these components since last 1 week or something and they were working fine until now. Now whenever I am trying to connect it via python script, I am just getting one response, did not receive response. I have also tried to connect it via brick viewer and there is not response at all. I have checked the host address, port address and UID, everything is correct. The shutter of the thermal sensor works some time. Tried attaching sensor at other ports B, and D, but the same response. What can be the problem here? 

    thanks in advance. 

    Ravi

  5. Dear Sir/Madam. 

    We just bought thermal camera from you. It came without any cable connection. We want to buy cable to connect the camera with Raspberry Pi. Can you please suggest any cable to connect it with Raspberry Pi? 

    Kind Regards,

    Ravi

×
×
  • Neu erstellen...