Now I try to use CVB to connect with a Gocator camera. The image captured by Gocator can be shown in GenICamBrowser very well. However, when I tried to show the image through a python script, the captured image is black, the maximum pixel value is 0.
with cvb.DeviceFactory.open(cvb.install_path() + "/drivers/GenICam.vin") as vin_device:
# asuming that the vin driver configures 3 buffers by default.
#vin_device.stream.ring_buffer.change_count(5, cvb.DeviceUpdateMode.UpdateDeviceImage)
# Get the device node map, which groups all settings for your camera (device)
device_node_map = vin_device.node_maps["Device"]
# access the camera feature
stream = vin_device.stream
# start the stream
stream.start()
# Wait for new image
image, status = stream.wait_for(60000)
print(cvb.as_array(image, copy=False).max())
if status == cvb.WaitStatus.Ok:
print("Buffer: " + str(image.buffer_index))
array_image = cvb.as_array(image, copy=False)
print(array_image.flags['OWNDATA'])
np_array_3D = np.asarray(array_image)
print("max value", np_array_3D.max())
did you try to get an image in the Common Vision Blox Viewer? In case you already receiva a black image here the issue is not CVBpy related.
Which settings did you use in the GenICam driver? Is the color format set to RAW?
Can you verify that commands are received at the Gocator (cheking over the Webinterface)?
Can you verify the the Gocator is grabbing and CVB is receiving (frame count) and only the received images/datapackages contain 0 valued pixel?
Thanks for your help. After I change the color format from auto to RAW, the depth camera works.
However, now I have met another question. In our camera system, we have two cameras, one is an RGB camera, the other is Gocator. I want to get the streams from them together, and their trigger method is the same. However, if I run two separate python scripts, like rgb.py and depth.py,
# rgb.py
with open("...GenICam.vin", port=0) as vin_device:
# related codes to get the stream
# depth.py
with open("...GenICam.vin", port=1) as vin_device:
# related codes to get the depth stream
I can get the RGB and depth images.
However, if I use threads to get the images, the depth camera can not capture the image, the code is like:
# main.py
Thread(function rgb)
Thread(function depth)
# function rgb
with open("...GenICam.vin", port=0) as vin_device:
# related codes to get the stream
# function depth
with open("...GenICam.vin", port=1) as vin_device:
# related codes to get the depth stream
In summary, if I run two python scripts separately, everything is perfect. If I want to integrate them in multi threads and run the code in one script, one of the cameras cannot receive images. Should I use StreamingParallel or StreamingAsync to get the streams?
this might be due python not being very neat when it comes to multithreading.
I suggest you to have a closer look at the following examples in your cvb installation folder/tutorials/image manager:
StreamingParallel
StreamingSimple
Thanks for your reply. When I tried to run the code StreamingSimple, there is an error "module âcvbâ has no attribute âAcquisitionsStackâ.`
The version of cvb manager console is: 13.04
cvbpy is: 1.1
Sorry to bother you again. Now I meet a new problem.
In our project, we use a color camera (Teledyne DALSA Linea C2048-7um) and two depth cameras (Gocator 2340, configured in master slave configuration). Due to previous decisions, the color and 3D cameras have been put in different subnets (192.168.2.X and 192.168.3.X respectively).
A change in PC now limits us to just one build-in ethernet port (Intel I225-V), which we have configured to handle VLANs (eight in total). The trunk coming from the PC is then split by a managed switch (Ubiquiti EdgeSwitch 8) to connect to all separate networks. This setup allows us to use only one ethernet port on the PC while separating all devices from each other.
The weird thing is: If the color camera is connected with the computer via the switch (over VLAN 4033), it cannot be detected by the GenIcamBrowser. However, if we ping the IP address of the line camera (192.168.2.20), we do get a reply from the line camera. Moreover, when the depth camera (master 192.168.3.11 & slave 192.168.3.12) are connected to the computer via the switch (over VLAN 4034), they can be detected by the GenIcamBrowser.
The IP addresses of the virtual ports on the PC are set to 192.168.2.253 and 192.168.3.253 for VLAN 4033 and 4034 respectively.
@usernv do you have some input on this?
I would have assumed windows to not be able to handle multiple virtual ports on 1 physical port correctly, but as the camera can be pinged I cant help but think that CVB somehow has a problem here.
I think youâll need to add both IPs to the NIC to access them. The ping might have a different subnet mask and might find the device. Can you try adding the other IP as well?
Leaving the PC configuration unchanged, several network constructions were tested;
The setup weâd like to get working, using the managed switch to trunk the different VLANs over one cable to the PCâs NIC. The untagged VLANs are 4033 and 4034 in respectively port 5 and 6.
The setup we used to check whether the switch is set up correctly to support all communication protocols needed. This 3rd setup mixes the 1st and 2nd. All the VLANs are trunked from one switch to the other. Where VLAN 4033 is untagged on port 7. VLAN 1 is untagged on port 8, accompanied by all the other VLANs (apart from 4033) as tagged networks. Switch port 7 is connected to the USB dongle and switch port 8 to the native Intel NIC.
Setup 2 and 3 work perfectly, but when using setup 1 GenICamBrowser isnât discovering the color camera. Leading to the conclusion that there are no issues caused by the switch configuration.
As a reply to your last message; we assigned each virtual adapter its own unique IP, corresponding to the subnet used within that VLAN.
this is something we would have to have a more detailed look at and maybe even try to reproduce here in our office.
So if you would be so kind to contact your local sales or support contact here at Stemmer.