Screen Capture for subsequent Computer Vision Processing - c++

What should I use to perform screen capture on Windows for subsequent image processing?
I seek to do follow-up image processing in OpenCV.

Well the most straightforward thing to do is to use an off the shelf video capture tool to create an AVI file and then have image processing software operate on that, after the fact.
To get up and running:
CamStudio is free and open source and has a simple gui.
VirtualDub is also FOSS and is more powerful, but less intuitive to use. Its primarily a video editing and processing tool, but it actually has sophisiticated capture capabilities.
Both work on Windows and both can output uncompressed AVI files that OpenCV can read.
If you are completely new to OpenCV, then I recommend a O'Reilly's "Learning OpenCV". Its for the older OpenCV 1.1 but it will at least get you started.
If you crack open that book, and you find that its way above your head, then I would consider trying to do your image processing in a higher level language. MATLAB with the Image Processing Toolbox is well suited for rapid prototyping of image processing and its a much more forgiving development environment. Its an interpretative language, so you can see-as-you-code.
Based on the question as stated, this is as much info as I can provide. Perhaps consider providing more details about your specific application requirements?

Related

Image processing in ARM (angstrom)

I'm new to ARM and linux in general but I have eclipse set up for programming my beaglebone black (running angstrom). I want to process an image (local file) and then use the processed image information to turn on/off some LEDs.
What's the most best/most efficient way to process images with my setup? Should I make some script to process the image in Matlab or linux equivalent? If so how would I get the information from those programs into my c++ program? Or should I simply process the image in c++ (probably more difficult)?
This highly depends on what do you mean by process. If you want to do something complicated, I would recommend OpenCV since it offers a vast range of functionalities you can use to process your images.
That being said, if by process you mean extract text from images, you could take a look at Tesseract which is an open source OCR. If you will be going for an OCR, you could use OpenCV to do some pre-processing to make the text extraction process easier and more succesful.
If I am understanding you correctly, then you could take a look at this tutorial which should do what you are after (you start with an image and end up with a pixellated version of it).

DirectShow webcam recording

I need to use DirectShow (C++) for recording a webcam and saving the data to a file.
I really don't know how DirectShow works, this is a "stage" (working experience), but at school we didn't study it.
I think the best way to implement this could be:
List the video devices connected to the computer
Select the correct camera (there will be only one)
Retrieve the video
Save it to a file
Now there are two problems:
Where can I find a good reference book or how do I start?
The saved video shouldn't be too big, does DirectShow provide a way to compress it?
I won't use OpenCV because sometime it doesn't work properly (It doesn't find the camera).
Are there any high level wrapper that could help?
EDIT: the program won't have a window, it will run in background called by a dll.
Where can I find a good reference book or how do I start?
DirectShow introduction material
The saved video shouldn't be too big, does DirectShow provide a way to compress it?
Yes it provides capabilities to attach codecs, that needs to be installed in the system. These are typically third party codecs (for reasons beyond the scope of brief answer). You might want to record into Windows Media files to not depend on third party codecs. SWee more on MSDN: Choosing a Compression Filter.

webcam "still pin" capture

I am trying to replicate the image quality that is achieved when using the Logitech webcam driver to capture a still image.
The Logitech forum has several threads about the subject unfortunately they all point to a website which is down. such as here.
I am currently able to use DirectShow and a frame grabber to capture images, but they are nowhere near the quality of the snapshot button. Could anyone point me to the direction of a working c++/c example of a snapshot button?
After some research I found this about the Still Image pin, is this the correct method for implementing a snapshot like button?
The webcam I am using the c910 and is capable of taking 10 mega-pixel still images.
Thanks for any help.
My best guess, which I'll use to gather some upvotes (or downvotes), and which will be valid until someone disassembles the application or the driver, is:
Something alike http://www1.idc.ac.il/toky/videoproc-07/projects/superres/srproject.html was used at the application level to enhance the resolution of the images collected as a video.
Rationale: having a friend pulling his hair over simpler things inside the driver, I can only imagine how difficult it should be to code such an algorithm INSIDE the driver with extremely limited set of libraries.
I won't mind taking downvotes here, since I'm too interested in this subject, but please have some information available on the subject.
I did not have a chance to deal with this directly, however I suspect that high resolution images captured from the camera are a result of taking a sequence of images followed by "superresolution" post-processing. This functionality might be unavailable via DirectShow API, since it mostly covers video streaming. However, the camera driver might also make it available via Windows Image Acquisition API, where you might have better luck taking oversampled snapshots of the quality you are looking for.

Computer vision system toolbox MATLAB

I have found the image processing toolbox for matlab, but all demos included in that toolbox expect the input to be avi videos. Does this toolbox work with webcams and/or simple images? If yes, could someone show me how?
For live video, or still images from a camera your tool of choice is the image acquisition toolbox. This, combined with the image processing toolbox you found, makes matlab quite the powerful video processing tool.
This small sample shows how to read image files into matlab matrices.
I know this probably isn't very helpful, but Mathworks likes to push Simulink as their tool of choice for streaming applications, including video processing.
http://www.mathworks.com/products/computer-vision/index.html

How might one develop a program like FRAPS?

I would like to make a program to capture video.
What is the best way to capture video?
I know C++ and I'm learning assembly. I found in my assembly book that I can get data from the video card. Would that be the best way?
I know FRAPS hooks into programs, but I would like my program to take video of the entire screen.
I would like something something fast, with low memory usage if possible. A requirement is that the program must be usable on other computers, despite dissimilar hardware.
The way Fraps works, it's impossible to capture the entire screen (unless you're running a full-screen DirectX application, of course). You're apparently trying to emulate the functionality of CamStudio, more so than Fraps.
CamStudio is open-source (here is the SorceForge page) so perhaps you could start by studying the source code? I would wager that it's not really for beginners, however.
Capturing an entire screen is simple, in short you get a desktop handle (GetWindowHandle(0)) and BitBlt() it to your bitmap.
Now you need to encode it to video, potentially full HD or more, in real time, using the best possible compression, ideally lossless because of text on the screen and vector graphics nature of traditional desktops. I don't know any good custom codec for such requirements so would recommend to use traditional h.264 and tune tradeoff between quality and performance. FFMPEG is probably the most popular library for this, just check license of h.264 encoding.