Exemplo n.º 1
0
void Widget::findThresholdImg(){

    if(!currentFrame.empty())
    {
    Mat HSV_Input;
    cvtColor(currentFrame, HSV_Input, CV_BGR2HSV);

    Scalar colorMin(minCorHSV[0], minCorHSV[1], minCorHSV[2]);
    Scalar colorMax(maxCorHSV[0], maxCorHSV[1], maxCorHSV[2]);


    Mat BinaryImg =
                ColorDetection::GetThresholdedImage(
                     HSV_Input, colorMin,colorMax);

    Cv2QtImage::setLabelImage(ui->currentSegmentationImg, BinaryImg);
    }
}
Exemplo n.º 2
0
float Saturation(int r, int g, int b)
{
	return (1.0 - (float)(3.0/(float)(r + g + b))*(float)colorMin(r, g, b));
}