
16.3
Using
131
#import numpy
devMgr = acquire.DeviceManager()
for
i in range(devMgr.deviceCount()):
pDev = devMgr.getDevice(i)
print(
"["
+ str(i) +
"]: "
+ pDev.serial.read() +
"("
+ pDev.product.read() +
", "
+ pDev.family.read()
, end=
’’
)
if
pDev.interfaceLayout.isValid:
conditionalSetProperty(pDev.interfaceLayout, acquire.dilGenICam)
print(
", interface layout: "
+ pDev.interfaceLayout.readS(), end=
’’
)
if
pDev.acquisitionStartStopBehaviour.isValid:
conditionalSetProperty(pDev.acquisitionStartStopBehaviour, acquire.assbUser)
print(
", acquisition start/stop behaviour: "
+ pDev.acquisitionStartStopBehaviour.readS(), end=
’’
)
if
pDev.isInUse():
print(
", !!!ALREADY IN USE!!!"
, end=
’’
)
print(")")
print("Please enter the number in front of the listed device followed by [ENTER] to open it: ", end=’’)
devNr =
int
(raw_input())
if (devNr < 0) or (devNr >= devMgr.deviceCount()):
print("Invalid selection!")
sys.exit(-1)
pDev = devMgr.getDevice(devNr)
pDev.open()
print("Please enter the number of buffers to capture followed by [ENTER]: ", end=’’)
framesToCapture =
int
(raw_input())
if framesToCapture < 1:
print("Invalid input! Please capture at least one image")
sys.exit(-1)
# The mvDisplay library is only available on Windows systems for now
isDisplayModuleAvailable = platform.system() ==
"Windows"
if
isDisplayModuleAvailable:
display = acquire.ImageDisplayWindow(
"A window created from Python"
)
else
:
print(
"The mvIMPACT Acquire display library is not available on this(’"
+ platform.system() +
"’)
system. Consider using the PIL(Python Image Library) and numpy(Numerical Python) packages instead. Have a look at
the source code of this application to get an idea how."
)
# For systems with NO mvDisplay library support
#channelType = numpy.uint16
if
channelBitDepth > 8
else
numpy.uint8
fi = acquire.FunctionInterface(pDev)
statistics = acquire.Statistics(pDev)
while
fi.imageRequestSingle() == acquire.DMR_NO_ERROR:
print(
"Buffer queued"
)
pPreviousRequest = None
manuallyStartAcquisitionIfNeeded(pDev, fi)
for i in range(framesToCapture):
requestNr = fi.imageRequestWaitFor(-1)
if fi.isRequestNrValid(requestNr):
pRequest = fi.getRequest(requestNr)
if pRequest.isOK():
if i%100 == 0:
print("Info from " + pDev.serial.read() +
": " + statistics.framesPerSecond.name() + ": " + statistics.framesPerSecond.readS
() +
", " + statistics.errorCount.name() + ": " + statistics.errorCount.readS() +
", " + statistics.captureTime_s.name() + ": " + statistics.captureTime_s.readS())
if isDisplayModuleAvailable:
display.GetImageDisplay().SetImage(pRequest)
display.GetImageDisplay().Update()
# For systems with NO mvDisplay library support
#cbuf = (ctypes.c_char * imageSize).from_address(long(req.imageData.read()))
#arr = numpy.fromstring(cbuf, dtype = channelType)
#arr.shape = (height, width, channelCount)
#if channelCount == 1:
#
img = Image.fromarray(arr)
#else:
#
img = Image.fromarray(arr, ’RGBA’ if alpha else ’RGB’)
if
pPreviousRequest != None:
pPreviousRequest.unlock()
pPreviousRequest = pRequest
fi.imageRequestSingle()
else
:
print(
"imageRequestWaitFor failed ("
+ str(requestNr) +
", "
+ ImpactAcquireException.
getErrorCodeAsString(requestNr) +
")"
)
manuallyStopAcquisitionIfNeeded(pDev, fi)
raw_input(
"Press Enter to continue..."
)
MATRIX VISION GmbH
Содержание mvBlueFOX
Страница 1: ...mvBlueFOX Technical Manual...
Страница 22: ...5 2 European Union Declaration of Conformity statement 15 MATRIX VISION GmbH...
Страница 23: ...16 CONTENTS MATRIX VISION GmbH...
Страница 24: ...5 3 Legal notice 17 5 3 Legal notice 5 3 1 For customers in the U S A MATRIX VISION GmbH...
Страница 53: ...46 CONTENTS Figure 3 D Sub 9 pin male digital I O MATRIX VISION GmbH...
Страница 117: ...110 CONTENTS MATRIX VISION GmbH...
Страница 201: ...194 CONTENTS 20 1 5 2 Color version MATRIX VISION GmbH...
Страница 202: ...20 1 mvBlueFOX Model 220 0 3 Mpix 640 x 480 195 20 1 5 3 Gray scale version MATRIX VISION GmbH...
Страница 203: ...196 CONTENTS MATRIX VISION GmbH...
Страница 210: ...20 2 mvBlueFOX Model 220a 0 3 Mpix 640 x 480 203 20 2 5 3 Gray scale version MATRIX VISION GmbH...
Страница 211: ...204 CONTENTS MATRIX VISION GmbH...
Страница 217: ...210 CONTENTS 20 3 5 2 Color version MATRIX VISION GmbH...
Страница 218: ...20 3 mvBlueFOX Model 221 0 8 Mpix 1024 x 768 211 20 3 5 3 Gray scale version MATRIX VISION GmbH...
Страница 219: ...212 CONTENTS MATRIX VISION GmbH...
Страница 220: ...20 3 mvBlueFOX Model 221 0 8 Mpix 1024 x 768 213 MATRIX VISION GmbH...
Страница 225: ...218 CONTENTS 20 4 5 2 Color version MATRIX VISION GmbH...
Страница 226: ...20 4 mvBlueFOX Model 223 1 4 Mpix 1360 x 1024 219 20 4 5 3 Gray scale version MATRIX VISION GmbH...
Страница 227: ...220 CONTENTS MATRIX VISION GmbH...
Страница 234: ...20 5 mvBlueFOX Model 224 1 9 Mpix 1600 x 1200 227 20 5 5 3 Gray scale version MATRIX VISION GmbH...
Страница 235: ...228 CONTENTS MATRIX VISION GmbH...