How can I synchronize motion tracking data using OpenCV with UE4?

Hi everyone!

I’d like to track fiducial marker on deformable non-rigid surface like paper and cloth using OpenCV. Then I will projection mapping the real object through this tracking data. There is more eidetic way to tracking and projection method in openCV, but I want more various features such as invisibility cloak, digital draping and some more. (That’s why i choose the UE4.) For these reasons, I have to sync the tracking data with UE4.

I’m currently implementing the thesis in graduate school, so i can’t use the motion capture hardware like Kinect. I have only one Infrared lamp and camera(with infrared filter). Is there any way to sync the tracking data with UE4 in real time like Iclone or Faceshift? Thanks for any answers.

I will assume that you are able to track the markers using ONLY OpenCV already.

After setting everything up in UE4 and it runs fine, all you have to do is have a thread that updates a variable called CameraTransform. Then you make a function that returns this variable through C++ or blueprint and use it every tick to set the transform of the camera.

IF you want a guide on how to do the tracking or how to properly import the code and link with OpenCV libraries then you wont get one. For the former, go google and get it to work. It is not a UE4 problem. For the latter, go google linking third party libraries with UE4.


Thank you very much :slight_smile:

I work on the implement track system with openCv base this tutorial "A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums ",so, added the KCF tracker and objects and etc … , everything work fine but my problem is i don’t know where can i update tracker frame,my goal is tracking any movement object by under mouse click.Thanks for any help.