Override image feed into Vuforia in Unity - image

I want to record the video feed captured from Vuforia then play the scene back, allowing for the tracked image marker to be enabled or disabled upon playback. I know Vuforia allows me to access camera properties with Vuforia.CameraDevice.Instance but there doesn't seem to be a way to override the incoming image with a prerecorded one.
I know I could record the state (position and rotation) of the objects during the recording but it seems more elegant for them to be tracking in realtime based off a prerecorded video feed. Thanks.

I attempted this as well, to no avail.
From: Is is possible to use Vuforia without a camera?
...but the Vuforia SDK prevents the use of any other source than the camera.
I guess the main reason for this is that the camera management is fully handled internally by the Vuforia SDK, probably in order to make it easier to use as managing the camera by ourselves is at best a boring task (lines and lines of code to repeat in each project...), at worst a huge pain in the ass (especially on Android where there are sometimes devices than don't behave as expected).

Related

AudioAnalyser with three.js

https://glitch.com/edit/#!/pulseball?path=cube_audio_analyser2.0.html%3A1%3A0
I am trying to create an audio analyser in Three.js (see link above) also the sound file is in the assets. I am getting an error three.js:41273 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.
So i have put in sound.resume() in the play function (see code) but i the error is still there i can click on the play and pause buttons and the track is played but i don't think the audio analyser is working. I have looked at the docs and some examples from Three.js and the web audio api copied the code from these sources but there is no reaction from the musical data to animate the cube. Could someone please help as I am sure what to do next.
thanks
Because of CORS restriction, it's not possible to load the audio file from glitch. I've slightly updated your code and use now an audio file from the official three.js repository. Check out how the frequency data are logged in the browser console.
https://orchid-iodized-action.glitch.me

How to get all frames of an animated GIF using TWICImage?

I'm working with Embarcadero RAD Studio XE7. In this context, I'm interested to use the Windows Imaging Component (WIC) library to read and show the content of an animated GIF image.
I saw that the VCL provides a TWICImage component, which with I'm able to read easily the first frame of my animated GIF. Now I want to implement a timer to loop through all my frames and show them one by one, in order to show the complete GIF animation on my form.
Which properties the TWICImage provides to do that?
So, as the VCL TWICImage component seems strongly limited, and as I cannot reach my goals using it, I decided to write my own wrapper around the WIC library.
For those who would encounter the same difficulty, I also advise you to implement your own wrapper, it is not such a difficult task.
It's a shame for the TWICImage component, but unfortunately it seems to have been sloppy.
Thanks for all the above replies.

Is there a way to implement pinch-zoom and panning on an Image without relying on animations?

I’m working with an Image control and I’m trying to implement pinch-zoom and panning.
None of the ready-to-go samples on the web, which handles the zoom and pan, worked as smoothly as the native Photos app on Windows Phone or like when viewing an image in Internet Explorer.
This led me to implement my own way of handling them which included me trying the following ways: (Scaling works as of now and I’m trying to get the panning to work too)
Putting the Image inside a ViewportControl; resulted in incredibly jerky scaling, but panning works smoothly. Setting UseOptimizedManipulationRouting="False" on the image didn't make a difference.
Putting the Image inside a ScrollViewer; scaling doesn't even work and panning is glitchy (jerky sometimes).
Using only the Image control and making use of animations to handle the smooth panning.
I haven't implemented step 3 yet, because I can't shake the feeling I've missed something. How can something so widely used be this hard to implement? :|
So my question is
What do I need to do to implement pinch-zoom and panning as smooth as in the Photos app?
If animations are the way to go can they be used to smooth scaling and translations to match that of the native experience?

can we get window handle of the window which is playing video?

Is there any way to get window handle of the window which is currently playing video. This is the only information my program will be having.
updated to include info incorrectly provided as an answer
I think I should explain what exactly I want to achieve here.
I actually wanted to share/stream my DVD data to the remote machine. Currently what I am doing is, I am capturing the screen/video into to still frames and sending it to remote system but now I don't want to see the playing video on my host machine. I could think of few probable solutions,
1.) If we can capture the data of a hide/minimized window.
Did some investigation and seems it is not possible. Please add your thoughts.
2.) Convert the DVD data format into ffmpeg format and stream it.
Don't have any idea if we will be allowed to convert the data format. If most of the DVD formats allow to covert then I can go for this option but not sure how complicated it could be.
3.) Will create some virtual surface play the DVD data to that surface and capture the screen of that surface.
Again not sure if DVD will play on that virtual/fake surface created by kernel mode driver.
There are probably three main playback engines used on windows; DirectShow (WMP, MPC) , ffmpeg (VLC, MPlayer) and QuickTime.
If you look closer at DirectShow will will see that it supports hardware overlays, windowed and windowless rendering and Direct3d surface support.
Even if you focus on a single app you are going to have problems since you don't know what kind of renderer is in use. You might be able to find a child window that always has the same position and dimensions as the video, but then you are relying on things that could change between versions etc.

OpenCV camera stream stopping while in fullscreen mode

I want to have two aplications simultaneously run: one that analyzes image from webcam written using OpenCV (the image is acquired through callback function) and an application that goes into fullscreen mode (let's say a 3D game). The problem is that while the fullscreen mode is launched the webcam image stream is stopping - the frames simply don't turn up, the callback function isn't called. This seems to be an issue with OpenCV - to test that a simple application displaying the image form camera has been prepared.
Why the image stream could be blocked by the fullscreen mode? How to bypass this?
Thanks for any hints.
Your question does not tell if you have tried to search for the problem in the OpenCV community first, so I post this as a hint in case: http://tech.groups.yahoo.com/group/OpenCV/
Also check out the list of issues, maybe its a known bug: https://code.ros.org/trac/opencv/report/1
I'm not an OpenCV expert so this is closer to a suggestion than an answer - but I've experienced similar on my multi-monitor setup using a number of media players on the second monitor and some fullscreen apps ont he first.
In my limited testing, it comes down to what method is used to render the 3d app - DirectX seems to stop media players, OpenGL doesn't.
So it might not be OpenCV which has a problem - it may be what DirectX does to the hardware during a full-screen game.
Actually the behaviour of the OpenCV camera stream is strange. It seems to depend on the native OpenCV window (cvNamedWindow()) that shows the output image form webcam. If the window is on the same screen that went fullscreen the streaming will continue. If the camera window would be placed on another screen, the stream would stop.
Another curious thing is with the screen resolution change. If you change the resolution of the screen and the camera window is not visible (is closed or even minimalized) the image stream would get blocked.
These are just my observations on the topic, maybe it'll be helpful for someone.

Resources