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 );
2 | No.2 Revision |
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.