microsoft / HoloLensForCV

Sample code and documentation for using the Microsoft HoloLens for Computer Vision research
MIT License
475 stars 154 forks source link

ArUco Marker Tracker without Research Mode #61

Open verenoiu opened 6 years ago

verenoiu commented 6 years ago

Hi!

I started writing an ArUco based marker tracker for the HoloLens, using the HoloLensForCV project as a base and came across a few issues that maybe you could help me with. In contrast to the ArUcoMarkerTracker, I only want to access the PhotoVideo SensorType. So instead of triangulation between the sensors and the detected corner locations of the marker, I'm using the camera intrinsics provided by SensorFrame and the void cv::aruco::estimatePoseSingleMarkers(InputArrayOfArrays corners, float markerLength, InputArray cameraMatrix, InputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs ) to get the estimated position and orientation of the tracked marker. On this pose I'm applying different transformations to get the position in the right coordinate system:

_markerSlateRenderer->SetMarkerMatrix(markerTransformationCV * (frameToUsedCoordinateSystem * headCoordinates));

with

While the orientation of the virtual (hologram) marker looks fine and aligns with the real world marker, the position seems a bit off (a small, but significant offset). I also noticed that when reducing the frame resolution (and with that increasing the fps) the positioning gets a little bit more accurate. Do you have any idea where this offset might come from? Is there a mistake in those transformations or could this inaccuracy be caused by only using one camera frame for position prediction? I'm relatively new to this marker tracking for HoloLens topic, so any suggestions might be really helpful. Thank you in advance!

nmsmith commented 6 years ago

I'm about to embark on a similar project, so I'd like to hear about whether this is an actual bug or if it has/can be resolved.

nmsmith commented 6 years ago

I think the same problem with the RGB camera projection is mentioned in this issue? https://github.com/Microsoft/HoloLensForCV/issues/64#issuecomment-432298029

franckies commented 4 years ago

I'm the only one getting an FPS of 7 instead of 60 running the application? Reducing frame resolution solved for you?