Giter Club home page Giter Club logo

Comments (2)

NiklasKroeger-AlliedVision avatar NiklasKroeger-AlliedVision commented on September 27, 2024

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.

sixtemesseven avatar sixtemesseven commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.