typedef struct {
int x; /**< X-axis coordinate of the point in 2D space */
int y; /**< Y-axis coordinate of the point in 2D space */
+ float z; //int z;
} mv_point_s;
/**
typedef struct _FacialLandMarkDetectionResults {
int number_of_landmarks;
- std::vector<cv::Point> locations;
+ std::vector<cv::Point3f> locations;
} FacialLandMarkDetectionResults; /**< structure FacialLandMarkDetectionResults */
typedef struct _PoseLandmarkDetectionResults {
{
float score;
cv::Point heatMapLoc;
- cv::Point2f decodedLoc;
+ cv::Point3f decodedLoc;
int id;
bool valid;
} LandmarkPoint;
float getPointX(int poseIdx, int partIdx);
float getPointY(int poseIdx, int partIdx);
+ float getPointZ(int poseIdx, int partIdx);
float getScore(int poseIdx, int partIdx);
};
LOGE("imgW:%d, imgH:%d", mSourceSize.width, mSourceSize.height);
for (int landmarkIndex = 0; landmarkIndex < number_of_landmarks; landmarkIndex++) {
results->locations.push_back(
- cv::Point(poseDecoder.getPointX(0, landmarkIndex) * static_cast<float>(mSourceSize.width),
- poseDecoder.getPointY(0, landmarkIndex) * static_cast<float>(mSourceSize.height)));
+ cv::Point3f(poseDecoder.getPointX(0, landmarkIndex) * static_cast<float>(mSourceSize.width),
+ poseDecoder.getPointY(0, landmarkIndex) * static_cast<float>(mSourceSize.height),
+ poseDecoder.getPointZ(0, landmarkIndex)));
}
results->number_of_landmarks = results->locations.size();
point.x = static_cast<int>(*loc++ * mSourceSize.width);
point.y = static_cast<int>(*loc++ * mSourceSize.height);
- LOGI("x:%d, y:%d", point.x, point.y);
+ LOGI("x:%d, y:%d", static_cast<int>(point.x), static_cast<int>(point.y));
}
}
poseDecoder.getPointX(poseIndex, part) * static_cast<float>(mSourceSize.width);
poseResult->landmarks[poseIndex][landmarkIndex].point.y =
poseDecoder.getPointY(poseIndex, part) * static_cast<float>(mSourceSize.height);
+ poseResult->landmarks[poseIndex][landmarkIndex].point.z =
+ poseDecoder.getPointZ(poseIndex, part);
poseResult->landmarks[poseIndex][landmarkIndex].label = landmarkIndex;
poseResult->landmarks[poseIndex][landmarkIndex].score =
poseDecoder.getScore(poseIndex, part);
float PoseDecoder::getPointX(int poseIdx, int partIdx)
{
- LOGI("idx[%d]-part[%d]", poseIdx, partIdx);
return mPoseLandmarks[poseIdx].landmarks[partIdx].decodedLoc.x;
}
float PoseDecoder::getPointY(int poseIdx, int partIdx)
{
- LOGI("idx[%d]-part[%d]", poseIdx, partIdx);
return mPoseLandmarks[poseIdx].landmarks[partIdx].decodedLoc.y;
}
+ float PoseDecoder::getPointZ(int poseIdx, int partIdx)
+ {
+ return mPoseLandmarks[poseIdx].landmarks[partIdx].decodedLoc.z;
+ }
+
float PoseDecoder::getScore(int poseIdx, int partIdx)
{
return mPoseLandmarks[poseIdx].landmarks[partIdx].score;
mPoseLandmarks.clear();
- LandmarkPoint initValue = {0.0f, cv::Point(0,0), cv::Point2f(0.0f, 0.0f), -1, false};
+ LandmarkPoint initValue = {0.0f, cv::Point(0,0), cv::Point3f(0.0f, 0.0f, 0.0f), -1, false};
if (mMeta.GetLandmarkType() == INFERENCE_LANDMARK_TYPE_2D_SINGLE ||
mMeta.GetLandmarkType() == INFERENCE_LANDMARK_TYPE_3D_SINGLE) {
if (thresHoldRadius > 0.0f) {
bool isSkip = false;
for (auto& result : mPoseLandmarks) {
- cv::Point2f dfRadius = result.landmarks[root.id].decodedLoc;
+ cv::Point3f dfRadius = result.landmarks[root.id].decodedLoc;
dfRadius -= root.decodedLoc;
float radius =
std::pow(dfRadius.x * scaleWidth, 2.0f) +
mPoseLandmarks[0].landmarks[idx].score = pscore;
mPoseLandmarks[0].landmarks[idx].heatMapLoc = cv::Point(-1, -1);
- mPoseLandmarks[0].landmarks[idx].decodedLoc = cv::Point2f(px / scaleWidth, py / scaleHeight);
+ mPoseLandmarks[0].landmarks[idx].decodedLoc = cv::Point3f(px / scaleWidth, py / scaleHeight, 0.0);
mPoseLandmarks[0].landmarks[idx].id = idx;
mPoseLandmarks[0].landmarks[idx].valid = true;
for (int idx = 0; idx < mNumberOfLandmarks; ++idx) {
float px = mTensorBuffer.getValue<float>(mMeta.GetLandmarkName(), idx * landmarkOffset);
float py = mTensorBuffer.getValue<float>(mMeta.GetLandmarkName(), idx * landmarkOffset + 1);
+ float pz = mTensorBuffer.getValue<float>(mMeta.GetLandmarkName(), idx * landmarkOffset + 2);
mPoseLandmarks[0].landmarks[idx].score = poseScore;
mPoseLandmarks[0].landmarks[idx].heatMapLoc = cv::Point(-1, -1);
- mPoseLandmarks[0].landmarks[idx].decodedLoc = cv::Point2f(px/scaleWidth, py/scaleHeight);
+ mPoseLandmarks[0].landmarks[idx].decodedLoc = cv::Point3f(px/scaleWidth, py/scaleHeight, pz);
mPoseLandmarks[0].landmarks[idx].id = idx;
mPoseLandmarks[0].landmarks[idx].valid = true;
- LOGI("idx[%d]: %.4f, %.4f", idx, px, py);
+ LOGI("idx[%d]: %.4f, %.4f, %.4f", idx, px, py, pz);
}
mPoseLandmarks[0].score = poseScore;
for (int landmark_idx = 0; landmark_idx < numberOfLandmarks; ++landmark_idx) {
locations[landmark_idx].x = facialLandMarkDetectionResults.locations[landmark_idx].x;
locations[landmark_idx].y = facialLandMarkDetectionResults.locations[landmark_idx].y;
+ locations[landmark_idx].z = facialLandMarkDetectionResults.locations[landmark_idx].z;
}
detected_cb(source, numberOfLandmarks, locations.data(), user_data);
Name: capi-media-vision
Summary: Media Vision library for Tizen Native API
-Version: 0.12.6
+Version: 0.12.7
Release: 0
Group: Multimedia/Framework
License: Apache-2.0 and BSD-3-Clause
install(TARGETS mv_facestream_test_suite DESTINATION ${CMAKE_INSTALL_BINDIR})
-
-
-add_executable(mv_posestream_test_suite mv_posestream_test_suite.cpp)
-
-target_link_libraries(mv_posestream_test_suite mv_inference
- ${OpenCV_LIBS}
- gstreamer-1.0
- glib-2.0
- capi-system-info
- dlog
- mv_image_helper
- mv_video_helper
- mv_testsuite_common
- cairo
- ${${PROJECT_NAME}_LIBRARIES}
- )
-
-install(TARGETS mv_posestream_test_suite DESTINATION ${CMAKE_INSTALL_BINDIR})
\ No newline at end of file
float maxAlpha = 0.8f;
for (int pt=0; pt < landmarks; pt++) {
- printf("%d: x[%d], y[%d]\n", pt, locations[pt].x,locations[pt].y);
x = static_cast<float>(locations[pt].x) / 192.f * static_cast<float>(faceSkeleton.fRoi.width);
y = static_cast<float>(locations[pt].y) / 192.f * static_cast<float>(faceSkeleton.fRoi.height);
faceSkeleton.fLmark[pt].x = static_cast<int>(x) + faceSkeleton.fRoi.point.x;
faceSkeleton.fLmark[pt].y = static_cast<int>(y) + faceSkeleton.fRoi.point.y;
-
+ faceSkeleton.fLmark[pt].z = locations[pt].z;
+ printf("%d: x[%d], y[%d], z[%f]\n", pt, faceSkeleton.fLmark[pt].x,
+ faceSkeleton.fLmark[pt].y,
+ faceSkeleton.fLmark[pt].z);
}
}