Code Monkey home page Code Monkey logo

Comments (11)

TIS-Kevin avatar TIS-Kevin commented on August 25, 2024

Dear Westin,

regarding our IC Imaging Control .NET Documentation there are multiple ways to create an instance of IFrameQueueBuffer.
You can find that here:
https://www.theimagingsource.com/support/documentation/ic-imaging-control-cpp/FrameQueueBuffer.htm

The Sample you are looking for can be found here:
https://github.com/TheImagingSource/IC-Imaging-Control-Samples/blob/master/Python/Python%20NET/qt5-mediastreamsink.py

Kevin

from ic-imaging-control-samples.

westin123 avatar westin123 commented on August 25, 2024

Kevin,

Thanks for the information. I have been using the tisgrabber library and now I'm wondering which I should be using. Is this possible with that library?

Thanks,

Westin

from ic-imaging-control-samples.

TIS-Kevin avatar TIS-Kevin commented on August 25, 2024

Dear Westin,

the tisgrabber dll is based on our IC Imaging Control. So yes you can work with the tisgrabber library. I noticed that i linked the wrong sample last time, because the sample just shows how to create a FrameBuffer but the sample "Imageprocessing.py" in our Python.NET directory on github shows how to use the iframequeuebuffer:
https://github.com/TheImagingSource/IC-Imaging-Control-Samples/blob/dc84380fdb8bcd2c11503da45a13bb30b8ba4b5c/Python/Python%20NET/qt5-imageprocessing.py

from ic-imaging-control-samples.

westin123 avatar westin123 commented on August 25, 2024

Hi, Kevin. I was away working on other things but I now have time to work on this again. I have not seen that functionality in the tisgrabber library and I'm not super familiar with how it pulls functions out of the dll. Can you show me what the python call would look like to do that with tisgrabber?

What is the purpose of having two libraries for Python with similar functionality? Ideally my code would work under both Windows and Linux, and it seems like that may make .net a less ideal option.

Thanks

from ic-imaging-control-samples.

westin123 avatar westin123 commented on August 25, 2024

@TIS-Kevin , alternatively is there a way to poll and see if a new image is ready in the tisgrabber python library?

from ic-imaging-control-samples.

TIS-Stefan avatar TIS-Stefan commented on August 25, 2024

Hello

Polling is using "IC_SnapImage" and check, whether there is an error (no image) or success (there is a new image). Please see the sample at https://github.com/TheImagingSource/IC-Imaging-Control-Samples/blob/master/Python/tisgrabber/samples/10-save-image.py:

            if ic.IC_SnapImage(hGrabber, 2000) == tis.IC_SUCCESS:
                ic.IC_SaveImage(hGrabber, tis.T("test.jpg"),
                                tis.ImageFileTypes['JPEG'], 90)
                print("Image saved.")
            else:
                print("No frame received in 2 seconds.")

You can use a shorter timeout than 2000 milliseconds.

Also you can find a complete tutorial at https://github.com/TheImagingSource/IC-Imaging-Control-Samples/tree/master/Python/tisgrabber in "documentation" folder.

Stefan

from ic-imaging-control-samples.

TIS-Stefan avatar TIS-Stefan commented on August 25, 2024

Hello Westin

Hi, do you have any Python examples showing what is in the Capturing to User-allocated Memory Buffers documentation?
I'm having a hard time figuring out a way to make a FrameQueueBuffer object.

I understand you having a hard time with that. The FrameQueueBuffer is something of IC Imaging Control .NET control, available with Python.NET. I do not know, what you want to do, but it is more simple to use the "tisgrabber" approach instead of Python.NET. They function completely different way and when I was learning Python, I thought, using .NET is more simple, than importing a DLL with ctypes. Later I learned, that ctypes is very simple and powerful. Therefore two approaches.

You may let me know, what you want to achieve, then I may can give better help.

Stefan

from ic-imaging-control-samples.

westin123 avatar westin123 commented on August 25, 2024

@TIS-Stefan, my goal is to implement a wrapper library for interfacing with this camera which has a function to get the latest frame from the camera without waiting for the next one. The first thing I tried was to use the IC_SnapImage image with a very low timeout but found that this doesn't work well. When I have a value here of 0 or 1, the video comes through very choppy. It isn't a consistent frame rate, but its probably getting an average of 1 or 2 new frames per second. I'm assuming frames are being dropped. The plan with this was to return the previous frame if I get an error return code from SnapImage indicating that there is no frame ready yet. Is there any reason you know of that frames would be dropped when using a small value

from ic-imaging-control-samples.

westin123 avatar westin123 commented on August 25, 2024

image

from ic-imaging-control-samples.

TIS-Stefan avatar TIS-Stefan commented on August 25, 2024

Hi

I wonder, for what you need a wrapper library, since the tisgrabber.py is an importer / wrapper.
However, I see now step by step, what you need to do, even if the complete image of your task is still unknown to me.

The behavior using IC_SnapImage, you see, is as expected. If you want to have every frame single, you use a callback. Please see the sample at https://github.com/TheImagingSource/IC-Imaging-Control-Samples/blob/master/Python/tisgrabber/samples/20-Callback.py

But I think, this is also not what you need, because I am guessing, without knowing, what exactly is your task. I understand, you may not want to write that in public, therefore, you can make a contact at https://www.theimagingsource.com/company/contact/.

If I know, what you want to do, I can try to provide sample code for your task.

Stefan

from ic-imaging-control-samples.

westin123 avatar westin123 commented on August 25, 2024

@TIS-Stefan , I'm making a wrapper because I'm supporting multiply camera types and I need a common interface. I tried the callback method you posted too and it is working for me. I remember trying that a while back and it didn't work so well. I'm not sure what I would have done wrong. Everything seems fine now. Thanks for the help.

Westin

from ic-imaging-control-samples.

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.