Ask Your Question

sevli's profile - activity

2018-07-31 12:22:34 -0600 received badge  Notable Question (source)
2017-08-08 20:35:18 -0600 received badge  Student (source)
2017-07-06 21:49:40 -0600 received badge  Popular Question (source)
2016-04-27 05:13:06 -0600 received badge  Teacher (source)
2015-11-22 02:07:44 -0600 received badge  Necromancer (source)
2015-10-08 06:21:32 -0600 received badge  Necromancer (source)
2015-10-07 23:35:26 -0600 answered a question How to find Finger tips out of convexity defects

I try your code like this code and it's works

cv::findContours(erframe, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE), cv::Point(0, 0);
    for (int i = 0; i < contours.size(); i++) {
        if (contourArea(contours[i]) >= 500) {
            std::vector<std::vector<cv::Point> > tcontours;
            std::vector<std::vector<cv::Point> > hulls(1);
            std::vector<std::vector<int> > hullsI(1);
            tcontours.push_back(contours[i]);
            cv::drawContours(srcdown, tcontours, -1, cv::Scalar(0, 0, 255), 2);
            cv::convexHull(cv::Mat(tcontours[0]), hulls[0], false, true);
            cv::convexHull(cv::Mat(tcontours[0]), hullsI[0], false, true);
            cv::drawContours(srcdown, hulls, -1, cv::Scalar(0, 255, 0), 1);
            cv::RotatedRect rect = cv::minAreaRect(cv::Mat(tcontours[0]));
            std::vector<std::vector<cv::Vec4i>>convDef(contours.size());
            cv::convexityDefects(tcontours[0], hullsI[0], convDef[i]);
            for (int k = 0; k < hullsI[0].size(); k++){
                for (int j = 0; j < convDef[i].size(); j++){
            if (convDef[i][j][3] > 20 * 256 /*filter defects by depth*/){
                int ind_0 = convDef[i][j][0];//start point
            int ind_1 = convDef[i][j][1];//end point
            int ind_2 = convDef[i][j][2];//defect point
            cv::circle(srcdown, contours[i][ind_0], 5, cv::Scalar(0, 0, 255), -1);
            cv::circle(srcdown, contours[i][ind_1], 5, cv::Scalar(255, 0, 0), -1);
            cv::circle(srcdown, contours[i][ind_2], 5, cv::Scalar(0, 255, 0), -1);
            cv::line(srcdown, contours[i][ind_2], contours[i][ind_0], cv::Scalar(0, 255, 255), 1);
            cv::line(srcdown, contours[i][ind_2], contours[i][ind_1], cv::Scalar(0, 255, 255), 1);
                    }
                }
            }
        }
    }
2015-09-12 08:02:18 -0600 commented answer How to remove detected shadows from foreground image in the light projector

i don't know how to select certain area in original frame in size of foreground image. Anybody please suggest me a sample code.

2015-09-08 21:00:10 -0600 answered a question hand tracking and hand gesture recognition

you can start searching the related paper in ieee or other community. you also can search in github or codeproject. For sign language you can use finger counting and other approach. actually i don't really good at this area, i just start learning cpp along with opencv 5 months ago, so if i can write one paper in hand recognition and why you can't. fighting brother

2015-09-08 20:47:45 -0600 commented answer How to remove detected shadows from foreground image in the light projector

Thank you @LBerger and @LorenaGdL for the suggestion. btw it's my bad, i thought you ask for the result lol... I included the original video this time. Yes, my lecturer said just like you. But i don't know the parameter of dark pixels in the video, can you give me hint to catch only that pixels.

2015-09-08 13:59:08 -0600 received badge  Necromancer (source)
2015-09-08 09:35:24 -0600 answered a question Hand gesture control mouse

I don't know exactly what you want, but you can search in github, codeproject etc. this is one of them, not mine but that page show up at the first time i search github

2015-09-08 09:31:01 -0600 received badge  Autobiographer
2015-09-08 09:11:25 -0600 commented answer How to remove detected shadows from foreground image in the light projector

I try to record video via opencv but i can't record the contour along with the video, so i try record with desktop recorder. This is result the video I already set "true" for bShadowDetection and there is no changes at all. I try to my lecturer and he said try to remove it with color detection. I just don't get it how to use that. Please help me guys.

2015-09-06 21:26:48 -0600 answered a question How to remove detected shadows from foreground image in the light projector

I am thinking to use color detection after background subtraction. Is it possible to use this method after background subtraction MOG2 applied?

2015-09-04 21:04:10 -0600 received badge  Editor (source)
2015-09-04 21:01:23 -0600 commented question How to remove detected shadows from foreground image in the light projector

oh... i see, thank you. I already try to changes that parameter. But when i changes that parameter the result still same. I think the shadows considered as moving hands as well. I thinking to you use color after MoG2, but it result just silhouette in black and white.

2015-09-04 10:57:40 -0600 asked a question How to remove detected shadows from foreground image in the light projector

Hi guys, i applying background subtraction MOG2 to detect hand in the beam light of projector. I already done this much, but i can remove shadow in foreground image. I already changes the parameter threshold to 127 to remove shadow and changes bShadowDetection in MOG2. Please help me to solve it, give me suggestion or anythings.

This is sample picture that i take:

image description

int main(int argc, char *argv[]) {
cv::Mat src, srcdown, bg, frMOG2, erframe, dlframe;
namedWindow("windows 1", CV_WINDOW_AUTOSIZE);
cv::VideoCapture cap(0);
cv::BackgroundSubtractorMOG2 bgMOG2 = cv::BackgroundSubtractorMOG2(3000, 16.0, true);
if (!cap.isOpened()){ printf("--(!)no frame from camera\n"); return -1; };
for (;;) {
    cap >> src;
    bgMOG2.operator()(src, frMOG2);
    cv::threshold(frMOG2, thrframe, 127, 255, cv::THRESH_BINARY);
    cv::dilate(thrframe, dlframe, cv::Mat());
    cv::erode(dlframe, erframe, cv::Mat());
    std::vector<std::vector<cv::Point>>contours;
    cv::findContours(erframe, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
    for (int i = 0; i < contours.size(); i++) {
        if (contourArea(contours[i]) >= 500) {
            vector<vector<Point> > tcontours;
            tcontours.push_back(contours[i]);
            cv::drawContours(srcdown, tcontours, -1, cv::Scalar(0, 0, 255), 2);
        }
    }
    cv::imshow("windows 1", srcdown);
    if (waitKey(30) >= 0) break;
}
return(0);
}
2015-09-01 02:58:04 -0600 received badge  Enthusiast