HoloLensWithOpenCVForUnityExample icon indicating copy to clipboard operation
HoloLensWithOpenCVForUnityExample copied to clipboard

Examples doesn't work with HoloLens2

Open ghost opened this issue 1 year ago • 7 comments

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 :)

ghost avatar Sep 12 '24 22:09 ghost

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

EnoxSoftware avatar Sep 13 '24 09:09 EnoxSoftware

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 :)

ghost avatar Sep 16 '24 20:09 ghost

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.

EnoxSoftware avatar Sep 20 '24 08:09 EnoxSoftware

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

ghost avatar Sep 23 '24 18:09 ghost

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 avatar Sep 27 '24 09:09 EnoxSoftware

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.

EnoxSoftware avatar Sep 29 '24 21:09 EnoxSoftware

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

ghost avatar Oct 01 '24 21:10 ghost