Comments (2)
I am not quite sure what you mean by "get the image frame out". The frame callback function is called by Vimba when a new frame is available and is the place where you would ideally perform your image processing before handing the frame object back to be refilled by requeuing it for the camera. This means that you would then simply pass out the result of your image processing from the frame callback via some thread safe object (e.g. a queue).
If you must to use the image data somewhere else one way to do this would be to copy the image data (for example as a numpy array) into a processing queue from which your code would take it. One example of how you might achieve this can be found in the multithreading_opencv example. Here you have a FrameProducer
class, which contains the frame callback function. In this function the received frame is copied and the copy placed in a queue.Queue
. By creating a copy of the frame the original frame object can be requeued for the camera to capture more images.
A second class, the FrameConsumer
takes the copied frame object from the processing queue and performs whatever analysis you need. In the case of this example the image is simply resized if it is too large and then displayed.
I hope this helps you in finding an approach for your particular problem. If you can give further details of what you want to accomplish I might be able to provide more concrete suggestions on what you could try to get the image data into your processing system.
from vimbapython.
Are you just looking for a more basic example? Maybe this help:
from vimba import *
import cv2
with Vimba.get_instance () as vimba:
cams = vimba.get_all_cameras ()
with cams [0] as cam:
# Aquire single frame synchronously
frame = cam.get_frame ()
frame.convert_pixel_format(PixelFormat.Bgr8)
cv2.imshow("test", frame.as_opencv_image ())
cv2.waitKey(0)
Edits: Figuring out how to post code.
from vimbapython.
Related Issues (20)
- When we run multithreading_opencv.py we get a Windows blue screen of death :( HOT 1
- multithreading_opencv.py cannot handle 3 or more camera HOT 5
- Long delay between SW trigger and handler function. HOT 2
- 'No TL detected. Please verify Vimba installation.' HOT 1
- Any way for checking if the camera is open or shut? HOT 1
- configuration of the various cameras using a configuration file HOT 1
- Frames missed and frame status if incomplete for 1800 U-2050c HOT 1
- Multiple Vimba installations found. Can't decide which to select HOT 5
- multithreading with 3 camera HOT 4
- Receiving incomplete frames during multithreding with 2 cameras HOT 3
- Process vs. Thread for multithreading
- vmbpy.c_binding.vmb_common.VmbCError: VmbCError(<VmbError.IO: -20>) HOT 5
- error
- retries exceeded HOT 7
- Asynchronous Grab - FrameStatus Incomplete after about 10 hours of running HOT 6
- Convert Mono12 Frame to Bitmap HOT 3
- Exception with DiscoveryInterfaceEvent HOT 8
- Unable to change PixelFormat with AccessMode.Full HOT 3
- How to run the asynchronous mode infinitely in Allied Vision Vimba SDK camera? HOT 3
- Handling of frame data in Start_Streaming@buffer when Acquisition Stop is performed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vimbapython.