emgucv

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

*爱你&永不变心* 提交于 2019-12-12 09:43:49
问题 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

How to call OpenCV's MatchTemplate method from C#

夙愿已清 提交于 2019-12-12 06:01:05
问题 I'm trying to get the template's position on the image using OpenCVSharp library from NuGet. Here is the code I've wrote: var image = Cv.LoadImage("Image.png"); var template = Cv.LoadImage("Template.png"); var w = (image.Width - template.Width) + 1; var h = (image.Height - template.Height) + 1; IplImage result = new IplImage(w, h, BitDepth.F32, 1); Console.WriteLine("Image: {0} {1}", image.GetSize(), image.ElemType); Console.WriteLine("Template: {0} {1}", template.GetSize(), template.ElemType

Detecting Circles within an image

依然范特西╮ 提交于 2019-12-12 03:19:44
问题 I'm currently using EmguCV to run shape detection on an image of a shooting range target: But no matter my settings in the code (below): double cannyThreshold = 180; double circleAccumulatorThreshold = 170; CircleF[] circles = CvInvoke.HoughCircles(uimage, HoughType.Gradient, 2.0, 1.0, cannyThreshold, circleAccumulatorThreshold, 5); I can only seem to find three circles, of which one is wrong. Am I going about this incorrectly? I'm using the default example for shape detection included with

How to modify datatype of Matrix<float> to array?

早过忘川 提交于 2019-12-12 02:25:18
问题 I am using Emgu CV (v2.4) with C#. In the following class. I need to modify the data type of the used column in the table to array. public void FindSURF(Image<Gray, Byte> modelImage) { VectorOfKeyPoint modelKeyPoints; SURFDetector surfCPU = new SURFDetector(500, false); //extract features from the object image modelKeyPoints = new VectorOfKeyPoint(); Matrix<float> modelDescriptors = surfCPU.DetectAndCompute(modelImage, null, modelKeyPoints); } the SURF feature extract and store in Matrix

Load Trained SVM – Emgu CV

孤者浪人 提交于 2019-12-12 02:16:17
问题 I am somewhat new to SVMs and object recognition, and am currently attempting to train an SVM using Emgu CV 3.0, save it to a file, and then load it (for use in HOGDescriptor.SetSVMDetector). However, among other problems, I cannot find a way to load the SVM after I have saved it. So far, my code basically does the following: SVM myFirstSVM = new SVM(); // do some stuff, set some parameters... myFirstSVM.Train(someParameters); myFirstSVM.Save("filePath"); From here, the problem lies with

change Image from BGR to binary image 0,1?

試著忘記壹切 提交于 2019-12-12 01:59:33
问题 i wonder if it is possible with Emgu Cv to chnage image from BGR to binary image as i try to change the BGR to gray Image<Bgr, byte> image_pass = new Image<Bgr, byte>(bt1); 回答1: Yes, it is possible. Maybe give this a try: Image<Gray, Byte> image; image = image_pass.convert<Gray,Byte>().ThresholdBinaryInv(new Gray(x), new Gray(255)); imageBox.Image(image); CvInvoke.cvShowImage("binary", image); //To show in a new Window Where x is your threshold value, and 255 the maximum value. This would

Implement and trigger on detected motion

荒凉一梦 提交于 2019-12-12 01:44:38
问题 How can I implement a simple motion-detection method using EMGUCV? I have searched for applicable examples, but the only solutions I found were too complicated to implement. Is there a way I can implement a simple method to detect motion in order to trigger something in my application? 回答1: Convert a single frame to grayscale. Convert a new frames from real time into grayscale. Make abstractions between the first frame and new frame from real time. The result of this is a third, new frame

Use SURF to match images in OpenCV\EmguCV

送分小仙女□ 提交于 2019-12-12 01:34:50
问题 I'm working on the source code from here. It seems that indices variable stores the match information, but I don't know how the information is stored. For example, can you tell me how many matched pair of points are found? Which point matches which point? 回答1: Take a look on this line. Image<Bgr, Byte> result = Features2DToolbox.DrawMatches(modelImage, modelKeyPoints, observedImage, observedKeyPoints, indices, new Bgr(255, 255, 255), new Bgr(255, 255, 255), mask, Features2DToolbox

C# - Emgu CV - Face Recognition code stops execution at EigenObjectRecognizer and exit without error

若如初见. 提交于 2019-12-12 01:10:09
问题 I was working on Face Recognition and when i run the code it stops execution at the point where EigenObjectRecognizer is initialized and exits the program with out any error.Have any one else faced the same problem ever before?If you need additional codes i can post more. I have seen my code working until the point where the recognizer trained with data in the training set EigenObjectRecognizer recognizer = new EigenObjectRecognizer( trainingImages.ToArray(), NameLabless.ToArray(), 3000, ref

How to convert WriteableBitmap in RGB24 pixel format into a EmguCV image<Bgr, Byte> format?

和自甴很熟 提交于 2019-12-12 00:38:43
问题 I am trying to convert a WriteableBitmap which is having Rgb24 as a pixelFormat. I want to store the same image into a EmguCV Image having Bgr format. I have written a following code but it is not giving appropriate results. public unsafe void Convert(WriteableBitmap bitmap) { byte[] retVal = new byte[bitmap.PixelWidth * bitmap.PixelHeight * 4]; bitmap.CopyPixels(new Int32Rect(0, 0, bitmap.PixelWidth, bitmap.PixelHeight), retVal, bitmap.PixelWidth * 4, 0); Bitmap b = new Bitmap(bitmap