mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-02-17 02:38:41 +00:00
improve formatting
This commit is contained in:
parent
f7c30dd375
commit
39fc9bbf36
|
|
@ -70,7 +70,6 @@ namespace Image {
|
||||||
cv::approxPolyDP(cv::Mat(contoursArea[i]), contoursDraw[i], 40, true);
|
cv::approxPolyDP(cv::Mat(contoursArea[i]), contoursDraw[i], 40, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cv::Mat mask = cv::Mat(in.size(), CV_8UC3, cv::Scalar(255, 255, 255));
|
cv::Mat mask = cv::Mat(in.size(), CV_8UC3, cv::Scalar(255, 255, 255));
|
||||||
cv::drawContours(mask, contoursDraw, -1, cv::Scalar(0, 0, 0), cv::FILLED, 1);
|
cv::drawContours(mask, contoursDraw, -1, cv::Scalar(0, 0, 0), cv::FILLED, 1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Image {
|
||||||
bgr = in.at<cv::Vec3b>(j, i);
|
bgr = in.at<cv::Vec3b>(j, i);
|
||||||
brightness = (float) Image::ImageUtils::lightnessFromRgb(bgr[2], bgr[1], bgr[0]);
|
brightness = (float) Image::ImageUtils::lightnessFromRgb(bgr[2], bgr[1], bgr[0]);
|
||||||
|
|
||||||
color = brightness * count <= (sum * (100.0 - t) / 100.0) && brightness < 0.9 ? 0 : 255;
|
color = brightness * count <= (sum * (100.0 - t) / 100.0) && brightness < 0.95 ? 0 : 255;
|
||||||
|
|
||||||
out.at<cv::Vec3b>(j, i)[0] = color;
|
out.at<cv::Vec3b>(j, i)[0] = color;
|
||||||
out.at<cv::Vec3b>(j, i)[1] = color;
|
out.at<cv::Vec3b>(j, i)[1] = color;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ int main(int argc, char** argv)
|
||||||
out = Image::Skew::deskewHoughLines(out);
|
out = Image::Skew::deskewHoughLines(out);
|
||||||
if (DEBUG) cv::imshow("rotation", out);
|
if (DEBUG) cv::imshow("rotation", out);
|
||||||
|
|
||||||
|
if (DEBUG) cv::imshow("original", in);
|
||||||
|
|
||||||
cv::imwrite(argv[2], out);
|
cv::imwrite(argv[2], out);
|
||||||
|
|
||||||
if (DEBUG) cv::waitKey(0);
|
if (DEBUG) cv::waitKey(0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user