float G_x = gradientX.ptr<float>(row)[col]; float G_y = gradientY.ptr<float>(row)[col]; // normalize gradient float mag = sqrt( (G_x * G_x) + (G_y * G_y) ); if (dark_on_light){ G_x = -G_x/mag; G_y = -G_y/mag; } else { G_x = G_x/mag; G_y = G_y/mag; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)