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

Examples doesn't work with HoloLens2 #58

Open
ghost opened this issue Sep 12, 2024 · 7 comments
Open

Examples doesn't work with HoloLens2 #58

ghost opened this issue Sep 12, 2024 · 7 comments

Comments

@ghost
Copy link

ghost commented Sep 12, 2024

Hello, I purchased OpenCV for Unity asset and followed this tutorial. The app was successfully deployed on HoloLens2, but it doesn't work properly. Here are some issues showing on my end:

  1. Interactions doesn't work. I'm not sure if the examples use hand interaction or eye gaze, but neither of those let me press buttons.
  2. The "HLFaceDetectionExample" shows a white screen in HoloLens and didn't detecting faces.
    image

Any help will be appreciated. Thank you :)

@EnoxSoftware
Copy link
Owner

Hi,
I have not encountered problems 1 and 2 so far in my environment. I can't seem to come up with a cause right away.
As for the CameraStream in Hololens2 not working and not displaying video, why don't you first create a simple project and try to see if HoloLensCameraStream is working properly on its own?
https://github.com/EnoxSoftware/HoloLensCameraStream

@ghost
Copy link
Author

ghost commented Sep 16, 2024

I tested the video panel example from HoloLensCameraStream and it's working on HoloLens2 :)
I was wondering if it's okay I email you the Unity project.

image

Update: I changed the Camera and Input settings from HoloLens1 to HoloLens2 and it looks like it's using HoloLens2's camera. It's showing camera and tracking FPS values. Face detection is working when I run in Unity using webcam, but it's not showing any detection in HoloLens2. Also, the detection box is white instead of red. Do you know how do I change that color? Thank you for taking the time helping me :)

@EnoxSoftware
Copy link
Owner

Hmmm, I have never had a similar error in my environment,...
I heard that HololensCameraStream is working fine, for example, is the simple HLCameraStreamToMatHelperExample displaying the camera footage?
HLFaceDetectionExample just adds face detection to it.

@ghost
Copy link
Author

ghost commented Sep 23, 2024

Hello, I tried the HLCameraStreamToMatHelperExample and it's working. However, HLCameraStreamToMatHelperExample is showing a rectangle shape canvas behind headset's front view which displays comic filter. The face detection example still doesn't work for me even I checked "Display camera image". It's showing the image but still behind headset front view and no face detection :)

image

@EnoxSoftware
Copy link
Owner

Sorry for the late reply.
We were doing some verification work in our environment (Unity2021.3.35.f1, Hololens2, OpenCVForUnity2.6.2). As a result, we found that a bug exists in the face detection by CascadeClassifier. As you informed me, the results in the PC editor were different from the results in Hololens2.
Apparently, this bug has been present since OpenCVForUnity 2.5.8 and is related to the OpenCV version and the presence of the compile-time optimization options “NEON” and “FP16”.
We need more time to investigate the exact cause of the bug and how to fix it.
We will update OpenCVForUnity in the next few days with a fix for the problem. Please wait a little longer.

Also, the issue of the rectangle shape canvas being displayed behind it has not occurred in our testing. We will look into it a bit more.

@EnoxSoftware
Copy link
Owner

A new version of HoloLensWithOpenCVForUnityExample is now available that fixes a bug in face detection. Please set it up with the latest OpenCVForUnity2.6.3.
Thank you for your report.

The issue with the rectangular canvas behind is often caused by not adding the proper Scripting Define Symbols during the setup phase of HoloLensCameraStream.

@ghost
Copy link
Author

ghost commented Oct 1, 2024

Thanks for your help. I'll test with the latest version and keep you updated.

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

1 participant