Na okoliczność wielu zdjęć z jednego miejsca można dodać losowy szum (jitter). Czy to ma sens to już inna sprawa. Ja dodałem jitter (kołowy) do zdjęć zrobionych w fabryce jedwabiu w Margilan
#!/usr/bin/perl ### Add jitter to Geocoordinates use Math::Complex; use Math::Trig; use Getopt::Long; use Image::ExifTool; use Geo::Distance; ## my $sd =.002; ### max about 200m print STDERR "USAGE $0 [-d] DIAMETER -c COORDINATES -f FILE (DIAMETER=0.002 is circa 200m!)\n"; GetOptions("d=i" => \$sd, "c=s" => \$coords, "f=s" => \$file ); my $factor = 0.00001; my $init_shift = 0.00001; my $pi = 4*atan2(1,1); ##$sd = sqrt($factor * $Skad{$skad}); my $r = $sd * sqrt(rand()); my $theta = rand() * 2 * $pi; ($lat, $lon) = split (/[:;,]/, $coords); $rand_lat = $lat + $r * cos($theta); $rand_lon = $lon + $r * sin($theta); my $eT = new Image::ExifTool; $eT->SetNewValue(GPSLatitudeRef => ($rand_lat > 0)?'N':'S', Group=>'GPS'); $eT->SetNewValue(GPSLongitudeRef => ($rand_lon > 0)?'E':"W", Group=>'GPS'); $eT->SetNewValue(GPSLatitude => abs($rand_lat), Group=>'GPS'); $eT->SetNewValue(GPSLongitude => abs($rand_lon), Group=>'GPS'); my $old_comment = $eT->GetValue('UserComment', 'ValueConv'); if ($old_comment) { $exif_comment = "$old_comment | GPS coordinates jigged"; } else { $exif_comment = "GPS coordinates jigged"; } $eT->SetNewValue(UserComment => "$exif_comment"); if (-f $file) { $file_org = "${file}_orig"; if ( system("cp", "$file", "$file_org") == 0 ) { $eT->WriteInfo("$file"); print STDERR "$file updated\n"; } else { print STDERR "*** $file update failed\n"; } } else { print STDERR "*** ERROR with $file\n"; } my $geo = new Geo::Distance; $dist = $geo->distance( "meter", $lon, $lat => $rand_lon, $rand_lat ); print STDERR "Laat/Lon: $lat, $lon => $rand_lat, $rand_lon (Dist: $dist)\n";
Przykładowa mapa jest tutaj
Brak komentarzy:
Prześlij komentarz