| 201 | } |
| 202 | |
| 203 | void PoseExtractor::trackLockThread(Array<float>& poseKeypoints, Array<long long>& poseIds, |
| 204 | const Matrix& cvMatInput, |
| 205 | const unsigned long long imageViewIndex, const long long frameId) |
| 206 | { |
| 207 | try |
| 208 | { |
| 209 | if (!spPersonTrackers->empty()) |
| 210 | { |
| 211 | // Resize if required |
| 212 | while (spPersonTrackers->size() <= imageViewIndex) |
| 213 | spPersonTrackers->emplace_back(std::make_shared<PersonTracker>( |
| 214 | (*spPersonTrackers)[0]->getMergeResults())); |
| 215 | // Sanity check |
| 216 | if (!poseKeypoints.empty() && poseIds.empty() && mNumberPeopleMax != 1) |
| 217 | error(errorMessage, __LINE__, __FUNCTION__, __FILE__); |
| 218 | // Reset poseIds if keypoints is empty |
| 219 | if (poseKeypoints.empty()) |
| 220 | poseIds.reset(); |
| 221 | // Run person tracker |
| 222 | if (spPersonTrackers->at(imageViewIndex)) |
| 223 | (*spPersonTrackers)[imageViewIndex]->trackLockThread( |
| 224 | poseKeypoints, poseIds, cvMatInput, frameId); |
| 225 | } |
| 226 | } |
| 227 | catch (const std::exception& e) |
| 228 | { |
| 229 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 230 | } |
| 231 | } |
| 232 | } |