OpenCV’s Canny Edge Detection in C++

Change this line cvtColor( image, gray_image, CV_RGB2GRAY ); to std::vector<cv::Mat> channels; cv::Mat hsv; cv::cvtColor( image, hsv, CV_RGB2HSV ); cv::split(hsv, channels); gray_image = channels[0]; The problem seems to be that your hand in gray scale is very close to the gray background. I have applied Canny on the hue (color) because the skin color should be … Read more

How to connect broken lines in a binary image using Python/Opencv

MikeE‘s answer is quite good: using dilation and erosion morphological operations can help a lot in this context. I want to suggest a little improvement, taking advantage of the specific structure of the image at hand. Instead of using dilation/erosion with a general kernel, I suggest using a horizontal kernel that will connect the endpoints … Read more

OpenCV Edge/Border detection based on color

Color information is often handled by conversion to HSV color space which handles “color” directly instead of dividing color into R/G/B components which makes it easier to handle same colors with different brightness etc. if you convert your image to HSV you’ll get this: cv::Mat hsv; cv::cvtColor(input,hsv,CV_BGR2HSV); std::vector<cv::Mat> channels; cv::split(hsv, channels); cv::Mat H = channels[0]; … Read more

Image segmentation based on edge pixel map [closed]

Very nice work on boundary detection. I used to work on similar segmentation problems. Theory: Once you obtained your edge map where e(i,j) indicates the “edge-iness” degree of pixel i,j you would like a segmentation of the image that would respect the edge map as possible. In order to formulate this “respect the edge map” … Read more

Smoothing a jagged path

This is a big subject. You might find Depixelizing Pixel Art1 by Johannes Kopf & Dani Lischinski useful: it’s readable, recent, includes a summary of previous work, and explains their approach in detail. See also slides covering similar background and video(!). Here are some screenshots from the document of ‘nearest neighbor’ vs. ‘their technique’.