emgucv

Generate Color Histogram around a contoured object

人走茶凉 提交于 2019-12-19 09:56:16
问题 Hey OpenCV/Emgu gurus, I have an image that I am generating contour for, see below. I am trying to generate a color histogram based pruning of search space of images to look for. How can I get the mask around just the prominent object contour and block out the remaining. So I have a 2 part question: How do I "invert" the image outside the contour? Floodfill invert, not? I am confused with all the options in OpenCV. Second, how do I generate a 1-d color histogram from the contoured object in

How to detect and count a spiral's turns

本秂侑毒 提交于 2019-12-19 07:02:33
问题 I need to detect a spiral shaped spring and count its coil turns. I have tried as follows: Image<Bgr, Byte> ProcessImage(Image<Bgr, Byte> img) { Image<Bgr, Byte> imgClone = new Image<Bgr,byte>( img.Width, img.Height); imgClone = img.Clone(); Bgr bgrRed = new Bgr(System.Drawing.Color.Red); #region Algorithm 1 imgClone.PyrUp(); imgClone.PyrDown(); imgClone.PyrUp(); imgClone.PyrDown(); imgClone.PyrUp(); imgClone.PyrDown(); imgClone._EqualizeHist(); imgClone._Dilate(20); imgClone._EqualizeHist();

How to detect and count a spiral's turns

给你一囗甜甜゛ 提交于 2019-12-19 07:02:25
问题 I need to detect a spiral shaped spring and count its coil turns. I have tried as follows: Image<Bgr, Byte> ProcessImage(Image<Bgr, Byte> img) { Image<Bgr, Byte> imgClone = new Image<Bgr,byte>( img.Width, img.Height); imgClone = img.Clone(); Bgr bgrRed = new Bgr(System.Drawing.Color.Red); #region Algorithm 1 imgClone.PyrUp(); imgClone.PyrDown(); imgClone.PyrUp(); imgClone.PyrDown(); imgClone.PyrUp(); imgClone.PyrDown(); imgClone._EqualizeHist(); imgClone._Dilate(20); imgClone._EqualizeHist();

Set capture device EmguCV

≯℡__Kan透↙ 提交于 2019-12-19 03:58:34
问题 I´m using class Capture from EmguCV to take images from a WebCam. According to the documentation of the class (http://www.emgu.com/wiki/files/2.0.0.0/html/18b6eba7-f18b-fa87-8bf2-2acff68988cb.htm), Capture has 3 constructors. Using public Capture() its supposed to use the default camera and it works properly. As I saw in one of the examples, seems that public Capture(string fileName) //takes a video file as the source for the captures. The last constructor is public Capture(int camIndex) /

Set capture device EmguCV

不想你离开。 提交于 2019-12-19 03:58:30
问题 I´m using class Capture from EmguCV to take images from a WebCam. According to the documentation of the class (http://www.emgu.com/wiki/files/2.0.0.0/html/18b6eba7-f18b-fa87-8bf2-2acff68988cb.htm), Capture has 3 constructors. Using public Capture() its supposed to use the default camera and it works properly. As I saw in one of the examples, seems that public Capture(string fileName) //takes a video file as the source for the captures. The last constructor is public Capture(int camIndex) /

Fastest way to get number of white pixels in a binary image using OpenCV

依然范特西╮ 提交于 2019-12-19 02:14:30
问题 What is the fastest way to get number of white pixels in a binary picture using OpenCV? Is there something faster than using two for loops and accessing the image pixel by pixel? 回答1: The most succinct way to accomplish this is: cv::Mat image, mask; //image is CV_8UC1 cv::inRange(image, 255, 255, mask); int count = cv::countNonZero(mask); If you are operating on a binary image, then the call to cv::inRange() is unnecessary, and simply cv::countNonZero() will suffice. Although any method must

What do the elements in a homography matrix mean?

拥有回忆 提交于 2019-12-18 19:31:25
问题 I'm new to image processing, but I'm using EMGU for C# image analysis. However, I know the homography matrix isn't unique to EMGU, and so perhaps someone with knowledge of another language can explain better. Please (in as simplified as can be) can someone explain what each element does. I've looked this up online but can't find an answer that I can properly understand (as I said, I'm kinda new to all this!) I analyse 2 images, both 2 dimensional. Therefore a 3x3 matrix is needed to account

How to calculate Rotation and Translation matrices from homography?

浪尽此生 提交于 2019-12-18 12:44:11
问题 I have already done the comparison of 2 images of same scene which are taken by one camera with different view angles(say left and right) using SURF in emgucv (C#). And it gave me a 3x3 homography matrix for 2D transformation. But now I want to make those 2 images in 3D environment (using DirectX). To do that I need to calculate relative location and orientation of 2nd image(right) to the 1st image(left) in 3D form. How can I calculate Rotation and Translate matrices for 2nd image? I need

How to implement Optical Flow tracker?

不羁岁月 提交于 2019-12-18 12:37:20
问题 I'm using the OpenCV wrapper - Emgu CV, and I'm trying to implement a motion tracker using Optical Flow, but I can't figure out a way to combine the horizontal and vertical information retrieved from the OF algorithm: flowx = new Image<Gray, float>(size); flowy = new Image<Gray, float>(size); OpticalFlow.LK(currImg, prevImg, new Size(15, 15), flowx, flowy); My problem is not knowing how to combine the info of vertical and horizontal movement in order to build the tracker of moving objects? A

emgu finding image a in image b [duplicate]

雨燕双飞 提交于 2019-12-18 11:55:44
问题 This question already has answers here : opencv finding image cordinates on another image (3 answers) Closed 6 years ago . I'm new to emgu and would like some advice on where to start. I've looked through the shape detection but its far too complex for what i need .. i think.. and my surfexample isn't working. I get this error: Cannot get SURF example in EMGU.CV to work? Anyway, this is what i would like to do: Find image A in image B. Image A is a simple square which always has the same grey