Coder Social home page Coder Social logo

Comments (5)

TIS-Stefan avatar TIS-Stefan commented on August 26, 2024

from ic-imaging-control-samples.

jonasze avatar jonasze commented on August 26, 2024

Hi Stefan,

I did but the error persists. I use the following code
`import ctypes as C
import tisgrabber as IC
import cv2
import numpy as np
import matplotlib.pyplot as plt

Camera = IC.TIS_CAM()

Devices = Camera.GetDevices()
for i in range(len( Devices )):
print( str(i) + " : " + str(Devices[i]))

Camera.open("DMK 33UX183 16910441")

Camera.SetVideoFormat('Y16 (5472x3648)')
Camera.SetFormat(IC.SinkFormats.Y16)
Camera.StartLive(0)

Camera.SetPropertySwitch("Exposure","Auto",0)
Camera.SetPropertyAbsoluteValue("Exposure","Value",2)
ExposureTime=[0]
Camera.GetPropertyAbsoluteValue("Exposure","Value",ExposureTime)
print("Exposure time abs: ", ExposureTime[0])

Gainauto=[0]
Camera.GetPropertySwitch("Gain","Auto",Gainauto)

Camera.SetPropertySwitch("Gain","Auto",0)
Camera.SetPropertyValue("Gain","Value",0)

Camera.SnapImage()
image = Camera.GetImageEx()
image = cv2.flip(image,0)
image = cv2.erode(image,np.ones((11, 11)))
image=np.right_shift(image,4)

Camera.StopLive() `

For e.g. exposure value 2 the variable image only contains zeros while for smaller integration times the image is as expected. I tested also small exposure times again and this time they work also for 1/20000.

from ic-imaging-control-samples.

TIS-Stefan avatar TIS-Stefan commented on August 26, 2024

I suppose, the Camera.SnapImage() returns to early or with an image taken to early. Call this twice and see, what happens.

Stefan

from ic-imaging-control-samples.

jonasze avatar jonasze commented on August 26, 2024

Your are correct and now I implemented a while loop that circumvents the problem:

image=0
while np.max(image)==0:
Camera.SnapImage()
image = Camera.GetImageEx()

from ic-imaging-control-samples.

TIS-Stefan avatar TIS-Stefan commented on August 26, 2024

The reason is the camera provides an image, before the new set exposure time comes in effect. That is the black one you see.

from ic-imaging-control-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.