Message
Message
nlohmann::json &arabicJson,
const nlohmann::json
&englishJson) {
int width = mat.cols;
int height = mat.rows;
double templateWidth = 700;
double templateHeight = 320;
int dob_bottom = height;
int dob_right = width;
int ybuffer = dob_bottom - dob_top;
int top_point = 0;
int bottom_point = (int) ((height*150.0)/templateHeight);//134
int top_point2 = (int) ((height*120.0)/templateHeight);//107
int bottom_point2 = (int) ((height*200.0)/templateHeight);//178
int right_point = (dob_right);
cv::cvtColor(mat, mat, cv::COLOR_BGR2RGB);
debugLog("points are dob_top:%d, ybuffer:%d, top_point:%d, bottom_point:%d,
top_point2:%d, bottom_point2:%d, right_point:%d", dob_top, ybuffer, top_point,
bottom_point, top_point2, bottom_point2, right_point);
cv::rectangle(mat, cv::Rect(0, top_point,width-1, bottom_point),
cv::Scalar(0,0,0));
cv::rectangle(mat, cv::Point(0, top_point2), cv::Point(width-1, bottom_point2),
cv::Scalar(255,0,0));
cv::rectangle(mat, cv::Point(0, dob_top), cv::Point(width-1, dob_top),
cv::Scalar(0,255,0));
std::vector<std::string> lineTexts;
std::vector<Recte> lineBoxes;
Recte lastAcceptedBox(-1,-1,-1,-1);
std::string surnamestr="",namestr="";
for (int i = 0; i < arabicJson.size(); ++i) {
auto lineBlock = arabicJson[i];
std::string lineText = lineBlock["text"];
Recte lineRect = Recte(lineBlock["block_l"].get<int>(),
lineBlock["block_t"].get<int>(),
lineBlock["block_r"].get<int>(),
lineBlock["block_b"].get<int>());
cv::rectangle(mat, cv::Point(lineRect.left, lineRect.top),
cv::Point(lineRect.right, lineRect.bottom),
cv::Scalar(0,0,255));