This commit is contained in:
wb-hx510875
2019-09-19 11:14:07 +08:00
parent 2f6036b803
commit ba463ae2dc
1795 changed files with 41555 additions and 38367 deletions

View File

@@ -40,22 +40,22 @@ void DetectImageElementsResult::parse(const std::string &payload)
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allElements = value["Elements"]["Element"];
for (auto value : allElements)
auto allElementsNode = dataNode["Elements"]["Element"];
for (auto dataNodeElementsElement : allElementsNode)
{
Data::Element elementObject;
if(!value["Type"].isNull())
elementObject.type = value["Type"].asString();
if(!value["X"].isNull())
elementObject.x = std::stoi(value["X"].asString());
if(!value["Y"].isNull())
elementObject.y = std::stoi(value["Y"].asString());
if(!value["Width"].isNull())
elementObject.width = std::stoi(value["Width"].asString());
if(!value["Height"].isNull())
elementObject.height = std::stoi(value["Height"].asString());
if(!value["Score"].isNull())
elementObject.score = std::stof(value["Score"].asString());
if(!dataNodeElementsElement["Type"].isNull())
elementObject.type = dataNodeElementsElement["Type"].asString();
if(!dataNodeElementsElement["X"].isNull())
elementObject.x = std::stoi(dataNodeElementsElement["X"].asString());
if(!dataNodeElementsElement["Y"].isNull())
elementObject.y = std::stoi(dataNodeElementsElement["Y"].asString());
if(!dataNodeElementsElement["Width"].isNull())
elementObject.width = std::stoi(dataNodeElementsElement["Width"].asString());
if(!dataNodeElementsElement["Height"].isNull())
elementObject.height = std::stoi(dataNodeElementsElement["Height"].asString());
if(!dataNodeElementsElement["Score"].isNull())
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
data_.elements.push_back(elementObject);
}
if(!value["Code"].isNull())

View File

@@ -40,16 +40,16 @@ void RecognizeImageColorResult::parse(const std::string &payload)
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allColorTemplateList = value["ColorTemplateList"]["ColorTemplate"];
for (auto value : allColorTemplateList)
auto allColorTemplateListNode = dataNode["ColorTemplateList"]["ColorTemplate"];
for (auto dataNodeColorTemplateListColorTemplate : allColorTemplateListNode)
{
Data::ColorTemplate colorTemplateObject;
if(!value["Color"].isNull())
colorTemplateObject.color = value["Color"].asString();
if(!value["Label"].isNull())
colorTemplateObject.label = value["Label"].asString();
if(!value["Percentage"].isNull())
colorTemplateObject.percentage = std::stof(value["Percentage"].asString());
if(!dataNodeColorTemplateListColorTemplate["Color"].isNull())
colorTemplateObject.color = dataNodeColorTemplateListColorTemplate["Color"].asString();
if(!dataNodeColorTemplateListColorTemplate["Label"].isNull())
colorTemplateObject.label = dataNodeColorTemplateListColorTemplate["Label"].asString();
if(!dataNodeColorTemplateListColorTemplate["Percentage"].isNull())
colorTemplateObject.percentage = std::stof(dataNodeColorTemplateListColorTemplate["Percentage"].asString());
data_.colorTemplateList.push_back(colorTemplateObject);
}
if(!value["Code"].isNull())