AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
05/04/2024 - 06:12 PM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
Panorama
By: MichaelAn
Rank: Forum Addict
Topics: 56
From: Denmark
Added: 01/19/2007 - 03:46 PM

Hey

I've made a panorama image with my webcam, i moved it out to the left, and took one picture, moved it a little to the right, and took a picture again. And finally Adobe Photoshop Elements 5.0 made them to one big picture.

All i'm missing is at feature that takes a picture, moves the camera, take one more and so on. Smile!

Here is my result: http://blod.lir.dk/gallery/Blandet/panorama.jpg
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 01/20/2007 - 06:33 AM

Looks good! Now what is that diagram that is on the door? Smile

I've thought about "automated" panorama pictures too, and I think the difficulty is in joining them into one picture. Even in your picture, made with Photoshop controlled by Human Eyes and Brain, I can still kind of see where the individual pictures are joined. Writing software to do as good a job would be tricky. Frin
By: MichaelAn
Rank: Forum Addict
Topics: 56
From: Denmark
Added: 01/20/2007 - 02:02 PM

What i mean is just a function that grabs the images, and stores dem in a folder.

then Adobe Photoshop Elements 5.0 can be used to join them into one big picture.

The errors in my panorama image is also my fault, it was my first try, and i tryed some different settings.
By: sse
Rank: Forum Addict
Topics: 73
From: n/a
Added: 01/20/2007 - 03:30 PM

You can achieve that using some scripting, either with PHP or with a batch script, where you use wget to control position and capture the images.

wget for Windows
By: MichaelAn
Rank: Forum Addict
Topics: 56
From: Denmark
Added: 01/20/2007 - 10:39 PM

From sse:
You can achieve that using some scripting, either with PHP or with a batch script, where you use wget to control position and capture the images.

wget for Windows

Okay, got the program... Seems too advanced for me.. Undecided
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 01/25/2007 - 05:47 AM

Maybe this will be easier to use. It's a Perl script I just wrote, and it captures pix automatically from LogiSphere to make a panorama. It just moves the camera, saves a jpeg image, moves again, etc. So you will of course still have to join the pix in Photoshop.

Since it's a Perl script you obviously will need to have a Perl interpreter installed on your system. If you don't already have one, get a good free one here: LINK

Now copy the code below and paste it into Notepad. Save it as panorama.pl in some "easy" directory like c:\temp.

Now open up a command prompt (DOS box) and go to the directory you just saved panorama.pl in. If Perl was installed correctly, you should be able to just type panorama.pl at the dos prompt and it will run. If it doesn't run, try
c:\perl\bin\perl.exe panorama.pl instead.

Captured image files will be saved in the same directory you're running panorama.pl in.

I'll try to check back here a bit later in case you have problems with this script. It should just work though... it's pretty basic stuff.


######### Set these CONSTANTS to suit your system & needs #########

my $STEPS = 4;             # Number of pictures in panorama.
my $CAM =   0;             # Which camera to use (usually zero).
my $TILT =  0;             # Tilt position to use.
my $LSHOST = "localhost";  # Hostname where LogiSphere is running.
my $LSPORT = "8080";       # Port LogiSphere is running on.

###################################################################

use IO::Socket;
$EOL = "\015\012";
$BLANK = $EOL x 2;

# PAN START POSITION AND STEP SIZE.
$pan = -100;
$panstep = 200/($STEPS-1);

# MAKE UNIQUE FILENAMES FOR OUTPUT JPEGS.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
   localtime(time);
$basename =
   sprintf("%04d%02d%02d%02d%02d%02d-",
   $year+1900,$mon+1,$mday,$hour,$min,$sec);
chomp ($ourpath = qx/cd/);

# MAKE HTTP REQUEST THAT TRIGGERS IMAGE CAPTURES.
$grab = sprintf("GET /current%d.jpg HTTP/1.1%s",$CAM,$EOL);
$grab .= "Accept: text/html, image/jpeg$BLANK";

# THE MAIN LOOP - ONE ITERATION PER CAPTURE.
for ($i=1;$i<=$STEPS;$i++) {
   $file = $basename.$i.".jpg";

   # MOVE CAMERA TO POSITION.
   $move =
      sprintf("GET /pos%d-%d,%d HTTP/1.1%s",$CAM,$pan,$TILT,$BLANK);
   printf ("Move Cam %1d To: %d,%d\n",$CAM,$pan,$TILT);
   $logi = hookup($LSHOST,$LSPORT);
   print $logi "$move";
   while (<$logi>) {        # Just ignore reply from LogiSphere 
      if ($_ =~ /404/) {    # unless somthing bad happened.
         die "LogiSphere did not accept position command."
      }
   }
   sleep(5); # Allow time for it to really move.

   # REQUEST AN IMAGE CAPTURE.
   $logi = hookup($LSHOST,$LSPORT);
   print $logi "$grab";
   while (<$logi>) {        # Just ignore Headers from LogiSphere 
      if ($_ =~ /404/) {    # unless somthing bad happened.
         die "LogiSphere did not deliver image."
      }
      last if /^\r/
   }

   # WRITE IMAGE TO OUPUT JPEG FILE.
   open(FH, "> $file") || die "Can't create $file.";
   binmode(FH);
   while (<$logi>) {print FH}
   close(FH);
   print "Captured File: $ourpath\\$file\n";

   # CALC NEXT CAMERA POSITION.
   $pan += $panstep;
}

#### SUBROUTINE TO MAKE CONNECTIONS TO LOGISPHERE. ####
sub hookup($$) {
   my($host,$port)=@_;
   $conn = IO::Socket::INET->new(
              Proto    => "tcp",
              PeerAddr => $host,
              PeerPort => $port,
           )
   or die "cannot connect to the LogiSphere server";
   return $conn
}

1

By: MichaelAn
Rank: Forum Addict
Topics: 56
From: Denmark
Added: 01/25/2007 - 10:06 AM

Hmm, a little problem...

It takes some of the pictures while moving.

And sometimes 2 without moving.
By: MichaelAn
Rank: Forum Addict
Topics: 56
From: Denmark
Added: 01/25/2007 - 08:57 PM

Think it works now, i just set the waiting time up.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 01/25/2007 - 11:22 PM

Okay, good... you found the waiting time before I got back here to check messages. That time setting was okay for my camera, but I guess I should make it a setting at the top of the program since different cameras move at different speeds.
By: MichaelAn
Rank: Forum Addict
Topics: 56
From: Denmark
Added: 01/26/2007 - 01:01 PM

Like this. Smile!

panorama.pl
######### Set these CONSTANTS to suit your system & needs #########

my $STEPS = 6;             # Number of pictures in panorama.
my $SLEEP = 10;            # Allow time for it to really move.
my $CAM =   0;             # Which camera to use (usually zero).
my $TILT =  0;             # Tilt position to use.
my $LSHOST = "localhost";  # Hostname where LogiSphere is running.
my $LSPORT = "8080";       # Port LogiSphere is running on.

###################################################################

use IO::Socket;
$EOL = "\015\012";
$BLANK = $EOL x 2;

# PAN START POSITION AND STEP SIZE.
$pan = -100;
$panstep = 200/($STEPS-1);

# MAKE UNIQUE FILENAMES FOR OUTPUT JPEGS.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
   localtime(time);
$basename =
   sprintf("%04d%02d%02d%02d%02d%02d-",
   $year+1900,$mon+1,$mday,$hour,$min,$sec);
chomp ($ourpath = qx/cd/);

# MAKE HTTP REQUEST THAT TRIGGERS IMAGE CAPTURES.
$grab = sprintf("GET /current%d.jpg HTTP/1.1%s",$CAM,$EOL);
$grab .= "Accept: text/html, image/jpeg$BLANK";

# THE MAIN LOOP - ONE ITERATION PER CAPTURE.
for ($i=1;$i<=$STEPS;$i++) {
   $file = $basename.$i.".jpg";

   # MOVE CAMERA TO POSITION.
   $move =
      sprintf("GET /pos%d-%d,%d HTTP/1.1%s",$CAM,$pan,$TILT,$BLANK);
   printf ("Move Cam %1d To: %d,%d\n",$CAM,$pan,$TILT);
   $logi = hookup($LSHOST,$LSPORT);
   print $logi "$move";
   while (<$logi>) {        # Just ignore reply from LogiSphere 
      if ($_ =~ /404/) {    # unless somthing bad happened.
         die "LogiSphere did not accept position command."
      }
   }
   sleep($SLEEP); # Allow time for it to really move.

   # REQUEST AN IMAGE CAPTURE.
   $logi = hookup($LSHOST,$LSPORT);
   print $logi "$grab";
   while (<$logi>) {        # Just ignore Headers from LogiSphere 
      if ($_ =~ /404/) {    # unless somthing bad happened.
         die "LogiSphere did not deliver image."
      }
      last if /^\r/
   }

   # WRITE IMAGE TO OUPUT JPEG FILE.
   open(FH, "> $file") || die "Can't create $file.";
   binmode(FH);
   while (<$logi>) {print FH}
   close(FH);
   print "Captured File: $ourpath\\$file\n";

   # CALC NEXT CAMERA POSITION.
   $pan += $panstep;
}

#### SUBROUTINE TO MAKE CONNECTIONS TO LOGISPHERE. ####
sub hookup($$) {
   my($host,$port)=@_;
   $conn = IO::Socket::INET->new(
              Proto    => "tcp",
              PeerAddr => $host,
              PeerPort => $port,
           )
   or die "cannot connect to the LogiSphere server";
   return $conn
}

1
And in the same folder i made panorama.bat
perl.exe panorama.pl


Smile!