Add frame object detection into protobuf message.
| 336 | |
| 337 | // Add frame object detection into protobuf message. |
| 338 | void CVObjectDetection::AddFrameDataToProto(pb_objdetect::Frame* pbFrameData, CVDetectionData& dData) { |
| 339 | |
| 340 | // Save frame number and rotation |
| 341 | pbFrameData->set_id(dData.frameId); |
| 342 | |
| 343 | for(size_t i = 0; i < dData.boxes.size(); i++){ |
| 344 | pb_objdetect::Frame_Box* box = pbFrameData->add_bounding_box(); |
| 345 | |
| 346 | // Save bounding box data |
| 347 | box->set_x(dData.boxes.at(i).x); |
| 348 | box->set_y(dData.boxes.at(i).y); |
| 349 | box->set_w(dData.boxes.at(i).width); |
| 350 | box->set_h(dData.boxes.at(i).height); |
| 351 | box->set_classid(dData.classIds.at(i)); |
| 352 | box->set_confidence(dData.confidences.at(i)); |
| 353 | box->set_objectid(dData.objectIds.at(i)); |
| 354 | |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | // Load JSON string into this object |
| 359 | void CVObjectDetection::SetJson(const std::string value) { |
nothing calls this directly
no outgoing calls
no test coverage detected