PDA

View Full Version : You guys are VERY sneaky...



Kerryp24
January 7th, 2006, 11:22 AM
I was just setting up 4.0.1 at home and when it installed it had a Demo.GML file showing up.

And WHAT do I see, but...

An action item in the script caller... IM

Mike you are soooooo sneaky.
When did you setup IM to work with G4???

I remember our thread from about a month ago when I asked about doing some form of TWAIN capturing of snapshots and you mentioned that they were working to make IM, LUA 5 compatible.

I just saw that they had released a version that would work and I was going to attempt to play with it.

Guess you beat me to it. :D

I'll have to setup my stuff now and play with it.

Any hints or advice you wish to impart?

Thanks

Kerry

Kerryp24
January 7th, 2006, 11:35 AM
Ok, I thought I was ready to rock and roll, but....

The script in the demo.gml has two "require" statments:
require("imlua5", "imlua_open")
require("imlua_capture", imlua_open_capture")

When I try to just run the script, I get an error because the script files cannot be found.

Mike, can you tell me where they are or where to get them from?

Thanks

Kerry

Promixis
January 7th, 2006, 11:39 AM
this is still a work in progress and has only undergone limited testing....

here is a zip that goes in the girder dir.

use at own risk :o

Kerryp24
January 7th, 2006, 12:04 PM
Thanks Mike.

Hey what fun is it, if you aren't on the... bleeding... edge. :P

So, I need to extract these files into the Girder directory?
Not the Plugins or Luascript?

Promixis
January 7th, 2006, 12:05 PM
Thanks Mike.

Hey what fun is it, if you aren't on the... bleeding... edge. :P

So, I need to extract these files into the Girder directory?
Not the Plugins or Luascript?

Yes, main dir.

We will likely roll this into an add-on plugin with a GUI for various functions.

Kerryp24
January 7th, 2006, 12:46 PM
Mike

Ok, the good news is...

I got it to work and I modified the action script to save the file with a date/time nameing convetion so I can create multiple snapshots.

Bad news is that while everything, seems, to be working...
all the snapshots come out, BLACK.

No image is viewable.

Any ideas?

Promixis
January 7th, 2006, 02:29 PM
yes, there is a line missing in the demo..

I can't find it here right now :x

but its a lua line that is in the imtools lua example. something about making the im ready for capture.

Promixis
January 7th, 2006, 02:30 PM
what,

I think this code block has it.



for i =0,x-1 do

print( im.VideoCaptureDeviceDesc(i))

dev = im.VideoCaptureCreate(i)
if not dev then
print('error video create')
return
end



print(dev:Connect(0))
x,y = dev:GetImageSize()

img = im.ImageCreate(x,y, im.RGB, im.BYTE)
dev:Live (1)
iosd = osd.Classes.Image:New ()
iosd:Initialize ()
for t= 1,500 do
print('size:',x,y)
--win.Sleep(1000)
data = dev:Frame( img, im.RGB)
print(data,img)
im.FileImageSave(img, 'c:\\test.bmp','BMP');
iosd:Update ('c:\\test.bmp')
end
-- dev:Destroy()


end

Kerryp24
January 8th, 2006, 08:29 AM
Oh yeah....

worked like a champ.

Very cool.

What I did was setup an action for when my X10 PIR triggers on an event.
If the previous state was OFF, I then trigger the action to take a picture from my Web Cam.

I'm going to add the capability to take a, series, of snapshots.
Also, I believe that IM has the capability to take a video stream which might work out even better.

Thanks for the help.