TOFcam modules examples

You can use the TOFcam modules to run your own scripts. Here are three examples for how you could start.

TOFcam660

 1import matplotlib.pyplot as plt
 2from epc.tofCam660 import TOFcam660
 3
 4# setup the camera
 5cam = TOFcam660()
 6cam.initialize()
 7
 8# print chip information
 9chipId, waferId = cam.device.get_chip_infos()
10print(f'Chip ID: {chipId}')
11print(f'Wafer ID: {waferId}')
12
13# change some settings
14cam.settings.set_modulation(frequency_mhz=12)
15
16# get distance image
17distance = cam.get_distance_image()
18
19# add your own code here to process the distance image
20...
21
22plt.imshow(distance, cmap='turbo', vmin=0, vmax=30000)
23plt.colorbar()
24plt.show()

TOFcam635

 1import matplotlib.pyplot as plt
 2from epc.tofCam635 import TOFcam635
 3
 4# setup the camera
 5cam = TOFcam635()
 6cam.initialize()
 7
 8# print chip information
 9chipID, waferID = cam.device.get_chip_infos()
10print(f'Chip ID: {chipID}')
11print(f'Wafer ID: {waferID}')
12
13# change some settings
14cam.settings.set_integration_time(125)
15
16# get distance image
17distance = cam.get_distance_image()
18
19# add your own code here to process the distance image
20...
21
22# plot the distance image
23plt.imshow(distance, cmap='turbo', vmin=0, vmax=5000)
24plt.axis('off')
25plt.title('TOFcam635 - Distance Image')
26plt.colorbar()
27plt.show()

TOFcam611

 1import matplotlib.pyplot as plt
 2from epc.tofCam611 import TOFcam611
 3import time
 4
 5# setup the camera
 6cam = TOFcam611()
 7cam.initialize()
 8
 9# change some settings
10cam.settings.set_integration_time(50)
11
12# get distance image
13distance = cam.get_distance_image()
14
15# add your own code here to process the distance image
16...
17
18# plot the distance image
19plt.imshow(distance, cmap='turbo', vmin=0, vmax=5000)
20plt.axis('off')
21plt.title('TOFcam611 - Distance Image')
22plt.colorbar()
23plt.show()

“””