emgucv

How to avoid rotation of rects, detected by MinAreaRect?

戏子无情 提交于 2019-12-11 08:13:59
问题 I am trying to detect text fields on Windows Form but CvInvoke.MinAreaRect(contour) returns rectangle, rotated by -7.29419661 Angle. My code is Image<Bgr, Byte> a = new Image<Bgr, byte>(@"d:/Art/documents/Projects/InputFieldsDetector/Images/Form345_1.PNG"); imageBox1.Image = a; UMat grayed = new UMat(); CvInvoke.CvtColor(a, grayed, ColorConversion.Bgr2Gray); imageBox2.Image = grayed; UMat canny = new UMat(); CvInvoke.Canny(grayed, canny, 50, 200, 3); imageBox3.Image = canny;

How to get the emgucv compiled on my Ubuntu 18.04? It is said to support Ubuntu

随声附和 提交于 2019-12-11 08:05:38
问题 First I am not very familiar with C++ compile process, but I have to compile the emgucv repository on Ubuntu 18.04. I follow the instruction and try to figure out things by searching through Stack Exchange. I got every dependencies setup, then the only file I need to execute is this one. Although it is written for 16.04 , seems to work for 18.04 , but the compilation throws an error. It says _MAX_DRIVE, _MAX_DIR, _MAX_PATH, DWORD, errno_t , etc. are not declared. As suggested by the comment,

C# EmguCV error “OpenCV: u != 0”

試著忘記壹切 提交于 2019-12-11 07:27:23
问题 I keep getting this OpenCV: u != 0 error when trying to match some photos. My method looks like this. ImageFile class has some variables. It does this even if I am trying to match one photo. Stacktrace being: Unhandled Exception: Emgu.CV.Util.CvException: OpenCV: u != 0 at Emgu.CV.CvInvoke.CvErrorHandler(Int32 status, IntPtr funcName, IntPtr errMsg, IntPtr fileName, Int32 line, IntPtr userData) at Emgu.CV.Features2D.Feature2DInvoke.CvFeature2DDetectAndCompute(IntPtr feature2D, IntPtr image,

Capturing an image with Emgu - black image

∥☆過路亽.° 提交于 2019-12-11 06:56:49
问题 I'm a newbie in emgu cv and for a major project I'm trying to capture an image from a webcam and show it in an image box, but it's showing a black image. What is wrong with the following code? using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Emgu.CV; using Emgu.CV.Structure; using Emgu.CV.UI; using Emgu.Util; namespace WindowsFormsApplication7 { public partial class

Detected Lines Angle in EmguCV

限于喜欢 提交于 2019-12-11 06:07:00
问题 i used image.HoughLine to find line in my image. i want to know the angle of each line. so i tried : double deltaY = line.P2.Y - line.P1.Y; double deltaX = line.P2.X - line.P1.X; double angle; if (deltaX != 0) angle = Math.Atan2(deltaY, deltaX); else angle = 90; but , it returns 0 and -1 , while the lines in image at least have 15 degree . ( i rotated the image myself ). what's wrong? and what is Direction in LineSegment2D class, could it help ? 回答1: I Found myself the solution. you know what

Taking one capture and displaying the one before - VB - OpenCV

狂风中的少年 提交于 2019-12-11 05:15:59
问题 I am having a special problem with capturing a picture using my webcam, opencv and emgucv. I have used this function before, and always worked well, but now, I don't know why, the picturebox is showing me the picture taken before. Let me explain: I start the program - I press the button and wait some seconds before the picture is taken - I take the picture using img = capturez.QueryFrame() - I display the picture in the PictureBox. Here is the code: Private Sub startButton_Click() Handles

Camera Rotation SolvePnp

只愿长相守 提交于 2019-12-11 04:25:35
问题 Could somebody help me with the math on calculating the Y rotation of my camera? I use SolvePnP to get a rvec. From this rvec I want to know how much my camera is rotated around its own Y axis. PointF[] ImagePointsCam = GetImagePointsCam(imgThres); MCvPoint3D32f[] ObjectPointsCam = GetObjectPointsCam(); float f = 1.0f / (float)(Math.Tan(CameraFOV / 360.0 * 3.1415)); Matrix<float> CamMat = new Matrix<float>(3, 3); CamMat.Data[0, 0] = (float)(f * 0.5 * ResolutionWidth); CamMat.Data[0, 1] = 0;

When to use `image` and when to use `Matrix` in Emgu CV?

喜夏-厌秋 提交于 2019-12-11 04:07:32
问题 in openCV I regularly use cv::Mat for almost everything. Now, I need to use emgu CV and use the Matrix -object in stat, but some functions are not supported?!... may I use the image -class instead? When to use image and when to use matrix in emgu CV? P.S.: Currently I'm looking for a way to define a ROI on a matrix but didn't find a way without copying the data. Version: Emgu.CV-2.4.2 回答1: I know that in the latest version of OpenCV, the Mat object is prefered to iplImage for a lot of reasons

How to capture video stream using emgu cv

南楼画角 提交于 2019-12-11 03:55:18
问题 I am doing my project about hand gesture recognition so, I want to capture video stream using web cam. Currently I am using emgu cv wrapper for open cv image processing library. any solution to capture video stream in to image? My emgu cv version is 2.4.10 Thanks... 回答1: First, You need to create Capture object then using that object call QueryFrame method it will provide RGB image Capture videoCapture = new Capture(); Image<Bgr, byte> currentFrame = videoCapture.QueryFrame(); Happy Coding...

Pixel-wise summation and subtraction in EmguCV

僤鯓⒐⒋嵵緔 提交于 2019-12-11 03:23:11
问题 I'm looking for an elegant way to perform pixel-wise summation and subtraction in EmguCV. I'm trying to calculate the Haar-like features of an image. For a one-dimensional situation, it's done by multiplying the vector [x x x x x x x x] by the following vector element-wise: [ 1 -1 1 -1 1 -1 1 -1] [ 1 1 -1 -1 1 1 -1 -1] [ 1 1 1 1 -1 -1 -1 -1] So I need to add or subtract the element pixels of an image. Say, Bgr sum = new Bgr(); sum = sum + img[0,0] - img[0,1] + img[0,2] - img[0,3]; Obviously