emgucv

How can I detect direction and number of objects using Emgu?

大憨熊 提交于 2019-12-06 14:45:55
How can I detect direction and number of objects using Emgu? Objects are moving in all directions (2D); and a camera is seeing these objects (on a 2D surface). Object may have little differences in shape but are similar enough. Thanks Invoke cvAbsDiff on successive frames (may be on each n -th and (n - gap) -th frame) to detect changes and use thresholding in order to get a changes mask For each frame call cvUpdateMotionHistory and pass obtained mask as an argument To get motion segments (objects) and their orientation: call cvCalcMotionGradient passing motion history accumulated by previous

Alpha composite images using emgu.cv

别等时光非礼了梦想. 提交于 2019-12-06 13:57:45
问题 Emgu.CV (Nuget package 2.4.2) doesn't as far as I can tell implement the gpu::alphaComp method available in OpenCV. As such when trying to implement this specific type of composite it is incredible slow in C#, such that it takes up some 80% of the total cpu usage of my app. This was my original solution that performs really badly. static public Image<Bgra, Byte> Overlay( Image<Bgra, Byte> image1, Image<Bgra, Byte> image2 ) { Image<Bgra, Byte> result = image1.Copy(); Image<Bgra, Byte> src =

Taking the HOG descriptor of an image using HOGDescriptor from EMGU CV C#

女生的网名这么多〃 提交于 2019-12-06 11:16:42
问题 How can I compute the hog descriptor vector of an image using EMGU CV and C#. If i make something like this: float[] f; Image<Bgr, Byte> img1 = new Image<Bgr, Byte>(fullPath); f = hog.Compute(img1, Size.Empty, Size.Empty,null ); it doesn't work, it gives a Object reference not set to an instance of an object. exception. I want to compute the hog descriptor with default parameters. Does someone know how to do this ? Emgu cv is very poorly documented. I have modified the code and now I am

Emgu CV and the official Microsoft Kinect SDK?

拟墨画扇 提交于 2019-12-06 07:32:41
问题 Emgu CV currently allows the use of the Kinect with the OpenNI drivers. I've also seen that there exists an mssdk-openni bridge application to allow the Kinects running on the official Microsoft SDK to emulate OpenNI driven Kinects. Has anyone been successful in getting a Kinect running on the Microsoft SDK to work with Emgu CV, either with the mssdk-openni bridge or directly? Are there any tips on getting it running smoothly, or pitfalls to avoid? 回答1: Yeah. I've simply installed the SDK and

How to detect triangle edge in opencv or emgu cv?

人盡茶涼 提交于 2019-12-06 07:03:27
问题 I am using Emgu CV, i want to detect two sharp in the picture, first i convert the image to gray,and call cvCanny, then call FindContours, but just one contour found, the triangle not found. Code: public static void Do(Bitmap bitmap, IImageProcessingLog log) { Image<Bgr, Byte> img = new Image<Bgr, byte>(bitmap); Image<Gray, Byte> gray = img.Convert<Gray, Byte>(); using (Image<Gray, Byte> canny = new Image<Gray, byte>(gray.Size)) using (MemStorage stor = new MemStorage()) { CvInvoke.cvCanny

How to get Confidence value in face recognition using EMGU CV?

眉间皱痕 提交于 2019-12-06 04:54:49
问题 I am working on a project in which i should design an application which can detect all the faces of the persons passing by...I have a very large database comprising of several known people...I have used the EigenObjectRecognizer to recognize the image frame captured by the webcam...But the problem is sometimes it recognizes some persons wrongly....So if get the confidence value of this facial match...Then i can write a conditional loop so that if it is greater than 75%, then only detect him

Color tracking using EMGUcv

烂漫一生 提交于 2019-12-06 02:54:50
I am trying to make an colored object tracker which uses a binary image and blob detector to follow the target sort of like this: https://www.youtube.com/watch?v=9qky6g8NRmI . However I can not figure out how the ThresholdBinary() method work and if it is even the right one. Here is a relevant bit of the code: cam._SmoothGaussian(3); blobDetector.Update(cam); Image<Bgr,byte> binaryImage = cam.ThresholdBinary(new Bgr(145,0,145),new Bgr(0,0,0)); Image<Gray,byte> binaryImageGray = binaryImage.Conver<Gray,byte>(); blobTracker.Process(cam, binaryImageGray); foreach (MCvBlob blob in blobTracker) {

How do I compute DFT and its reverse with EMGU?

一笑奈何 提交于 2019-12-05 20:20:02
How can I compute the DFT of an image (using EMGU), display it and then compute the reverse to get back to the original? I'm going to answer my own question here since it took me a while to figure out. To test that it works here's an image and here's the expected result after applying DFT. And without further ado here's the code: // Load image Image<Gray, float> image = new Image<Gray, float>(@"C:\Users\me\Desktop\lines.png"); // Transform 1 channel grayscale image into 2 channel image IntPtr complexImage = CvInvoke.cvCreateImage(image.Size, Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F, 2); CvInvoke

How to choose Full Frames (Uncompressed) as codec for VideoWriter

◇◆丶佛笑我妖孽 提交于 2019-12-05 13:55:25
i want to store uncompressed frames from a device as a video, but i need to know how to choose " Full Frames (Uncompressed) " as a codec for the VideoWriter (in emgu aka openCV). Iam able to choose it from the dropdown menu when iam passing -1 like this VideoWriter myVideoWriter = new VideoWriter ("myVieoColor.avi", -1 , 15, videoSize, true); But i want to choose the Full Frames (Uncompressed) codec automatically. For example i know i can choose the Lagarith Lossless Video Codec by VideoWriter myVideoWriter = new VideoWriter ("myVieoColor.avi", Emgu.CV.VideoWriter.Fourcc('L','A','G','S') , 15,

Calculating distance using a single camera

亡梦爱人 提交于 2019-12-05 11:39:47
I would like to calculate distance to certain objects in the scene, I know that I can only calculate relative distance when using a single camera but I know the coordinates of some objects in the scene so in theory it should be possible to calculate actual distance. According to the opencv mailing list archives, http://tech.groups.yahoo.com/group/OpenCV/message/73541 cvFindExtrinsicCameraParams2 is the function to use, but I can't find information on how to use it? PS. Assuming camera is properly calibrated. My guess would be, you know the width of an object, such as a ball is 6 inches across