microsoft / HoloLensForCV

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

How to use the current API #80

Open valavakilian opened 5 years ago

valavakilian commented 5 years ago

Hello. I'm a beginner with Microsoft Hololens technology and I'm trying to use the cameras and run a machine vision process on the video stream. My current program can run on a webcam by tacking frames and processing some of them. I clone this repository and build. Then I attempt to run the project ( For example compute on desktop ) after connecting the Hololens with the x86 and deploy Device or Remote Machine options enabled. Then I get the following responses. Error CS0006 Metadata file 'C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Debug\HoloLensForCV\HoloLensForCV.winmd' could not be found ReceiverPV C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Tools\ReceiverPV\CSC 1 Active Error CS0006 Metadata file 'C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Debug\HoloLensForCV\HoloLensForCV.winmd' could not be found ReceiverVLC C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Tools\ReceiverVLC\CSC 1 Active Error Cannot resolve Assembly or Windows Metadata file 'C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Debug\HoloLensForCV\HoloLensForCV.winmd' ReceiverPV C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Tools\ReceiverPV\ReceiverPV.csproj
Error Cannot resolve Assembly or Windows Metadata file 'C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Debug\HoloLensForCV\HoloLensForCV.winmd' ReceiverVLC C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Tools\ReceiverVLC\ReceiverVLC.csproj

I'm not sure How exactly to use the API or what the steps are for accessing the sensors. Could someone please help me a bit on the required steps for running this API?

chrisfromwork commented 5 years ago

Hello,

A missing winmd may mean that ReceiverVLC is missing a reference to HoloLensForCV. It may also mean that you have not yet built the HoloLensForCV winmd/dll when trying to compile ReceiverVLC.

1) Make sure ReceiverVLC has a reference to the HoloLensForCV project. You can right click on the ReceiverVLC project in solution explorer/visual studio to add references. 2) Make sure a build dependency is listed for HoloLensForCV in solution explorer/visual studio. It may be that a reference exists but that HoloLensForCV hasn't been added to the list of projects to build prior ReceiverVLC. 3) it may be that ReceiverVLC has both successfully referenced this project and built said project but the dll does not end up getting put on the device. Do the HoloLensForCV.dll and HoloLensForCV.winmd end up in your compile output directory? Is this error occurring when building, deploying or when running on the device?

valavakilian commented 5 years ago

Thanks you very much for helping me. I believe the problem occurs during Building time. And you were correct. I believe the HoloLensForCV winmd/dll are not built during complication (But I'm not sure ). I checked and RecieverPV and RecieverVLC do have HololensForCV as their references. In the Project dependencies/ Build Order I have the following order: Debugging Graphics HololensForCV OpenCVHelpers Holographic Rendering RecieverPV RecieverVLC ComputeOnDesktop BatchProcessing ArUcoMarkerTracker SensorStreamViewer

So I don't think the Second part is a problem.

I also noticed that there is a large number of errors in the files that even lead to syntax problems. My guess is as I can see in the 300 Errors I get on some of the files, many of the header files, libraries and scripts cannot be included . For example library errors such as :

Error (active) E1696 cannot open source file "App.g.h" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\App.xaml.h 14
Error (active) E1696 cannot open source file "MainPage.g.h" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\MainPage.xaml.h 14
Error (active) E1696 cannot open source file "opencv2/imgproc/imgproc.hpp" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 39
Error (active) E1696 cannot open source file "opencv2/features2d/features2d.hpp" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 40
Error (active) E1696 cannot open source file "opencv2/calib3d/calib3d.hpp" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 41
Error (active) E1696 cannot open source file "Debugging/All.h" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 45
Error (active) E1696 cannot open source file "Graphics/All.h" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 46
Error (active) E1696 cannot open source file "Rendering/All.h" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 47
Error (active) E1696 cannot open source file "OpenCVHelpers/All.h" ComputeOnDesktop C:\Users\V\HoloReasearchMode1.1\HoloLensForCV-master\Samples\ComputeOnDesktop\pch.h 48

I'm sorry but my level of knowledge is limited but I'm guessing that some of these projects are not being built and the including files are missing. Do you have any idea how I might be able to fix this ? Thank you

chrisfromwork commented 5 years ago

Hm, if I right click on ComputeOnDesktop in visual studio's solution explorer and choose to build the project, I don't hit these issues locally. What commit/branch are you currently using (run "git log" to view commit history)?

valavakilian commented 5 years ago

Thanks for all the help. Here is a view of my git log's last couple of commits: commit b3d3c73b6415333fb8338a5a3d62d14fd51c2324 (HEAD -> master, origin/master, origin/HEAD) Author: Johannes Schnberger johannes.schonberger@microsoft.com Date: Thu Jan 3 13:57:12 2019 +0100

Update outdated readme file in shared HoloLensForCV code

commit d8cd863e8b8524093f0aba7b249957dd089f7db7 Author: Johannes Schnberger johannes.schonberger@microsoft.com Date: Thu Jan 3 13:55:10 2019 +0100

Check if photo-video media frame has been started when saving app state

commit 729bd362453aeeff8d6e8dc3bf4ae8773d4355d0 Author: Johannes Schnberger johannes.schonberger@microsoft.com Date: Thu Jan 3 13:52:33 2019 +0100

Record photo video camera by creating separate media frame source group

commit 5549dceb364a1ca51a3e82a1ded64f12f4ab1400 Merge: 0a4454c 6910119 Author: Johannes Schnberger jsch@demuc.de Date: Tue Dec 4 16:40:26 2018 +0100

Merge pull request #71 from pablospe/master

Updating dense reconstruction options for Colmap 3.6-dev1

commit 691011989a33ab1267db92b5a710c14f75134166 Author: Pablo Speciale pablo.speciale@gmail.com Date: Tue Dec 4 15:58:52 2018 +0100

Updating dense reconstruction options for Colmap 3.6-dev1

commit 0a4454c877416120967b65ec5b952e3f06a2f6ca Merge: 280301f c4bb5eb Author: Pawel Olszta (MSFT) olszta@outlook.com Date: Tue Nov 27 07:29:39 2018 -0800

Merge pull request #68 from Microsoft/feature/SensorStreamingGroupDisplayNameFix

Add a check for the group display name when selecting Research Mode sensors

commit c4bb5eb2d2ee8fbab5a438da2645ed857b275158 (origin/feature/SensorStreamingGroupDisplayNameFix) Author: Pawel Olszta (MSFT) polszta@microsoft.com Date: Mon Nov 26 06:44:53 2018 -0800

Add a check for the group display name when selecting Research Mode sensors.

and git branch gives me :

valavakilian commented 5 years ago

I think I found the error. Every time I cloned the repository the three file : 1-Recorder 2-StreamerPV 3-StreamerVLC don't get loaded into the files . I tried running with downloading the zip file but it still doesn't show up. I don't know why this is happening but I just ran it with my friend's computer and now it runs fine. I will continue to see why this is happening. Thanks a lot for your help.

valavakilian commented 5 years ago

Hi. I decided to try once more to run the files on my system. It is very weird but even when I copy the project from my friend's computer, the three files mentioned above fail to load. It got even worse when I tried to reload the project from scratch after downloading the zip file. This time more files failed to reload (like some audio section ) . I specifically went to the zip folder properties and unblocked it so I can't see why this might happen.

untitled

Thank you

chrisfromwork commented 5 years ago

If those projects don't load, visual studio may be configured incorrectly. Is there an error message when right clicking those projects and trying to reload? My guess is that you may want to rerun the visual studio installer and make sure you have the visual c++ component and a windows sdk installed.

To find the installer look for vs_intaller.exe in your visual studio install path. Run the application and choose to modify your existing setup compared to update, repair, etc. Look under your universal windows platform development install and make sure you have checked the optional C++ Windows Universal Platform tools. Without this, I don't think you will be able to load or compile those c++ projects

image

valavakilian commented 5 years ago

Thank you very much. It was fixed as soon as I modified visual studio. I have a couple of versions of visual studio and I didn't keep track of which one has which package. Thank you very much for your help

USTBVEO commented 2 years ago

I am still faced with this problem that winmd file cannot be found. And I have checked my program with the advice you gave. Much appreciated if you could solve my problem! image