Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How I acquire my PC screen video in real time with vision acquisition module to process video?

 

Hello,

I want process text that appears in my screen PC (of another program), and I want to enter this real-time video (PC screen) with the acquisition video module to extract, with OCR, some words. So I only need a solution, with labview or an external software, to adquire PC Screen directly to acquisition video module, or directly to modify my singal video as I want.

 

Thanks and sorry for my english level.   :smileyhappy:

 

 

Toni.

0 Kudos
Message 1 of 7
(4,584 Views)

I think the only way to get that signal at the full frame rate would be to route the signal out of the video card and into a frame grabber.

 

If you can handle a lower frame rate or "whenever I ask for it" timing, I can suggest a solution.

 

Use a keystroke simulator for LabVIEW to send the equivalent of the PrintScreen command.  This will copy the screen into memory.  Next, pull the memory into an IMAQ image.

 

Here is a link to a Community page that shows how to get it into a picture control image.  I suspect you can just convert the Image array into an IMAQ image using array to image.

 

https://decibel.ni.com/content/docs/DOC-19720

 

I had a utility once that did this, but I can't find it right now.  If I locate it, I will post it for you.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 7
(4,575 Views)

Found the utility I was remembering.  It doesn't do exactly what you need, but by combining the two examples you should get what you want.

 

The attached example uses the old IMAQ image display windows.  It will select the window, then uses Alt-PrtScrn to capture just the contents of the selected window.  It uses an IMAQ to copy the clipboard to an image (much easier than I remembered).  The purpose of this utility was to capture an image with all the overlays.  Since this was written, a function to do it automatically has been added to IMAQ.

 

In any case, there are two steps:  Use a keystroke simulator to copy the image to the clipboard, then bring the clipboard image into IMAQ.  You might need to add a short delay between them to allow Windows to copy the current image to the clipboard, or you might get an old image.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 3 of 7
(4,574 Views)
Amazing this is exactly what I want! (Except RGB), but with this solution I can import like video, my pc screen, with continously "print screen" images. 
I understand code but some fail.
When IMAQ Clipboard run fail:
ERROR: -1074396120
DEFINITION: IMAQ ClipboardToImage Not an image.
What happen? I need some adittional labivew module? Because I haven't this module in my vision and motion functions. I need additional software or this error is not for this?
Bruce, thanks thanks a lot. You understood me!
Toni.Smiley Happy
0 Kudos
Message 4 of 7
(4,550 Views)

My example won't work because you are not using IMAQ Window displays.  Since there is no window being displayed, Alt-PrtScrn doesn't capture anything.  You need to change the first step of the sequence to select the display window for your video instead of an IMAQ Window.  I am not 100% sure how to do that.  It is probably another function in User32.dll.

 

For a preliminary test, I would disable the sequence and manually press PrtScrn, then run it without the sequence.  Once you know that works, figure out how to select the window you want.  Add the pieces back one at a time until the whole thing works.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 7
(4,547 Views)

I get It!

 

Well, but is not the right solution because I've to open a .jpeg file (with or without image) and then I overwrite to the clipboard image on the file. So I can adquire this image by three different ways:

Like a "24-bit pixmap" .

Like a "image data".

Like a "picture".

 

If somebody know how I do (one of this three) to image (imaq format) please answer me. I think that this could be the right solution.

 

Thank's Bruce,  Smiley Happy

 

 

Toni.

 

 

0 Kudos
Message 6 of 7
(4,530 Views)

Toni,

 

Are you trying to capture the entire screen, or just the contents of a window?  They require slightly different approaches.  If you let me know, I can probably modify my example to do what you need.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 7
(4,523 Views)