在OpenCV中使用函数cvDistTransform C# [英] using the function in OpenCV cvDistTransform C #

查看:67
本文介绍了在OpenCV中使用函数cvDistTransform C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


我在C#中使用dificldades cvDistTransform中的函数和OpenCV。

我的代码如下:

Cvlib.CvDistTransform(pimg ref,ref timg,(int)Cvlib.CV_DIST_L2,3,NULL,NULL);

并且在传递参数null时出错。

有谁知道如何解决?



谢谢

hi
I'm using the function in dificldades cvDistTransform with OpenCV in C #.
My code is as follows:
Cvlib.CvDistTransform (pimg ref, ref timg, (int) Cvlib.CV_DIST_L2, 3, NULL, NULL);
and has an error when I pass the parameters null.
does anyone know how to solve?

thank you

推荐答案

你可以传递NULL对于内核而不是指针。它应该是这样的:



You can pass NULL for the kernel but not for the pointer. It should be like this:

Cvlib.CvDistTransform (pimg ref, ref timg, (int) Cvlib.CV_DIST_L2, 3, NULL, IntPtr.Zero)





我有同样的问题和使用IntPtr.Zero对我来说效果很好。



I had this same problem and using IntPtr.Zero worked well for me.


这篇关于在OpenCV中使用函数cvDistTransform C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆