Ask Your Question

greenworld's profile - activity

2016-12-27 02:07:17 -0600 commented question Automatic ROI detection

You try SIFT algorithm, https://robwhess.github.io/opensift/

2016-12-26 23:41:33 -0600 asked a question increase performance of OpenCV on Beaglebone Black

Dear everyone, I install OpenCV 2.4.9 on Beaglebone Black (ubuntu 12.04), and compile with NEON to increase frame rate, after compiling, the frame rate still slow, about 2-3 fps, so I just want to find a way to get more than 15 fps. What is the best way I should do? Thank everyone!

2016-12-20 22:03:08 -0600 commented answer Some function is not recognize, opencv3

Thank you!, I solved it.

2016-12-20 21:32:49 -0600 asked a question Some function is not recognize, opencv3

Dear everyone, I am using opencv3 in visual studio, I have successful in configure step. But some basic functions are not recognized as the attached image.

image description

image description

image description Please help me to solve this problem.

2016-12-10 20:10:33 -0600 commented question Pointer to image problem

I want to update a Mat (small size), my idea is: pass a Mat pointer and its values to a function, then the Mat will be updated. How I can do that in a good way? Thank you!

2016-12-10 05:55:33 -0600 asked a question Pointer to image problem

Dear everyone, I faced with an error when using below code:

void init(Mat *mF) {
Mat mm = (Mat_<float>(4, 4) << 1, 1, 1, 2,
    2, 1, 0, 1,
    1, 0, 2, 1,
    3, 0, 0, 1);
*mF = mm;

}

The error opened below line:

inline void Mat::release(){
if( u && CV_XADD(&u->refcount, -1) == 1 )
    deallocate();
u = NULL;
datastart = dataend = datalimit = data = 0;
for(int i = 0; i < dims; i++)
    size.p[i] = 0;

} Please helpt o explain, and how I can correct it.

2016-12-09 17:42:25 -0600 commented answer calcBackproject

Thank you so much!

2016-12-09 06:16:50 -0600 asked a question calcBackproject

Dear everyone, Where I can find the source of calcBackProject. Thank in advance!

2016-11-30 06:36:11 -0600 commented question slow when calculate moment

Thank for your support!

2016-11-29 09:49:06 -0600 commented question slow when calculate moment

Hi Der, can you give me more detail about "never use at use pointers instead". Thank you!

2016-11-29 08:32:53 -0600 asked a question slow when calculate moment

Hi everyone, I try to write my own function to calc the moments as below:

double getMoment(Mat roi, uint8_t mode) {
    double mm = 0;
    for (int x = 0; x < roi.size().width; ++x) {
        for (int y = 0; y < roi.size().height; ++y) {
            switch (mode)
            {
            case 00:
                mm += roi.at<uchar>(y, x);
                break;
            case 01:
                mm += y*roi.at<uchar>(y, x);
                break;
            case 10:
                mm += x*roi.at<uchar>(y, x);
                break;
            case 11:
                mm += x*y*roi.at<uchar>(y, x);
                break;
            case 02:
                mm += y*y*roi.at<uchar>(y, x);
                break;
            case 20:
                mm += x*x*roi.at<uchar>(y, x);
                break;
            default:
                break;
            }
        }
    }
    return mm;
}

My problem is my own function is quite slower than the moments of OpenCV library. So can you help me to improve my code to make it faster?

2016-11-24 01:14:54 -0600 commented question error when read float pixel from a Mat

any help please?

2016-11-23 20:22:01 -0600 asked a question error when read float pixel from a Mat

Hi everyone, I just want to read a value from each pixel of the oIMG mat, but it is failed. Can you help to explain where is my errors in below code:

Mat oIMG[3];
for (int i = 0; i < 3; ++i)
{
    oIMG[i] = Mat(vSize, hSize, CV_32FC(1), Scalar::all(255));
}
int hh = oIMG[0].at<float>(0, 0);
2016-11-22 23:23:58 -0600 asked a question Scale formular based on moments camshift

Dear everyone, I just want to look for a formula to calculate the scale of an object, when it close/far the webcam after using meanshift. Please help to solve my problem. Thank you!

2016-11-09 22:28:33 -0600 asked a question Camshift misunderstand

Dear everyone, Can you help to explain below line of Camshift source code (https://github.com/opencv/opencv/blob...) :

int nx = std::min(std::max(cur_rect.x + dx, 0), size.width - cur_rect.width);
    int ny = std::min(std::max(cur_rect.y + dy, 0), size.height - cur_rect.height);

this is the calculation for the new coordinate of the window, but I do not know how it can select minimum between "size.width - cur_rect.width" and "cur_rect.x + dx" .

2016-11-09 06:09:34 -0600 commented question CalBackProject implement

Here is the description, but I am not clear enough to do. The functions calcBackProject calculate the back project of the histogram. That is, similarly to calcHist , at each location (x, y) the function collects the values from the selected channels in the input images and finds the corresponding histogram bin. But instead of incrementing it, the function reads the bin value, scales it by scale , and stores in backProject(x,y) . In terms of statistics, the function computes a probability of each element value in respect with the empirical probability distribution represented by the histogram.

2016-11-08 17:07:26 -0600 asked a question CalBackProject implement

Hi everyone, I want to make my own function calbackProject in c++. Can you help to give some instructions to do? Thank you!

2016-11-04 12:02:02 -0600 commented answer Mean shift data points

Dear Teragramm, So what is the next step I need to do? (can you help to epitomize) before you the meanshift function of OpenCV. I jus want to know what is actual when we implement inside the code. I can understand the basic concept of meanshift but I can not imagine its diagram.

2016-11-04 02:52:52 -0600 commented answer Mean shift data points

Dear Tetragramm, In your link, how I can generate set of points from the image like this: http://docs.opencv.org/3.1.0/meanshif...

2016-11-03 22:40:33 -0600 asked a question Mean shift data points

Dear everyone, I am reading about mean shift algorithm, one thing I don't understand is how to create data points from an image, such as below : https://spin.atomicobject.com/wp-cont... Please help me to explain. Thank you!

2016-10-04 04:46:55 -0600 received badge  Student (source)
2016-10-03 11:14:59 -0600 asked a question Shape is transformed

Hi everyone, I have a blue Rectangle, in a short distance, I can recognize it by findContour with threshold method. but if I increase the distance, the shape after thresholding as below:

image description

Can you help to suggest any solution can help to detect/filter a shape with lowest deformation? Thank you!

2016-10-03 08:38:37 -0600 asked a question Same output threshold image

I use three filter as below, each one if I run individual work well(three output image 'imgThresholded' is difference), but if I use continuously all, the output image 'imgThresholded' is the last one.

void filterBlack(){
    inRange(imgHSV, Scalar(Hblack.iLVal / 2, Sblack.iLVal, Vblack.iLVal*2.55), Scalar(Hblack.iHVal / 2, Sblack.iHVal*2.55, Vblack.iHVal*2.55), imgThresholded);
    erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    //morphological closing (fill small holes in the foreground)
    dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    imshow(thhdWindow, imgThresholded);
}

void filterBlue(){
    inRange(imgHSV, Scalar(Hblue.iLVal / 2, Sblue.iLVal, Vblue.iLVal*2.55), Scalar(Hblue.iHVal / 2, Sblue.iHVal*2.55, Vblue.iHVal*2.55), imgThresholded);
    erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    //morphological closing (fill small holes in the foreground)
    dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    imshow(thhdWindow, imgThresholded);
}

void filterRed(){
    inRange(imgHSV, Scalar(Hred.iLVal / 2, Sred.iLVal, Vred.iLVal*2.55), Scalar(Hred.iHVal / 2, Sred.iHVal*2.55, Vred.iHVal*2.55), imgThresholded);
    erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    //morphological closing (fill small holes in the foreground)
    dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(3, 3)));
    imshow(thhdWindow, imgThresholded);
}
2016-10-02 05:02:30 -0600 asked a question Stabilizing shape recognization

Dear everyone, My goal is detect an triangle. I use inRange function to make a threshold image, using HSV color, after that, a findContours function to detect shape This is my result, https://media.giphy.com/media/3o6Zt8Y... Two thresholded image: image description image description

As you can see, my result is not stable, sometime it can not detect the triangle, even though the triangle was captured. How I can make my result more stabilizer Thank you!

2016-10-02 03:36:54 -0600 received badge  Enthusiast
2016-10-01 05:33:43 -0600 commented answer how to detect the color of a region is black?

Dear Tetragram, if the image in an environment with brightness, can you suggest any method to recognize the region (like without brightness circumstances), eliminate all glare. Thank you so much!

2016-10-01 05:27:24 -0600 commented answer Morpho filter reduce sharp

Thank you!

2016-09-30 18:53:06 -0600 asked a question Morpho filter reduce sharp

Hi everyone, How I can restore the sharp of a triangle after use morpho filter, My program as below: erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(size, size))); dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(size, size))); //morphological closing (fill small holes in the foreground) dilate(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(size, size))); erode(imgThresholded, imgThresholded, getStructuringElement(MORPH_ELLIPSE, Size(size, size)));

The orgImg:

image description

The Output after using Morpho

image description

I just want to fill the holes without change the size and sharp of triangle. Can you suggest some method to solve my problem. Thank you!

2016-09-30 12:10:00 -0600 asked a question how to detect the color of a region is black?

Dear everyone, Could you please help to detect a region whether it is black or not from a RGB/HSV image? Thank you!

2016-09-27 17:44:56 -0600 commented question Hough Circle

Yes, you are right, thank you!

2016-09-27 12:01:18 -0600 commented answer Hough Circle

my problem is I gonna detect a circle real time, but in the gray image, the speed quite slow, (use houghcircles)

2016-09-27 11:36:08 -0600 commented question Error when opencv running (visual studio c++)

I can not determine which line cause the error, the program run for a while and is halted, it just jump to that file (mat.hpp) at that line. Thank you!

2016-09-27 09:56:58 -0600 commented question Error when opencv running (visual studio c++)

Can you help to provide me your guesses ? Or anything related to this problem. The source is quite complex so I can post in here, hope you sympathize.

2016-09-27 07:37:46 -0600 commented question Can I detect object, findcountour directly on binary image?

Dear berak, what I am trying to do is detech circle on the binary image.

2016-09-27 07:22:26 -0600 asked a question Hough Circle

Hi everyone, I have a problem that I do not understand as below: I write a program to detect the circle, my goal is detect it in binary (only black and white) image. I read some example and I can use Houghcircle to detect the circle but only on gray image, in binay image I can not. Can you help to explain and solve my problem. Thank you!

2016-09-27 07:18:28 -0600 edited question Error when opencv running (visual studio c++)

I have an error with information as below:

OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file E:\EE_env\OpenCV\opencv\build\include\opencv2/core/mat.hpp, line 538 Does anyone know how to solve my problem. Thank you!