emgucv

Emgu C# OpenCV: Make Color Black transparent

怎甘沉沦 提交于 2019-12-24 06:29:08
问题 I'm currently trying to implement a function with OpenCV which makes the color black of an image transparent. I used this thread as a guideline. Currently it is not working and I'm not sure if it is because of my transfer to C# or another mistake. public Image<Bgr, Byte> BlackTransparent(Image<Bgr, Byte> image) { Mat imageMat = image.Mat; Mat finalMat = new Mat(imageMat.Rows, imageMat.Cols, Emgu.CV.CvEnum.DepthType.Cv8U, 4); Mat tmp = new Mat(imageMat.Rows, imageMat.Cols, Emgu.CV.CvEnum

How to load a CascadeClassifier using Emgu c#

≯℡__Kan透↙ 提交于 2019-12-24 04:30:32
问题 I have created my own cascade classifier using opencv_traincascade, i am trying to use it in my C# emgu project but it does not work using HaarCascade. I did some reading and found that CascadeClassifier is required to load xml files obtained through opencv_traincascade, But i could not find the namespace where the class is located. How to use CascadeClassifier in emgu c# project? 回答1: You are correct, you need to use the CascadeClassifier class, the API for this can be found here I shall

EMGU/OpenCV FFT of image not yielding expected results

非 Y 不嫁゛ 提交于 2019-12-24 03:09:23
问题 I'm trying to visualize the FFT of an image with EMGU. Here's the image I'm processing: Here's the expected result: Here's what I get: Here's my code: Image<Gray, float> image = new Image<Gray, float>(@"C:\Users\me\Desktop\sample3.jpg"); IntPtr complexImage = CvInvoke.cvCreateImage(image.Size, Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F, 2); CvInvoke.cvSetZero(complexImage); CvInvoke.cvSetImageCOI(complexImage, 1); CvInvoke.cvCopy(image, complexImage, IntPtr.Zero); CvInvoke.cvSetImageCOI

How to count spring coil turns?

心已入冬 提交于 2019-12-24 00:55:38
问题 In reference to: How to detect and count a spiral's turns I am not able to get count even in the pixel based calculation also. If I have attached image how to start with the counting the turns. I tried the FindContours(); but doesn't quite get the turns segregated which it can't. Also the matchshape() I have the similarity factor but for whole coil. So I tried as follows for turn count: public static int GetSpringTurnCount() { if (null == m_imageROIed) return -1; int imageWidth = m_imageROIed

How to convert ImageBox.Image to Image<Bgr, Byte>

倾然丶 夕夏残阳落幕 提交于 2019-12-24 00:43:14
问题 I need to have the image of my (Emgu CV version 3) ImageBox in an image variable, how should I do this? I tried this without luck: Image<Bgr, Byte> imgeOrigenal; imgeOrigenal = ImageBoxbOrigenal.Image; //error line Results in: Cannot implicitly convert type 'Emgu.CV.IImage' to 'Emgu.CV.Image'. An explicit conversion exists 回答1: You can convert it through the source bitmap, like this: Image<Bgr, Byte> imgeOrigenal = new Image<Bgr, Byte>(ImageBoxbOrigenal.Image.Bitmap); 来源: https:/

How to extract features from image for classification and object recognition?

↘锁芯ラ 提交于 2019-12-24 00:33:20
问题 I'm confused about the way I should make the "features extraction " method I want to use SVMs to apply "Object recognition" in images , There's a sample in Emgu's examples that holds an XML file contains the features of a cat ! and I've been trying since a week to know how they did it and what methods they used and I came across this page http://experienceopencv.blogspot.com/2011/02/learning-deformable-models-with-latent.html that displays the steps ! It's so complicated plus couldn't do it

emgu Calculate histogram with matrices

南笙酒味 提交于 2019-12-24 00:33:06
问题 I found a similar question: creating histogram using emgu cv c# and it works well when i passed grayscaled images, but when i use the Matrix, program throws exceptions. my code: Matrix<double> mat = new Matrix<double>(10, 10); mat.SetRandUniform(new MCvScalar(0.0), new MCvScalar(20.0)); DenseHistogram histo = new DenseHistogram(5, new RangeF(0.0f, 20.0f)); histo.Calculate(new Matrix<double>[] { mat }, false, null);//<--throws exception here CvInvoke.cvShowImage("Mat Histogram", histo

Emgu image conversion from Image<Gray,float> to Image<Gray,Byte> results in intensity loss?

醉酒当歌 提交于 2019-12-23 20:51:33
问题 We are performing image sharpening of a gray scale image of type Image by subtracting the Laplacian of the image from the original image. The result, if saved as a JPEG, has well defined edges and contrast. However, if the resultant image is converted to Bitmap OR " Image<Gray, Byte> " and saved as JPEG, the intensity is reduced and the sharpening effect is lost. I suspected that converting to Bitmap may be causing this problem. So, I saved some of the intermediate images and also converted

opencv (emgucv) not working in unity in osx?

痴心易碎 提交于 2019-12-23 06:00:43
问题 i am at the point, where i just would want to know if anybody out there has emguCV.unity running inside unity in osx? there are many tips concerning DllNotFoundExceptions and unity. all of them do not work in my case. i spent allmost four days searching and trying out everything. the exact error is: System.TypeInitializationException: An exception was thrown by the type initializer for Emgu.CV.OCR.OcrInvoke ---> System.TypeInitializationException: An exception was thrown by the type

Detecting circular pattern in image

☆樱花仙子☆ 提交于 2019-12-23 05:30:33
问题 I have a image. In this image there are some vertical lines and in these lines there appear some circular/elliptical or convex patterns. I want to detect the position of these circular/elliptical or convex patterns using EmguCV / OpenCV. Can any body of you help me in this regard? This is the image in which i want to find the circular/elliptical patterns: waiting for your help. 回答1: You can use Hough transform API for finding circles. http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES