return MEDIA_VISION_ERROR_INVALID_OPERATION;
}
- for (unsigned int elem2 = 0; elem2 < xElements2; ++elem2) {
- JsonArray *xArray = json_array_get_array_element(xScales, elem2);
- JsonArray *yArray = json_array_get_array_element(yScales, elem2);
- unsigned int xArrayElements2 = json_array_get_length(xArray);
- unsigned int yArrayElements2 = json_array_get_length(yArray);
- if (xArrayElements2 != yArrayElements2) {
- LOGE("Invalid x and y scales. They should be the same size");
- return MEDIA_VISION_ERROR_INVALID_OPERATION;
- }
- std::vector<double> xScale_;
- std::vector<double> yScale_;
- for (unsigned int arrayElem2 = 0; arrayElem2 < xArrayElements2; ++arrayElem2) {
- auto xScale = static_cast<double>(json_array_get_double_element(xArray, arrayElem2));
- auto yScale = static_cast<double>(json_array_get_double_element(yArray, arrayElem2));
- LOGI("xScale:%lf, yScale:%lf", xScale, yScale);
- xScale_.push_back(xScale);
- yScale_.push_back(yScale);
- }
- anchorParam.vxScales.push_back(xScale_);
- anchorParam.vyScales.push_back(yScale_);
+ std::vector<double> xScale_;
+ std::vector<double> yScale_;
+ for (unsigned int arrayElem2 = 0; arrayElem2 < xElements2; ++arrayElem2) {
+ auto xScale = static_cast<double>(json_array_get_double_element(xScales, arrayElem2));
+ auto yScale = static_cast<double>(json_array_get_double_element(yScales, arrayElem2));
+ LOGI("xScale:%lf, yScale:%lf", xScale, yScale);
+ xScale_.push_back(xScale);
+ yScale_.push_back(yScale);
}
+ anchorParam.vxScales.push_back(xScale_);
+ anchorParam.vyScales.push_back(yScale_);
+
} else {
LOGE("Invalid anchor mode [%d]", anchorParam.mode);
return MEDIA_VISION_ERROR_INVALID_PARAMETER;