emgucv

Get and Set Pixel Gray scale image Using Emgu CV

本秂侑毒 提交于 2020-01-23 02:12:35
问题 I am trying to get and set pixels of a gray scale image by using emgu Cv with C#. If I use a large image size this error message occurs: "Index was outside the bounds of the array." If I use an image 200x200 or less then there is no error but I don't understand why. Following is my code: Image<Gray , byte> grayImage; -------------------------------------------------------------------- for (int v = 0; v < grayImage.Height; v++) { for (int u = 0; u < grayImage.Width; u++) { byte a = grayImage

Emgu - CalcHist _rowRange error

∥☆過路亽.° 提交于 2020-01-17 13:07:05
问题 I'm trying to create a histogram for Back Projection of an image using the Emgu C# wrapper for OpenCV. I have the following OpenCV C++ code which I am trying to convert to Emgu C#: char* filename = (char*)"C:\\Images\\items.jpg"; Mat im = imread(filename); if (im.empty()) return -1; const int channels[] = { 0, 1, 2 }; const int histSize[] = { 32, 32, 32 }; const float rgbRange[] = { 0, 256 }; const float* ranges[] = { rgbRange, rgbRange, rgbRange }; Mat hist; Mat im32fc3, backpr32f; im

Emgu - CalcHist _rowRange error

可紊 提交于 2020-01-17 13:06:10
问题 I'm trying to create a histogram for Back Projection of an image using the Emgu C# wrapper for OpenCV. I have the following OpenCV C++ code which I am trying to convert to Emgu C#: char* filename = (char*)"C:\\Images\\items.jpg"; Mat im = imread(filename); if (im.empty()) return -1; const int channels[] = { 0, 1, 2 }; const int histSize[] = { 32, 32, 32 }; const float rgbRange[] = { 0, 256 }; const float* ranges[] = { rgbRange, rgbRange, rgbRange }; Mat hist; Mat im32fc3, backpr32f; im

Putting a smaller image within a larger image.

独自空忆成欢 提交于 2020-01-16 19:48:01
问题 I need to put a smaller image within a larger image. the smaller picture should be centered in the larger picture. I'm working with C# and OpenCV, does anyone know how to do this? 回答1: There is a helpful post on watermarking images that might help you out. I assume it is pretty close to the same process to what you are doing. Also, be sure to check this article at CodeProject for another example using GDI+. 回答2: check this post. same problem, same solution. Code is for C++ but you can work it

Putting a smaller image within a larger image.

狂风中的少年 提交于 2020-01-16 19:47:12
问题 I need to put a smaller image within a larger image. the smaller picture should be centered in the larger picture. I'm working with C# and OpenCV, does anyone know how to do this? 回答1: There is a helpful post on watermarking images that might help you out. I assume it is pretty close to the same process to what you are doing. Also, be sure to check this article at CodeProject for another example using GDI+. 回答2: check this post. same problem, same solution. Code is for C++ but you can work it

Showing processed images from an IP camera

我是研究僧i 提交于 2020-01-16 04:35:06
问题 I have an IP-camera that serves images. These images are then processed via EmguCV and then I want to display the processed images. To show the images, I use this code: Window1(){ ... this.Dispatcher.Hooks.DispatcherInactive += new EventHandler(Hooks_DispatcherInactive); } Hooks_DispatcherInactive(...) { Next() } Next() the calls calls the image processing methods and (should) display the image: MatchResult? result = survey.Step(); if (result.HasValue) { Bitmap bit = result.Value.image.Bitmap

How do I display a video with opencv from bytes?

此生再无相见时 提交于 2020-01-14 14:43:09
问题 I'm working on a project in which we use a radio modem to transmit data (video and telemetry) from an unmanned aerial vehicle to a ground station. What we need to do is display the video in real-time and be able to know which frame corresponds to each chunk of telemetry data in C#. The data is decapsulated to bytes of telemetry and video (mpeg4). As I've got some experience with OpenCV, I'd like to use it to decode, display and grab clicks position from the video. To do so I'm using the

Right side Face detection with EmguCv

扶醉桌前 提交于 2020-01-07 04:55:09
问题 Hello everybody, I works on a face detection and recognizing project with EmguCv in C#, so i already do some steps: -detect front face and left face -recognize faces but the problem it when i want to detect right side of face it didn't work because the classifier profileface.xml just work for left side, i found some ideas for do a mirror but i have no idea how to do it. so plz plz if some one have any idea to do it i will be very happy. Mohammed Hassar. 回答1: there's a flip() function for this

error concerned with cvextern.dll file (opencv in C#)

寵の児 提交于 2020-01-06 10:19:32
问题 when I add this file (cvextern.dll) to reference or I use the command csc from cmd .. I get this error fatal error CS0009: Metadata file "file_path" could not be opened -- 'An attempt was made to load a program with an incorrect format. ' why is that happen? How can I solve it? thank you all 回答1: The comment by Hans Passant is correct. The file cvextern.dll when using EMGU should either be copied into your output folder where your program is running or added to your project as an existing

How to use OpenCv 3.0 CvInvoke.HoughLines method with EmguCv

倖福魔咒の 提交于 2020-01-06 02:39:16
问题 How to call CvInvoke.HoughLines with EmguCv in C#? Thus not the HoughLinesP method. The trouble I am experiencing is the type to use for the second parameter, which is of IOutputArray. 回答1: LineSegment2D[] lines; using (var vector = new VectorOfPointF()) { CvInvoke.HoughLines(cannyEdges, vector, _arguments.HoughLineArgs.DistanceResolution, Math.PI / _arguments.HoughLineArgs.AngleResolution, _arguments.HoughLineArgs.Threshold); var linesList = new List<LineSegment2D>(); for (var i = 0; i <