Comments (8)
Hi Hemanth, I know that its been a while, but could you point out what the error was. I was able to extract the 68 feature points but need some help on getting the pose parameters from those points.
Thanks!
from clm-framework.
Hi,
You can do that using the PDM::CalcParams(Vec6d& out_params_global, const Mat_<double>& out_params_local, const Mat_<double>& landmark_locations, const Vec3d rotation)
function. You can pass it the ground truth location in the landmark_locations matrix (and optional initial rotation estimate), and it will return out_params_global
which will include scaling, translation, rotation parameters, which can be used with camera parameters to get a head pose estimate (or used directly, but that will not account for perspective transform).
Thanks,
Tadas
from clm-framework.
Hi,
Thanks for the quick answer. I will try this out.
Just to confirm, your approach does not account the perspective transform in visualizing the tracking results, right ?
In other words, your landmark detection and tracking process does not encode or somehow calculate the perspective information. Am I correct ?
Thank you
from clm-framework.
The landmark detection does not account for the perspective transform explicitly, neither does the CalcParams
, but the Vec6d pose_estimate_to_draw = CLMTracker::GetCorrectedPoseWorld(clm_model, fx, fy, cx, cy);
does as it uses the camera focal lengths and optical centers.
-Tadas
from clm-framework.
Ah, I get the complete picture now 👍 Thanks so much :)
from clm-framework.
Hi Tadas,
I tried to use the CalcParams() function in a standalone fashion. But I am not getting the correct head pose. I am sure that I am doing something wrong. Could you take a look at the minimal code below and give your opinion ?
Thanks.
#include "CLM_core.h"
#include <fstream>
#include <sstream>
#include <boost/accumulators/accumulators.hpp>
using namespace std;
using namespace cv;
int main (int argc, char **argv)
{
// Assuming 640x490 images
float fx = 500, fy = 500, cx = 320, cy = 245;
//Image sequence read from a file
std::ifstream imageFile("Path_Images.txt");
if(!imageFile.good())
{
std::cout << "Image list not found." << std::endl;
return 0;
}
CLMTracker::PDM pdm;
pdm.Read("./bin/model/pdms/In-the-wild_aligned_PDM_68.txt");
string line;
cv::Vec6d pose_params = 0;
while(getline(imageFile, line))
{
Mat im = cv::imread(line, CV_LOAD_IMAGE_COLOR);
line.replace(line.size()-3, 3, "pts");
cv::Mat_<double> landmarks(136, 1);
std::ifstream landmarkFile(line.c_str());
if(!landmarkFile.good())
{
std::cout << "Landmark file: " << line << " not readable" << std::endl;
return 0;
}
std::cout << "Processing Image: " << line << std::endl;
string temp;
landmarkFile >> temp;
landmarkFile >> temp;
landmarkFile >> temp;
for(int i=0; i< 68; i++)
{
landmarkFile >> landmarks.at<double>(i, 0);
landmarkFile >> landmarks.at<double>(i+68, 0);
}
cv::Mat_<double> local_params(34, 1);
local_params.setTo(0);
cv::Vec3d rotation;
rotation[0] = pose_params[3]; rotation[1] = pose_params[4]; rotation[2] = pose_params[5];
auto t1 = std::chrono::high_resolution_clock::now();
pdm.CalcParams( pose_params, local_params, landmarks, rotation);
auto t2 = std::chrono::high_resolution_clock::now();
auto timeTaken = std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1);
std::cout << pose_params << std::endl;
int thickness = 2;
CLMTracker::DrawBox(im, pose_params, Scalar(0, 0, 255), thickness, fx, fy, cx, cy);
imshow("tracking_result", im);
waitKey(1);
}
return 0;
}
from clm-framework.
Never mind. Figured it out and works like a charm :)
Thanks
from clm-framework.
Hi,Tadas,
I am confused about the world coordinate, what is the original point of this world coordinate. And what about the head coordinate space? I could not find any information about it. Thanks!^O^
Jane
from clm-framework.
Related Issues (20)
- Dlib noncopyable issue HOT 2
- Make dlib not working on Ubuntu 15.10 HOT 2
- use with openframeworks HOT 1
- how to build a new model HOT 1
- whats' the AU's meaning? HOT 2
- How to use SimpleCLM HOT 4
- How to generate the pdm model with Multi-PIE dataset
- Split the pose estimation source and 68 landmark points from CLM framework. HOT 9
- Unity 3D receiver plugin?! HOT 1
- To change videos HOT 1
- How to use the gaze estimation?
- change the size of image of video
- Running on visual studio 2015 (build 3 )or 2017 HOT 2
- Face recognition limit value HOT 1
- clm-z doesn't work in OS X
- get distances between two points HOT 1
- Research approach concerning emotions of people with PIMD using physiological parameters and facial expressions
- eye model HOT 1
- open mouth HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clm-framework.