3D SCANNER with multiple Cameras - General Discussion and Assistance - CHDK Forum

3D SCANNER with multiple Cameras

  • 42 Replies
  • 27477 Views
3D SCANNER with multiple Cameras
« on: 04 / May / 2014, 13:25:54 »
Advertisements
Hello everyone,
i was amazed from this post:

http://chdk.setepontos.com/index.php?topic=11263.msg110534#msg110534

and

http://chdk.setepontos.com/index.php?topic=11261.msg110475#msg110475

I am a teacher of technical drawing and I would like to build with my students the same machine.
I've also read this post:
http://chdk.setepontos.com/index.php?topic=10045.0
so now I have some doubts about the feasibility of the project.

I have four A1400 Canon Powershot.
At the moment i am able (using multicam.lua) to shoot via chdkptp four photos at the same time (synchronization is not important).
The big problem for us is to modify multicam.lua to download the photos to pc.

Can anyone give us an help?

Thank you

Francesco


*

Offline reyalp

  • ******
  • 14126
Re: 3D SCANNER with multiple Cameras
« Reply #1 on: 04 / May / 2014, 17:02:09 »
The big problem for us is to modify multicam.lua to download the photos to pc.
This shouldn't be too hard. You can use something like:
Code: [Select]
!mc=require'multicam'
... do your regular multicam shooting
!mc:cmd('exit')
 !for i,lcon in ipairs(mc.cams) do cli:print_status(lcon:mdownload({'A/DCIM'},'/some/path',{fmatch='%.JPG$'})) end
!mc:start()
...
If you want to the CLI mdownload command instead of figuring out the API parameters, you could do it like this
Code: [Select]
!for i,lcon in ipairs(mc.cams) do con=lcon cli:print_status(cli:execute('mdl A/DCIM /some/path -fmatch=%.JPG$')) end
Some day I'd like to integrate shoot and download into multicam, but I haven't got to it yet.
Don't forget what the H stands for.

Re: 3D SCANNER with multiple Cameras
« Reply #2 on: 05 / May / 2014, 16:43:52 »
Hy Reyalp,
thank you for your quick reply.
I tried your code; the first one allows me to download only the photo from one camera; the second allows me to download all the photos (from the four cameras) in a folder on pc ... perfect!
One thing I had not considered is how to delete photos on cameras once downloaded! Is it possible?

thanks

*

Offline reyalp

  • ******
  • 14126
Re: 3D SCANNER with multiple Cameras
« Reply #3 on: 05 / May / 2014, 16:58:09 »
Hy Reyalp,
thank you for your quick reply.
I tried your code; the first one allows me to download only the photo from one camera; the second allows me to download all the photos (from the four cameras) in a folder on pc ... perfect!
There must be a mistake, they both do the same thing, and both worked for me when I tested.
Quote
One thing I had not considered is how to delete photos on cameras once downloaded! Is it possible?
You can use an 'rm' command just like the mdl command in the second example, like cli:execute('rm ...')
Don't forget what the H stands for.

Re: 3D SCANNER with multiple Cameras
« Reply #4 on: 05 / May / 2014, 17:57:25 »
...yes there was a mistake...also the first code allows me to download the photos from both cameras!!

with this code:
Code: [Select]
!for i,lcon in ipairs(mc.cams) do con=lcon cli:print_status(cli:execute('rm A/DCIM ')) end
i can delete all the files from the cameras!!

Quote
Some day I'd like to integrate shoot and download into multicam, but I haven't got to it yet.

do you think that will be an hard work? is it possible to open a job group to do that?... we can be the first testers :D

thank you

*

Offline reyalp

  • ******
  • 14126
Re: 3D SCANNER with multiple Cameras
« Reply #5 on: 05 / May / 2014, 22:29:11 »
i can delete all the files from the cameras!!
Those long ! lines can be cumbersome to work with. If you want to put all your code together in one file, you could put the following in myfile.lua
Code: [Select]
function download_and_delete()
  for i,lcon in ipairs(mc.cams) do
    con=lcon
    cli:print_status(cli:execute('mdl A/DCIM /some/path -fmatch=%.JPG$'))
    cli:print_status(cli:execute('rm A/DCIM '))
  end
end
Then use
!require'myfile'
once after startup and
!download_and_delete()
to download

Quote
Quote
Some day I'd like to integrate shoot and download into multicam, but I haven't got to it yet.

do you think that will be an hard work?
Just doing something like the above shouldn't be too hard.
Quote
is it possible to open a job group to do that?...
I'm not sure what you mean by "job group"?
Don't forget what the H stands for.

Re: 3D SCANNER with multiple Cameras
« Reply #6 on: 06 / May / 2014, 15:32:53 »
....now i understand how to use your last code!!!

Just another question: now i have only four cameras, the sequence to take photo is 1) switch on the cameras (manually); 2) Open CHDK PTP; 3) Click Connect 4) Use the codes;

If i had for example 40 cameras the point 1) become very boring...is there an automatic way to start the cameras?

with "job group" i mean "working group".....but i understand that is not simple!!!!
« Last Edit: 06 / May / 2014, 16:32:23 by indian22 »

*

Offline reyalp

  • ******
  • 14126
Re: 3D SCANNER with multiple Cameras
« Reply #7 on: 06 / May / 2014, 18:10:21 »
If i had for example 40 cameras the point 1) become very boring...is there an automatic way to start the cameras?
To do this, you need to have external power supplies you can control, and have some way to hold the power buttons down on the cameras.  Then when the power supply is turned on, the cameras will start immediately. You should still shut the camera down with software (shut_down() from ptp) and then turn off the power supply.

Alternately, you could rig servos to physically press the power button, or modify it to

You should be able to find some threads about this on the forum.

Beware that that it is possible to damage the physical power switch: http://chdk.setepontos.com/index.php?topic=11434.0

Quote
2) Open CHDK PTP; 3) Click Connect 4) Use the codes;
You only need to click connect if you are working with one camera. If you are using multicam, you can just use the multicam commands.

You may find that the CLI works better than the GUI for this kind of thing. To start chdkptp without the GUI, use chdkptp -i, or a -e option as shown below. You can use -i and -e together to run some commands at startup and then go to interactive mode.

You can also put all your commands in a file, and run them like

chdkptp -e"source myfile.txt"

or put all your code in a lua file, and use something like
chdkptp -e"exec require'myfile.lua'

If you need interactive control, you can still put all your commands in a file and use source or exec (exec is the same as the ! command, but some shells treat ! specially so if you are using it with  -e, exec is safer)


Quote
with "job group" i mean "working group".....but i understand that is not simple!!!!
chdkptp is open source and I welcome code contributions.
Don't forget what the H stands for.

Re: 3D SCANNER with multiple Cameras
« Reply #8 on: 08 / May / 2014, 11:55:47 »
I made with my 3d printer some imitation of DC Coupler DR-DC10. For the way to hold on the cameras, i think that i think i'll do manually to avoid to damage something.

Tomorrow i will try some of your commands.

Thank you

Re: 3D SCANNER with multiple Cameras
« Reply #9 on: 08 / May / 2014, 19:09:41 »
On this webpage http://www.artanim.ch/blog/2014/02/building-your-own-3d-scanner/ a poster says "My current workflow is to use the ptpcam tool to first set the camera’s internal clocks using memory register d034 "

Anyone know what he is referring to and where it originates from ?


 

Related Topics


SimplePortal © 2008-2014, SimplePortal