emgucv

Get Depth at Color position, Kinect SDK

泪湿孤枕 提交于 2019-12-03 21:15:31
I am looking for way to (as quick as possible) get the corresponding depth to a color pixel from the Kinect camera. I have found the MapDepthFrameToColorFrame function. But that only gives me the color at a certain depth position, I want the opposite. The reason I want this is that I will be able to click on a position at the RGB image and get the position to that pixel. Is there a way to do this faster than looping through all results from MapDepthFrameToColorFrame? The problem here is that not every color pixel will have a depth assigned to it because of the way the cameras and IR emitter

Improving circle detection

与世无争的帅哥 提交于 2019-12-03 16:17:42
I am trying to detect circles in my images. I have written the following code in C# using EmguCV. Most of the times it works, but there are some cases that it detects smaller or larger circles that are slightly shifted to a side. Here is my code: Thread.Sleep(1000); imgCrp.Save(DateTime.Now.ToString("yyMMddHHmmss") + ".jpg"); imgCrpLab = imgCrp.Convert<Lab, Byte>(); imgIsolatedCathNTipBW = new Image<Gray, Byte>(imgCrp.Size); CvInvoke.cvInRangeS(imgCrpLab.Split()[2], new MCvScalar(0), new MCvScalar(100), imgIsolatedCathNTipBW); imgCrpNoBgrnd = imgCrp.Copy(imgIsolatedCathNTipBW.Not());

Emgu Capture plays video super fast

主宰稳场 提交于 2019-12-03 14:38:36
When I am playing back a video using Emgu, it plays back way faster than it should. Here is the relevant code. public Form1() { InitializeComponent(); _capture = new Capture("test.avi"); Application.Idle += RefreshFrames; } protected void RefreshFrames(object sender, EventArgs e) { imageBox.Image = _capture.QueryFrame(); } I tried to set the FPS using the SetCaptureProperty method on the Capture object, but it still plays in super fast motion. The Application.Idle handle is called when no other function is being called by you program and you computer has free resources. It is not designed to

Gaussian Noise in emgucv

匿名 (未验证) 提交于 2019-12-03 09:02:45
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How can I add gaussian noise ( with a particular mean and variance ) to an image using emgucv ? 回答1: I'm not sure quite what your asking as a Gaussian filter tends to be there to remove noise. To use a custom kernel you can use the following code. If you wish to add noise with a set mean and variance then you may have to resort to looping through the my_image.Data property and add it that way. Here is the code for using a custom Kernel if it's not quite what your after let me know and I'll try and find something more appropriate a link to

EmguCV - how to specify jpeg quality when saving image?

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I save jpeg image using the following C# EmguCV code: Emgu.CV.Image<Gray, byte> image ... image.Save("imageName.jpg"); But image is stored in extremally low quality (1 color square per 8x8 pixels). When I save bmp all are ok: Emgu.CV.Image<Gray, byte> image ... image.Save("imageName.bmp"); How to increase jpeg quality when using Emgu.Cv.Image.Save or should I call other function? Why is default quality so low? Tried to ask on EmguCV forum , but it is unreachable. 回答1: EMGU only has image.Save(filename) therefore you have to use the .Net

OpenCV (EMGUCV wrapper) integration in Unity

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As you know OpenCV is very useful library that let you do amazing and powerful things in Computer vision. So I passed a good time to figure out how to use it in Unity3d, I had many problems, and searching in the Net, I have found several suggestions but not one worked for me. I’m using a Unity Pro 4.0 This version of Emgu CV (emgucv-windows-universal-gpu 2.4.9.1847) My target for unity project is: windows and not web player 回答1: This is what I did for everyone who want to use it: Install this version of EmguCV, which creates a folder EMGU in

Why is Opencv Findcontour behaving differently in Emgu c#?

﹥>﹥吖頭↗ 提交于 2019-12-02 22:07:46
问题 Hi in opencv c+ method Findcontours return the array hierarchy and to get the boundaries of the hole I can get the hierarchy . how can i get these boundaries in emgu cv please any help? how can i find holes in emgu cv? 回答1: You can get the Contour hierarchy in Emgucv by using this following code. Image<Bgr, byte> Img_Result_Bgr = Img_Source_Bgr.Copy(); Image<Gray, byte> Img_Org_Gray = Img_Source_Bgr.Convert<Gray, byte>(); Image<Gray, byte> Img_CannyEdge_Gray = new Image<Gray, byte>(Img_Source

Emgucv使用中常用函数总结

匿名 (未验证) 提交于 2019-12-02 22:06:11
Emgucv常用函数总结: 读取图片 Mat SCr = new Mat(Form1.Path, Emgu.CV.CvEnum.LoadImageType.AnyColor); //根据路径创建指定的灰度图片 Mat scr = new Mat(Form1.Path, Emgu.CV.CvEnum.LoadImageType.Grayscale); 获取灰度 //图像类型转换, bgr 转成 gray 类型。MAT Bw = New MAT CvInvoke.CvtColor(SCr, bw, Emgu.CV.CvEnum.ColorConversion.Bgr2Gray); //相当于二值化图 --黑白 根据大小10判断为0还是255 CvInvoke.Threshold(bw,bw,10,255,Emgu.CV.CvEnum.ThresholdType.BinaryInv); //获取指定区域图片 SCr为mat类型 Rectangle rectangle = new Rectangle(10,10,10,10); SCr = SCr.ToImage<Bgr, byte>().GetSubRect(rectangle).Mat; //将Mat类型转换为Image类型 Image<Bgr, byte> Su = SCr.ToImage<Bgr, byte>(); Image

Ordering 2d/3d object behind other element

帅比萌擦擦* 提交于 2019-12-02 13:50:24
问题 As you can see in the link, I have two elements: first is image element which is taken from camera (using EmguCV) and the other one is viewport3d which renders 3d object. I also include 2d object (see the rectangle). When I run my program I see this. Yes indeed, the object (hand) will be ordered in front of the image. The question is how to order 2d/3d object behind the hand object? Is it possible to do it using single camera? Just like this one. Thanks in advance for your answers. 回答1: There

Getting Emgu CV Motion Detection sample working: Unable to load DLL 'opencv_legacy249'

别说谁变了你拦得住时间么 提交于 2019-12-02 10:11:42
I'm trying to get the Motion Detection Emgu CV example mentioned in the answer to "Looking for a function for motion detection on emgucv" working. To get the example code working I first needed to add references to the Emgu CV DLLs Emgu.CV , Emgu.CV.UI , and Emgu.Util to the project make sure that the relevant Open CV DLLs (listed on the EMGU wiki and found in C:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\bin\x86 ) are copied always to the output executable directory of the project change the build target to x86 When execution gets to the line in Form1.cs _forgroundDetector = new BGStatModel