32 LegacyRGBDOpenPoseEstimation::createPropertyDefinitions()
36 def->
required(providerName,
"ImageProviderName");
38 RGBDOpenPoseEstimationComponentPluginUser::postCreatePropertyDefinitions(def);
42 void LegacyRGBDOpenPoseEstimation::onInitImageProcessor()
44 RGBDOpenPoseEstimationComponentPluginUser::preOnInitImageProcessor();
45 usingImageProvider(providerName);
48 readErrorCounter2d = 0;
52 void LegacyRGBDOpenPoseEstimation::onConnectImageProcessor()
54 RGBDOpenPoseEstimationComponentPluginUser::preOnConnectImageProcessor();
57 imageProviderInfo = getImageProvider(providerName, imageDisplayType);
58 rgbImageFormat = imageProviderInfo.imageFormat;
60 numImages =
static_cast<unsigned int>(imageProviderInfo.numberImages);
67 imageBuffer =
new CByteImage*[2];
68 openposeResultImage =
new CByteImage*[1];
74 enableResultImages(1, imageProviderInfo.imageFormat.dimension, imageProviderInfo.imageFormat.type);
78 RGBDOpenPoseEstimationComponentPluginUser::postOnConnectImageProcessor();
81 void LegacyRGBDOpenPoseEstimation::onDisconnectImageProcessor()
83 RGBDOpenPoseEstimationComponentPluginUser::preOnDisconnectImageProcessor();
87 RGBDOpenPoseEstimationComponentPluginUser::postOnDisconnectImageProcessor();
90 void LegacyRGBDOpenPoseEstimation::onExitImageProcessor()
94 void LegacyRGBDOpenPoseEstimation::process()
99 if (result_image_ready)
101 std::lock_guard outputImage_lock(openposeResultImageMutex);
103 provideResultImages(openposeResultImage, imageMetaInfo);
107 if (!waitForImages(providerName))
111 <<
" (#timeout " << timeoutCounter2d
112 <<
", #read error " << readErrorCounter2d
113 <<
", #success " << sucessCounter2d <<
")";
117 std::lock_guard lock_images(imageBufferMutex);
118 if (
static_cast<unsigned int>(getImages(providerName, imageBuffer, imageMetaInfo)) != numImages)
120 ++readErrorCounter2d;
122 <<
" (#timeout " << timeoutCounter2d
123 <<
", #read error " << readErrorCounter2d
124 <<
", #success " << sucessCounter2d <<
")";
132 std::lock_guard lock_rgb(rgbImageBufferMutex);
133 std::lock_guard lock_depth(depthImageBufferMutex);
134 ::ImageProcessor::CopyImage(imageBuffer[0], rgbImageBuffer);
135 ::ImageProcessor::CopyImage(imageBuffer[1], depthImageBuffer);
137 timestamp_of_update = imageMetaInfo->timeProvided;