Comments (8)
is it possible to do the same when using HoloLensARToolkit?
Yes, in the ARUWPMarker
script, the function getMarkerTransformationMatrix
returns the current transformation from the marker to the camera, in Matrix4x4 format. You can use it with the function getMarkerVisibility
to check if the marker is currently visible.
the frame rate is dropping down to 7-9 fps, is that expected?
It is not normal, for me, it is at least 20fps. When you build the app from Visual Studio to HoloLens, did you choose the release version? or choose "start without debugging". When it is being debugged using VS, the frame rate is low.
Is there a way to control the lifecycle of video capture / marker tracking so that it can be triggered based on user input
Yes, in the ARUWPController
script, there is a parameter enable
. I think you can tune this to enable/disable tracking.
from hololensartoolkit.
Hello @qian256 ,
Thank you for the response and apologies for late reply. I tried using the enable
parameter and stopRunning()
and startRunning()
methods. They seem to be working as expected, though there seems to be a different issue that might be related to the life cycle.
The web camera on HoloLens doesn't turn off (white LED indicating camera being active is on) even when ARUWPController
is disabled as and all related gameObjects
(webcam plane, display HUDs for FPS and AR etc.) are deactivated. Is there a way to explicitly turn off the web camera on HoloLens after ARUWPController
has been disabled?
from hololensartoolkit.
The functions stopRunning()
and startRunning()
controls the native libraries, not the behavior of the hololens camera. If you want to shut down the camera, you can try use Unity functions of WebCamTexture.Stop(), and you need to code a little bit to achieve it.
from hololensartoolkit.
Hello,
Thanks for the response and the suggestion. Yes I am already using WebCamTexture to shut down the camera but shouldn't the controller do this automatically specially when it explicitly starts the camera.
void Start () {
ARUWPUtils.aruwpRegisterLogCallback(Log);
ARUWPUtils.aruwpSetLogLevel((int)currentLogLevel);
lastTick = Time.time;
deltaTime = 0;
startWebcam();
startARUWP();
}
private void startWebcam() {
// init Webcam
WebCamDevice[] cam_devices = WebCamTexture.devices;
webcamTexture = new WebCamTexture(cam_devices[0].name, frameWidth, frameHeight, 15);
if (displayWebcam) {
webcamMaterial.mainTexture = webcamTexture;
webcamPlane.SetActive(true);
}
else {
webcamPlane.SetActive(false);
}
webcamTexture.Play();
}
What is your opinion about stopping the webcamTexture in either stopRunning()
or OnDestroy()
or shutDownAR()
? I can create a pull request if you think this is something that should be implemented.
from hololensartoolkit.
Thank you for the proposal of adding the function to properly shut down the webcam.
I suggest adding a new function called stopWebcam()
disable it. What is your opinion? I would definitely merge your implementation if it works.
from hololensartoolkit.
Hello @qian256
I have already been experimenting with this and have added two methods to my local clone of the repository
public void stopWebcam()
{
if(webcamTexture != null)
{
webcamTexture.Stop();
}
}
public void restartWebcam()
{
if(webcamTexture == null)
{
startWebcam();
} else
{
webcamTexture.Stop();
webcamTexture.Play();
}
}
Below are my observations:
-
Calling
stopWebcam()
does stop the web camera and this works fine the first time. -
When trying to start the camera after stopping it from the code results in no video feed, which I suspect is due to this issue: Unity/Linux - Unity does not free webcam when stopped
-
I also tried to destroy the object that has ARController and ARMarker scripts attached, this does solve the issue but is a hack and is a finicky solution.
(by the way, should we move this to a separate issue?)
from hololensartoolkit.
Thank you for the update! Yes please go ahead and open another issue regarding the control of camera feed, and the control of tracking functionality.
from hololensartoolkit.
is it possible to put an Object at few distance from cube marker in scene (HoloLensARToolKitCube)?
from hololensartoolkit.
Related Issues (20)
- Got NullReferenceException error with XR Plugin Management HOT 3
- Any method to get RGB video stream in HL2? HOT 8
- 获取相机固有属性和投影矩阵 HOT 1
- HL2: Is the marker tracking working from the play editor of Unity (in holographic remoting)? HOT 3
- About 180 rotation display of target object HOT 1
- Android version HOT 1
- Display the images shot by the camera in HL2?
- Imperfect alignment registration & the cube's pose changes following the head movement HOT 3
- Unity 2020LTS does not build project HOT 6
- Is HoloLensCamCalib enough to calibrate and align the HL2? Do we also need to do display calibration using 20 alignment described in the paper?
- Can't get multi marker to work
- Has anyone succeeded in unity 2020? HOT 3
- how can i get the marker postion
- Get video preview as RGB instead of grayscale
- Add Camera resolution for Hololens 2
- spiel für kinder
- Cube sample is not detected after calibration HoloLens2 HOT 1
- Has anyone succeed in unity2018?
- help me
- Has anyone managed to make it work with openxr?
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 hololensartoolkit.