I'm attempting to narrow a screenshot of an app to a specific section of the UI for later processing by Tesseract; in particular, the X Battle ratings located in the lower half of the image.
I did a little bit of research, and saw that color segmentation might be the most practical choice for me. However, the following code, when run, produces a completely black mask:
// step 1: read the image into a cv::Mat
cv::Mat source_image = cv::imread("test_data/xrec/ocr_splatnet3/Screenshot_20251021_074323_Nintendo_Switch_App.jpg");
// step 2: convert to hsv
cv::Mat hsv;
cv::cvtColor(source_image, hsv, cv::COLOR_BGR2HSV);
// step 3, make a color mask
cv::Mat mask;
cv::Scalar lower_bound(220, 24, 8);
cv::Scalar upper_bound(224, 34, 18);
cv::inRange(hsv, lower_bound, upper_bound, mask);
cv::imshow("mask", mask);
cv::waitKey();
cv::destroyAllWindows();
// Tesseract code follows...
Is the range of the upper & lower bound too tight? Or am I just missing some step completely?
