| 170 | } |
| 171 | |
| 172 | void PoseExtractor::track(Array<float>& poseKeypoints, Array<long long>& poseIds, |
| 173 | const Matrix& cvMatInput, |
| 174 | const unsigned long long imageViewIndex) |
| 175 | { |
| 176 | try |
| 177 | { |
| 178 | if (!spPersonTrackers->empty()) |
| 179 | { |
| 180 | // Resize if required |
| 181 | while (spPersonTrackers->size() <= imageViewIndex) |
| 182 | spPersonTrackers->emplace_back(std::make_shared<PersonTracker>( |
| 183 | (*spPersonTrackers)[0]->getMergeResults())); |
| 184 | // Sanity check |
| 185 | if (!poseKeypoints.empty() && poseIds.empty() && mNumberPeopleMax != 1) |
| 186 | error(errorMessage, __LINE__, __FUNCTION__, __FILE__); |
| 187 | // Reset poseIds if keypoints is empty |
| 188 | if (poseKeypoints.empty()) |
| 189 | poseIds.reset(); |
| 190 | // Run person tracker |
| 191 | if (spPersonTrackers->at(imageViewIndex)) |
| 192 | (*spPersonTrackers)[imageViewIndex]->track(poseKeypoints, poseIds, cvMatInput); |
| 193 | // Run person tracker |
| 194 | (*spPersonTrackers)[imageViewIndex]->track(poseKeypoints, poseIds, cvMatInput); |
| 195 | } |
| 196 | } |
| 197 | catch (const std::exception& e) |
| 198 | { |
| 199 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | void PoseExtractor::trackLockThread(Array<float>& poseKeypoints, Array<long long>& poseIds, |
| 204 | const Matrix& cvMatInput, |