亲爱的论坛会员们,您好!
我正在开发一个项目来检测安全摄像头的更改视图.我的意思是,当有人试图移动相机(某种破坏......)时我必须注意到这一点.我的想法是:
我需要控制近70台摄像机,所以我不能使用实时流媒体,因为它可能会占用我的互联网连接.我使用Emgu CV库来完成这项任务,但是在我工作期间我遇到了一些问题..这里是我编写的代码:
public class EmguCV
{
static public Model Test(string BaseImagePath, string ActualImagePath)
{
double noise = 0;
Mat curr64f = new Mat();
Mat prev64f = new Mat();
Mat hann = new Mat();
Mat src1 = CvInvoke.Imread(BaseImagePath, 0);
Mat src2 = CvInvoke.Imread(ActualImagePath, 0);
Size size = new Size(50, 50);
src1.ConvertTo(prev64f, Emgu.CV.CvEnum.DepthType.Cv64F);
src2.ConvertTo(curr64f, Emgu.CV.CvEnum.DepthType.Cv64F);
CvInvoke.CreateHanningWindow(hann, src1.Size, Emgu.CV.CvEnum.DepthType.Cv64F);
MCvPoint2D64f shift = CvInvoke.PhaseCorrelate(curr64f, prev64f, hann, out noise );
double value = noise ;
double radius = Math.Sqrt(shift.X * shift.X + …Run Code Online (Sandbox Code Playgroud) 我是一个新的快乐 Xamarin 开发人员,不幸的是我遇到了我的第一个项目问题。当我使用 MVC 时,我曾经使用过 Ninject。所以,我决定在 Xamarin 项目中也使用这个工具作为我的 IoC 和 DI。我的解决方案包含用于共享数据的 IOS 项目、Android 项目和 PCL。在我的 PCL 项目中,我创建了 NinjectModule(到目前为止非常简单的实现..:))
public class NinjectModuleImplementation : NinjectModule
{
public override void Load()
{
this.Bind<IMapPoint>().To<MapPoint>();
}
}
Run Code Online (Sandbox Code Playgroud)
以及我创建容器的另一个静态类:
public static class Startup
{
public static StandardKernel Container { get; set; }
public static void BuildContainer()
{
var kernel = new Ninject.StandardKernel(new NinjectModuleImplementation());
Startup.Container = kernel;
}
}
Run Code Online (Sandbox Code Playgroud)
在我的本地项目中,我调用 Startup.BuildContainer();
安卓:
[Application]
public class App : Application
{
public App(IntPtr h, JniHandleOwnership jho) : base(h, jho) …Run Code Online (Sandbox Code Playgroud)