Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird offset in image when using this with facetracking #12

Open
faaip opened this issue Jun 21, 2016 · 4 comments
Open

Weird offset in image when using this with facetracking #12

faaip opened this issue Jun 21, 2016 · 4 comments

Comments

@faaip
Copy link

faaip commented Jun 21, 2016

Hey.

This might not be the right place to post this, but I'll give it a shot. I'm trying to use a Black Magic deck link and use the image for facetracking using ofxDlib. For some reason it seems as though it is successfully tracking the face, but drawing the facetracking with some kind of offset.

This isn't a issue when using the built in webcam, which is my reason for posting this here.

screen shot 2016-06-21 at 17 05 13

Do you know how I could fix this?

Sorry if this issue is unrelated to ofxBlackMagic.

Best regards,
Frederik

@smallfly
Copy link
Collaborator

Hi,

Are you sure you are using the same image (format, resolution, etc) to feed the tracker and to display in the window?

Hugues.

@faaip
Copy link
Author

faaip commented Jun 21, 2016

Hi Hugues.

If I run the entirely same program, but using the webcam input it tracks without any issues. It is completely bewildering to me, since it seems to be tracking somehow but not offset with a certain proportionality. I've tried with different setups and I only get this outcome using BlackMagic.

@smallfly
Copy link
Collaborator

I was not clear.

With ofxBlackMagic you have access to the 'video data' in different formats.
Therefore are you sure you are using the same 'image' to feed the tracker and to display?
Are you drawing the image at the same size of the 'image' that you are feeding the tracker with?
Also with ofxBlackMagic the data includes 4 channels (ARGB or RGBA).

Those are things I thinking of without looking at your code, sorry if you have already checked all that.

@faaip
Copy link
Author

faaip commented Jun 23, 2016

Hi Hugues.

This is my code below.
`//--------------------------------------------------------------
void ofApp::setup(){
ft.setup("");
// video.setDeviceID(0);
// video.setup(720, 480);
cam.setup(1280, 720, 59.94);

}

//--------------------------------------------------------------
void ofApp::update(){
if(cam.update()){
ft.findFaces(cam.getColorPixels());
}
}

//--------------------------------------------------------------
void ofApp::draw(){
ofSetColor(255);
ofImage i = cam.getColorPixels();
i.draw(0, 0);
ft.draw(); // Drawing facetracker
}`

Here I added cam.getColorPixels() to ofImage i, just to be sure that they were fed the same as the face tracker. The offset is not a constant, but seems to increase the further I move to the right in the picture.

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants