I’m trying to acquire some images using a DAHUA MV-A7500MG20E camera.
The issue I’m facing is that when I take an image, sometimes it has horizontal stripes (I uploaded an image for reference).
What am I doing wrong?
please have a look at the tutorial StreamingSimple which comes with your full CVB installation. It can be found under %CVB%Tutorial\Image Manager\CVBpy\StreamingSimple.py
We highly recommend to have at least three buffers available for the ringbuffer. You only need to call stream.wait() once every time a new image is needed. If you only need to acquire an image once in a while, you could also use image, status = stream.get_snapshot() but without starting the stream. This will start the stream, aquire one image and stop the stream again.
To save the image, you can just use image.save( 'image_' + str(0) + '.png') which is part of CVB.
Regarding the striped image, please refer to our GEV setup guide for the recommended settings of your network card etc. https://help.commonvisionblox.com/NextGen/14.0/md_theory_of_operation_hardware__gen_i_cam__c_v_b__user_guide.html#gcug_chmtopic26
You can also check your camera setup using the GenICam browser which should help tweaking the camera configuration until the image is normal.Saving the configuration there will keep your changes and the camera will produce the same result when loaded in code e.g. using the StreamingSimple.py example.
First of all I changed my code to just take one snapshot (I don’t need a continuous data stream).
Then I checked the link you suggested and I tried to setup new values for the MTU. Unfortunately when I try MTU values above 1500, my Rasperry giver back an error.
$ sudo ip link set eth0 mtu 8192
> Error: mtu greater than device maximum.
So I decided to lower the width and height of the image from 2448x2048 to 1748x1748 and now I obtain a better image, without frame loss or stripes.
Just one more thing: how can I change the width and height of the image provided by the device through python code?
normally you should be able to send the full image over the network but if changing the resolution works fine for you, you can change the resolution using the device node map:
Thank you, it worked perfectly!
Where can I find all the device_node_map parameters that can be changed? I’d like to set the static IP from my python script.
The parameters of your device nodemap consist of standard parameters (starting with Std:: ) and camera dependent parameters. I think the easiest way to check for them is to use the GenICam browser. Configure the cameras IP and open it. You can then:
Change the NodeMap by clicking the four bars in the top right corner --> Selected NodeMap (also set Max visibility to Guru)
Look through the sorted NodeMap parameters or use the search bar in the top right corner
When you highlight an individual node, you can see additional information on it like the data type, max min values and if it is writable/readable.
For setting the cameras IP address, maybe you can refer to this thread with an example in C++ and C# linked in it as well. Our Python Api wrapps the C++ Api and has the same or at least very similar naming to our other Apis. If you have any problems in adapting the code please let me know.
I noticed that the missing frames are related to a previous image (when they are not black stripes), so I decided to use 2 times the function image, status = stream.get_snapshot() and now the obtained image doesn’t seem to have any problem even using the full camera resolution (I had to switch to a different camera, A5501MG20E, that has a slightly higher resolution).
get_snapshot() should just return one new image. My explanation would be that the first image is not completely written into the buffer which can happen when the connection is faulty. The second attempt might work since the last trigger wasn’t too long ago and hence the camera internally reacts faster now.