Up | Draw | Overlay | Tool | Toollist | Timer | SPB | Camera | CameraImage | Bitmap | Historylist - ImageBuffer | Clipboard | ScorpionGeometry | Statistics | States | Logging | Panels | Shared Memory | BarCode Reader | StdCtrls

Release Notes

  

CameraImage
The CameraImage class

Use the function

  • GetCameraImage(name)

to retrieve an instance of the class.

Attribute Access Type Description
name R string the name of the camera image
active R/W 0/1 active state
camera R/W string name of connected camera
cameraNo R/W int camerano of connected camera (zero index, 0..n-1)
rotation R/W 0/1 0=None, 1=90, 2=180, 3=-90, 4=VFlip, 5=HFlip
simulation R/W 0/1 current state of individual simulation flag
path R/W string image path when simulation
filter R/W string image filter when simulation (ex : *_0.bmp, *_1.jpg, *.* )
fileRotation R/W int rotation when in simulation, values see above for values
filename R string filename of current image in simulation mode
grabDuration R int duration between grab command and received image of last image

 

Method Returns Description
resetFilename() 0/1 resets the filename in simulation mode (reset simulation cycle)

The CameraImages class

Use the function

  • GetCameraImages()

to get the list of all defined cameras in Scorpion.

Attribute Access Type Description
count R int number of defined cameras in system
simulation R/W 0/1 state of simulation, an active simulation state overrides the individual settings and sets all cameras in simulation mode
path W string sets path for all camera images.
Note that this is write only since each CameraImage may have individual paths. It is recommended to read the path of camera 1 if you want to set all paths equal
defaultPath R string default path when adding camera images, equals the profile path
Method Returns Description
get(index) CameraImage returns a CameraImage instanse if valid index
getCameraImage(name) CameraImage returns a CameraImage instanse if valid name
resetFilenames() 0/1 resets filenames for all cameraImages in simulation mode (resets simulation cycle)

Example 1: Change simulation path according to context

def Handle_System_AfterContextChange(Context):
  #
  # Context = VT_BSTR
  #

  #set path of simulation images
  imgs=GetCameraImages()
  imgs.path=imgs.defaultPath+'\\'+Context

  for i in range(imgs.count):
    if Context=='V1':                              #the simulation images are JPEG's for product V1, the other products are bmps
      imgs.get(i).filter='*_%i.jpg' % i
    else:
      imgs.get(i).filter='*_%i.bmp' % i

  return 0

Example 2: Reset filename for simulation

def ResetSimulation(path):
  imgs=GetCameraImages()
  imgs.resetFilenames()           #resets simulation filename cycle

Example 3: Change the cameraNo by cameraName

def ChangeCamera(image, cameraNo):
  camImg=GetCameraImage(image)      #get camera image by name
  camImg.cameraNo=cameraNo             #set the attached camera

Example 4: ImageNo by ImageName

def GetImageNoByImageName(name):
  camImages=GetCameraImages()
  for index in range(camImages.count):
    if camImages.get(index).name == name:
      return index
  return -1

 

 

 

Scorpion Vision Software Version: 9.2.0.515 - Date: 20120502
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2012 Tordivel AS.