Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are good examples for face detection and I am not sure if Canny on colour will make sense. But if you want to try:

// Transform Blue, Green, Red to Hue, Saturation, Value
cv::Mat hsv;
cv::cvtColor( frame, hsv, cv::COLOR_BGR2HSV );
// Split the three channels
std::vector< cv::Mat > hsvChannels;
cv::split( hsv, hsvChannels );
// Blur the hue channel
cv::Mat blured;
cv::blur( hsvChannels[0], blured, cv::Size(3,3) );
// Canny the hue channel
cv::Mat canny;
cv::Canny( blured, canny, 100, 300, 3 );

There are good examples for face detection and I am not sure if Canny on colour will make sense. But if you want to try:

// Transform Blue, Green, Red to Hue, Saturation, Value
cv::Mat hsv;
cv::cvtColor( frame, hsv, cv::COLOR_BGR2HSV );
// Split the three channels
std::vector< cv::Mat > hsvChannels;
cv::split( hsv, hsvChannels );
// Blur the hue channel
cv::Mat blured;
cv::blur( hsvChannels[0], blured, cv::Size(3,3) );
// Canny the hue channel
cv::Mat canny;
cv::Canny( blured, canny, 100, 300, 3 );

For a good face detection example e.g. look here.