OpenCV -- record browser window instead of capturing camera output? - macos

I'm trying to get started with OpenCV by trying to write a simple screen recorder -- one that can perform continuous or polled capture of a GUI window on Mac. For example, I could capture the client area of a browser window.
I'm sure this is possible, but I don't know where to start -- any pointers? Is the framegrabber to read the GUI window an OSX/Cocoa thing, or an OpenCV call?

You'll have to deal with the operating system you're dealing with. I've seen some software where they install a driver. It emulates a camera and streams your desktop into the camera. That way you can use OpenCV's functions to get access to the desktop.

I think you'll have to deal with MacOSX components as CoreVideo... and to make some objective-c bindings.

Related

StartScreenCapturebyWindowId() not excluding overlapping windows for certain programs (Agora Unity)

I am trying to setup individual window sharing for a project in Unity for Windows. The way I'm currently going about doing this is by using EnumWindows(), IsVisableWindow(), and GetWindowText() to create a dictionary of window titles and handles, then calling StartScreeCapturebyWindowId() to share the selected window.
This works relatively well for most process; the window of the process and only the window of the process is streamed. However, for certain programs (like Google Chrome, Discord, and Windows Photos) the captured area is set correctly, but overlapping windows are not culled out.
Does anyone know what could be causing this problem? Is there something wrong with the way I'm grabbing the handles for these windows? Or is there something about starting a screen capture that I am missing?
You certainly did the correct things. However, you also hit the limitation to the Windows part of the SDK. To understand this better, the set of programs are UWP applications. They have different ways to share the visible pixels. Previously version of Agora SDK could not even show the window. Starting from 3.0.1, the SDK uses Rectangle cutting method to get the window display. You may further read the online documentation about that API here.
There isn't much Agora can do for the near term. So you will just need to deal with the user experience (e.g. by warning them) or look at solutions like using Web SDK instead.

How to draw directly to an inactive display?

I noticed that, when you are changing monitor resolutions in Windows with extra monitors attached, you can select "Show desktop only on [n]" (where n is the number of your various displays).
Is it possible to write a program that will open an extra monitor (not being used by Windows, but plugged into the video card) and write image data to it (directly or through OpenGL or something)? Where would I begin looking to accomplish this?
It does not appear to be possible to draw directly to a monitor device. It may become possible to some extent with the release of Nvidia and ATI's updated drivers for VR headsets, however it seems that these are only available for Oculus Rift at the moment, with other VR headsets forthcoming.
I haven't found any mention of whether or not they intend to open this feature up to general use with any plug-and-play monitor.

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.

Anyone know what program the Apple store demos likely use to make their interactive desktop

I have a project that I am attempting to do and we want something similar to what the Apple store does. We thought it was a Quartz Composer interactive desktop but I've been putting together an xcode cocoa solution to do it too.
Here is an image of what I'm wondering about it is just a Title and 3 images that link out to url locations. If anyone can point me in the direction they believe can make something like this I would appreciate it.
I have used Quartz Desktop to display a .qtz but it isn't interactive. If anyone knows of another quartz desktop displaying .app that does use the interactive parts such as mouse and keyboard, it would be appreciated.
Applestore demo http://img707.imageshack.us/img707/614/dsc03934y.jpg
It's a custom proprietary program called, if I remember correctly, Concierge. But it's not doing anything tricky. You can make any NSWindow appear on the desktop by setting its window level to kCGDesktopWindowLevel.

Multiple mouse cursors on Windows 7

We are using CPNMouse for an application running on Windows XP. One mouse device is detached from the normal event queue, so we can get it's position and events and draw the cursor ourselves.
Unfortunately, CPNMouse does not work on Windows Vista/7 (see here). Is there any library/SDK that provides the same capabilities on Windows 7?
Just to clarify - we want the "normal" cursor to be present and to draw another cursor, that should be mapped to a different mouse device.
Update:
CPNMouse is no longer supported and its previously "open source" withdrawn from SourceForge. Only this legacy documentation page exists on the official CPN Tools site.
Looks like only commercial products are available...
MiniFrame SoftXpand
MultiMouse
If anyone has a copy of the original source from SourceForce please post a link here... Assuming the original license was a standard SourceForge (open to share/expand) variant it should be okay for someone to fork it to a new project for continued development (of a free tool).
Take a look at the MultiPoint SDK, which allows for up to 25 cursors on the same display, which also supports Windows 7.
You should use the dsf from the windows ddk to create an emulated mouse device then any program can accept input from that specific emulated mouse device and draw the pointer it self. So any program you create will have multiple mouse devices in it. Its sad to say that its not possible to have multiple pointers in windows 7 OS though they specifically dont support it. So you would have to draw the poiner onto the screen yourself.
Im afraid the point is you need to draw a pointer yourself for the mouse
You want the "Raw Input" API which comes with the Windows Platform SDK: MSDN: About Raw Input

Resources