Ask Your Question
0

calling opencv [c++ ] function from C#

asked Aug 26 '13

opencv student gravatar image

updated Aug 26 '13

I got an opencv [c++] function to perform certain image processing algorithms. Now i want to call that function from c#, i am not allowed to use any wrappers or emgu cv. is there any other way to achieve this ?

thanks

Preview: (hide)

Comments

Small remark. We suggest not to use hashtags in the tags of your topic. They generate a lot of double tags, rendering the search and filter options useless. Keep this in mind at your next post, adjusted it for you now.

StevenPuttemans gravatar imageStevenPuttemans (Aug 26 '13)edit

And this could be the solution to your problem, an approach called PInvoke.

StevenPuttemans gravatar imageStevenPuttemans (Aug 26 '13)edit

1 answer

Sort by » oldest newest most voted
1

answered Aug 27 '13

AlexanderShishkov gravatar image

You can create managed wrapper with managed C++ and call it from C#.

Preview: (hide)

Comments

That's how I do it, too. The trickiest thing is to convert images to cv::Mat's and the other way round. Here's how you can do the latter one: http://answers.opencv.org/question/14183/having-trouble-with-using-mat-image-in-picturebox/

Ben gravatar imageBen (Aug 27 '13)edit

Question Tools

Stats

Asked: Aug 26 '13

Seen: 2,446 times

Last updated: Aug 27 '13