Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Filled Contour

from the image below, i want the input (left image) to have an output (right image). image description

i've tried adaptive threshold, canny, skin detection, blurring, dilating and eroding, finding contours then floodfilling it, and approxPolyDP but still can't get the right output. what am i doing wrong?

here's a sample of the SkinDetection code:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
Mat src;
int main(){
    src = imread("open_1a.jpg");
    if (src.empty())
        return -1;
    blur( src, src, Size(3,3) );
    Mat hsv;
    cvtColor(src, hsv, CV_BGR2HSV);
    Mat bw;
    inRange(hsv, Scalar(0, 40, 60), Scalar(20, 150, 255), bw);
    imshow("src", src);
    imshow("dst", bw);
    waitKey(0);
    return 0;
}

Filled Contour

from the image below, i want the input (left image) to have an output (right image). image description

i've tried adaptive threshold, canny, skin detection, blurring, dilating and eroding, finding contours then floodfilling it, and approxPolyDP but still can't get the right output. i cannot floodfill right because there are many contours. what am i doing wrong?

here's a sample of the SkinDetection code:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
Mat src;
int main(){
    src = imread("open_1a.jpg");
    if (src.empty())
        return -1;
    blur( src, src, Size(3,3) );
    Mat hsv;
    cvtColor(src, hsv, CV_BGR2HSV);
    Mat bw;
    inRange(hsv, Scalar(0, 40, 60), Scalar(20, 150, 255), bw);
    imshow("src", src);
    imshow("dst", bw);
    waitKey(0);
    return 0;
}

Filled Contour

from the image below, i want the input (left image) to have an output (right image). image description

i've tried adaptive threshold, canny, skin detection, blurring, dilating and eroding, finding contours then floodfilling it, and approxPolyDP but still can't get the right output. i cannot floodfill right because there are many contours. what am i doing wrong?

here's a sample of the SkinDetection code:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
Mat src;
int main(){
    src = imread("open_1a.jpg");
    if (src.empty())
        return -1;
    blur( src, src, Size(3,3) );
    Mat hsv;
    cvtColor(src, hsv, CV_BGR2HSV);
    Mat bw;
    //inRange(hsv, Scalar(0, 40, 60), Scalar(20, 150, 255), bw);
    inRange(hsv, Scalar(0, 40, 10, 60), Scalar(20, 150, 255), bw);
    imshow("src", src);
    imshow("dst", bw);
    waitKey(0);
    return 0;
}
click to hide/show revision 4
No.4 Revision

Filled ContourSkin detection

from From the image below, i I want the input (left image) to have an output (right image). image description

i've I've tried adaptive threshold, canny, skin detection, blurring, dilating and eroding, finding contours then floodfilling it, and approxPolyDP but still can't get the right output. i cannot I can not floodfill right because there are many contours. what am i I doing wrong?

here's Here's a sample of the SkinDetection code:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
Mat src;
int main(){
    src = imread("open_1a.jpg");
    if (src.empty())
        return -1;
    blur( src, src, Size(3,3) );
    Mat hsv;
    cvtColor(src, hsv, CV_BGR2HSV);
    Mat bw;
    //inRange(hsv, Scalar(0, 40, 60), Scalar(20, 150, 255), bw);
    inRange(hsv, Scalar(0, 10, 60), Scalar(20, 150, 255), bw);
    imshow("src", src);
    imshow("dst", bw);
    waitKey(0);
    return 0;
}

Skin detection

From the image below, I want the input (left image) to have an output (right image). image description

I've tried adaptive threshold, canny, skin detection, blurring, dilating and eroding, finding contours then floodfilling it, and approxPolyDP but still can't get the right output. I can not floodfill right because there are many contours. what am I doing wrong?

Here's a sample of the SkinDetection code:

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
Mat src;
int main(){
    src = imread("open_1a.jpg");
    if (src.empty())
        return -1;
    blur( src, src, Size(3,3) );
    Mat hsv;
    cvtColor(src, hsv, CV_BGR2HSV);
    Mat bw;
    //inRange(hsv, Scalar(0, 40, 60), Scalar(20, 150, 255), bw);
    inRange(hsv, Scalar(0, 10, 60), Scalar(20, 150, 255), bw);
    imshow("src", src);
    imshow("dst", bw);
    waitKey(0);
    return 0;
}

here's the input and the output of the code above: image description