9def print_search_result(search_result):
11 for result
in search_result:
15 quality = result.quality
17 angle = result.rotation.deg
18 print(
' {0:2d} Position=[{1:.2f},{2:.2f}], Quality={3:.2f}, Angle={4:.2f}'.format(i, x, y, quality, angle))
20sf_example_path =
"tutorial/ShapeFinder/Images/SF2/Lusterterminal"
25 cvb.AcquisitionStack.Vin)
as device:
27 stream = device.stream()
33 image, status = stream.wait()
34 if status == cvb.WaitStatus.Ok:
35 res = classifier.search_all(device.device_image.planes[0], device.device_image.bounds, cvb.shapefinder2.PrecisionMode.CorrelationFine, 0.55, 20, 10)
36 print(
'Result for image {0:2d}:'.format(i+1))
37 print(
' Number of search results: {0:2d}'.format(len(res)))
38 print_search_result(res)
Union[cvb.GenICamDevice, cvb.VinDevice, cvb.EmuDevice, cvb.VideoDevice, cvb.NonStreamingDevice] open(str provider, int acquisition_stack=cvb.AcquisitionStack.PreferVin)
Opens a device with the given provider and acquisition stack.
Definition: __init__.py:1570
ShapeFinder2 classifier object.
Definition: __init__.py:20
Common Vision Blox ShapeFinder module for Python.
Definition: __init__.py:1
str install_path()
Directory Common Vision Blox has been installed to.
Definition: __init__.py:8257