Ask Your Question

breizher's profile - activity

2018-01-23 09:21:51 -0600 received badge  Editor (source)
2018-01-23 09:21:51 -0600 edited question Sizes of input arguments do not match (The operation is neither 'array op array')

Sizes of input arguments do not match (The operation is neither 'array op array') Hello there, I am trying to add two i

2018-01-23 09:21:13 -0600 asked a question Sizes of input arguments do not match (The operation is neither 'array op array')

Sizes of input arguments do not match (The operation is neither 'array op array') Hello there, I am trying to add to im

2017-08-22 06:49:18 -0600 received badge  Popular Question (source)
2016-08-11 09:59:23 -0600 commented question detect nodes and measure distance

It's working with erode and three iterations, Merci beaucoup !

2016-08-11 05:23:27 -0600 asked a question detect nodes and measure distance

Hi all,

I am trying to detect nodes in a net and extract some features like the distance between nodes (see red arrow below)

How can I detect and measure the distance between a node and its neighbors ?

Here the results I get for now :

image description

image description

Thanks in advance for your help.

2015-12-31 00:55:19 -0600 received badge  Student (source)
2015-08-13 08:48:08 -0600 commented question count the number of distinct object in a video

This is exactly what I want to do. For example in a frame I detect 2 objects and I give them an ID : Obj_1 and Obj_2 Then in the next frame I detect 3 objects. How can I keep the good ID of Obj_1 and Obj_2 ? And Give an ID to the new one ?

2015-08-13 04:17:24 -0600 asked a question count the number of distinct object in a video

Hi, I have a video containig object moving with different speed. I would like to count how many object cross a line. For now I am able to track every object in a frame and I write the center of every object on the frame. My first attempt to count these objects was to compare the coordinate of every object with the coordinate of the line (for example my line is horizontal so I compare the Y coordinate). But some object are moving too fast and in the first frame their Y coordinate is less than the Y coordinate of the line and in the next frame it's more. So I decided to extend the counting area (20 pixels) but now I am counting some object twice...

Here is my code :

//update the background model
pMOG2->apply(frame, fgMaskMOG2);

    ///////////////////////////////////////////////////////////////////  
    //morphology element  
    Mat element = getStructuringElement(MORPH_RECT, Size(7, 7), Point(3, 3));
    //pre procesing  
    //1 point delete   
    morphologyEx(fgMaskMOG2, fgMaskMOG2, CV_MOP_CLOSE, element);

    //Find contour  
    ContourImg = fgMaskMOG2.clone();
    //less blob delete  
    vector< vector< Point> > contours;
    vector<Vec4i> hierarchy;
    findContours(ContourImg,
        contours, hierarchy, // a vector of contours  
        CV_RETR_EXTERNAL, // retrieve the external contours  
        CV_CHAIN_APPROX_NONE); // all pixels of each contours  

    /// Get the moments
    vector<Moments> mu(contours.size());
    vector<Point> mc(contours.size());
    vector<Rect> mr(contours.size());   
    /// Draw mass center and contours
    for (int i = 0; i< contours.size(); i++)
    {
        mu[i] = moments(contours[i], false);

        if (contourArea(contours[i], false) > 200){
            mc[i] = Point(mu[i].m10 / mu[i].m00, mu[i].m01 / mu[i].m00);
            mr[i] = boundingRect(contours[i]);
            drawContours(frame, contours, i, CV_RGB(255, 0, 0), 1, 8, hierarchy, 0, Point());
            rectangle(frame, mr[i], CV_RGB(255, 0, 0));
            circle(frame, mc[i], 4, CV_RGB(255, 0, 0), -1, 8, 0);
            if (mc[i].y > 190 && mc[i].y < 210){
                detectedObj = detectedObj + 1;
            }
        }
    }

Maybe the way I am trying to do it is not the best.

How can I manage to count the object crossing a line or an area without missing some or counting twice the same? Thx

2015-08-13 03:47:59 -0600 received badge  Enthusiast
2015-08-11 07:18:58 -0600 received badge  Scholar (source)
2015-08-11 07:18:44 -0600 received badge  Supporter (source)
2015-08-04 10:51:53 -0600 commented question Background Subtraction example

Thanks it works now! adding cv::ocl::setUseOpenCL(false); and

  #include <opencv2/core/ocl.hpp>
2015-08-04 08:07:34 -0600 asked a question Background Subtraction example

Hi, I am trying to follow this tutorial : http://docs.opencv.org/master/d1/dc5/... When I compile the code I get this error :

Unhandled exception at 0x07EFC900 (amdocl.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0xF5A910D4.

The error arrived at the processVideo function at this line : pMOG2->apply(frame, fgMaskMOG2);

How can I solve this issue ? Thanks in advance for your help and sorry for my english