Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I'm In desperate need of some guidance (Now) :-)
Intro:

I'm trying to get Video feeds from a Point Grey Camera into OPEN_CV for displaying and manipulation (just simple overlays)
Problem:

I have been working on this for days now and I'm struggling big time
Most if not all samples are in C and use Pointers because most conversion of the image are done on the original data -- VB with Pointers = super :-(

Question:
How can I get a Pointer In VB to a managed Data structure/Array ?
- The Point Gary Managed DLL holds the Image but somehow doesn't give me a way of pulling the Pointer directly trough the managed code (You would think that's the easiest way but there is probably a reason I don't understand why this is not done ..) ??

Anyway: How can I get the pointer to a data structure (array) that is held in managed code ?? Is the only way to get the pointer going trough the managed code or is there a way for VB to grab the data entry point trough reflection/Marshal/GCHandle ??

Again ... I'm totally lost & I'm really surprised that I'm the only one with this problem in VB (Lot's of forums/samples about converting images to OPEN_CV(using Emgu) in C) nothing that's working in VB ....

It's also interesting to note that on the Emgu CV VB forum there are lots of unanswered questions and hardly any replies ????

Maybe I need to look for something else then Open CV ?
http://www.emgu.com/forum/viewforum.php?f=9&start=75

Any advise would be greatly appropriated
Georg

What I have tried:

Below is not working as _Image (managed Image PontGrey DLL) does not support
[LockBits] or [Scan0]
it does work on my own Images ...

_image = Bitmap.LockBits(rect, _
       Drawing.Imaging.ImageLockMode.ReadWrite, Bitmap.PixelFormat)
       Dim bmp_IntPtr As IntPtr = _image.Scan0
Posted
Updated 12-Oct-17 8:50am

1 solution

Nobody seems to know how to do this .. anyway

What I'm currently doing is creating a RAM disk and then use the built in Save - Read commands to get a handle to the Image
(If i understand it correctly OpenCv when using the Read File command will actually return a Mat handle to the image) ...
This seems to be running just fine for the moment

This let's me move forward for now .. once I have time or run into trouble with this I'll revisit this hand over of the image between flycaptured and Emgu OpenCv

Georg
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900