I'm trying to get gps coordinates of a video inside the camera roll on ios, I was able to import the video, but I can't seem to find a way to access metadata. I'm fairly certain that video do contain gps coordinates because within Photos app on the iphone you can plot them on a map within "Places" tab.
Any ideas?
I found 2 tools that can do the job:
1. ffmpeg
Linux static build, or Windows static build
ffmpeg -i iphone_video.mov
Example outputs (omit some other meta outputs):
......
com.apple.quicktime.location.ISO6709: +34.0216-128.1216+151.584/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 6s
com.apple.quicktime.software: 11.4.1
com.apple.quicktime.creationdate: 2018-09-22T09:21:33-0700
......
2. ExifTool by Phil Harvey
exiftool -location:all iphone_video.mov
Example outputs:
GPS Coordinates : 34 deg 1' 17.76" N, 128 deg 7' 17.76" W, 151.584 m
Above Sea Level
GPS Altitude : 151.584 m
GPS Altitude Ref : Above Sea Level
GPS Latitude : 33 deg 1' 17.76" N
GPS Longitude : 117 deg 7' 17.76" W
GPS Position : 33 deg 1' 17.76" N, 117 deg 7' 17.76" W
And here's document from Apple: QuickTime file format specification
Related
Does AudioKit provide a method to calculate interpolated values of discrete array members?
Does AudioKit provide a method to smooth transition operation between parameters of an oscillator like baseFrequency, AKOperation.periodicTrigger or hold?
Below the code I use for FM generation:
let oscillator = AKOperation.fmOscillator(baseFrequency: Synth.frequency,
carrierMultiplier: 2,
modulatingMultiplier: 0.8,
modulationIndex: 1,
amplitude: Synth.amplitude.triggeredWithEnvelope(
trigger: AKOperation.periodicTrigger(period: Synth.cyclic),
attack: 0.01,
hold: Synth.hold,
release: 0.01))
For input parameter interpolated values of Frequency Cycle and Duty shall be calculated by interpolation based on the table (array) below:
P1 Freq. Cycle Duty %
-10 200 100 100
-3.04 405 100 100
-0.51 300 500 100
-0.50 200 800 5
0.09 400 600 10
0.10 400 600 50
1.16 550 552 52
2.67 763 483 55
4.24 985 412 58
6.00 1234 322 62
8.00 1517 241 66
10.00 1800 150 70
The transition of values (for Freq., Cycle ans Duty) shall be smoothen based on input parameter P1. Is this what AKComputedParameter e.g. smoothDelay is made for?
How do I tell AudioKit to apply AKComputedParameter?
Do you have a sample code (code snippet) for achievement of interpolation/transition operation with application to oscillator based on the code above? Either based on AK or vDSP methods.
I’m not quiet sure on how to apply https://audiokit.io/docs/Protocols/AKComputedParameter.html
I think this question was downvoted somewhat because it seems like you're asking for too much of an actual implementation with that table of values. I'm going to ignore that and say that however you decide to change the parameters of the oscillator in your app logic, you can make the transitions smooth by portamento'ing the values.
So, in your case for frequency you would replace Synth.frequency with a parameter you set that you would then portamento like AKOperation.parameters[0].portamento(halfTime: 0.5)
See an example for using parameters here: https://audiokit.io/playgrounds/Synthesis/Plucked%20String%20Operation/
As im so new to this field and im trying to explore the data for a time series, and find the missing values and count them and study a distribution of their length and fill in these gaps, the thing is i have, let's say 10 file.txt and for each file i have 2 columns as follows:
C1 C2
944 0
920 1
920 2
928 3
912 7
920 8
920 9
880 10
888 11
920 12
944 13
and so on... lets say till 100 and not necessarily the 10 files have the same number of observations.
so here for example the missing values and not necessarily appears in all files that i have, missing value are: 4,5 and 6 in C2 and the corresponding 1st column C1(measured in milliseconds, so the value of 928ms is not a time neighbor of 912ms). So i want to find those gaps(the total missing values in all 10 files) and show a histogram of their lengths.
i wrote a piece of code in R, but the problem is that i don't get the exact total number that i should have for the missing values.
path = "files path"
out.file<-data.frame(TS = 0, Index = 0, File = '')
file.names <- dir(path, pattern =".txt")
for(i in 1:length(file.names)){
file <- cbind(read.table(file.names[i],
header=F,
sep ="\t",
stringsAsFactors=FALSE),
file.names[i])
colnames(file) <- c('TS', 'Index', 'File')
out.file <- rbind(out.file, file)
}
d = dim(out.file)[1]
misDa = 0
for(i in 2:(d-1)){
if(abs(out.file$Index[i]-out.file$Index[i+1]) > 1)
misDa = misDa+1
}
Hard to give specific hints without having a more extensive example of your data that contains some of the actual NAs.
If you are using R (like it seems) the naniar and the imputeTS packages offer nice functions for missing data visualizations.
Some examples from the naniar package, which is especially good for multivariate data (more plot examples):
Some examples from the imputeTS package, which is especially good for time series data (additional plot examples):
I am trying to compare if there are differences in the number of obtained seeds in five different populations with different applied treatments, and having maternal plant and paternal plant as random effects. First I tried to fit a glmer model.
dat <-dat [,c(12,7,6,13,8,11)]
dat$parents<-factor(paste(dat$mother,dat$father,sep="_"))
compareTreat <- function(d)
{
d$treatment <-factor(d$treatment)
print (tapply(d$pop,list(d$pop,d$treatment),length))
print(summary(fit<-glmer(seed_no~treatment+(1|pop/mother)+
(1|pop/father),data=d,family="poisson")))
}
Then, I compared two treatments in two populations (pop 64 and pop 121, in that case). The other populations do not have this particular treatments, so I get NA values for those.
compareTreat(subset(dat,treatment%in%c("IE 5x","IE 7x")&pop%in%c(64,121)))
This is the output:
IE 5x IE 7x
10 NA NA
45 NA NA
64 31 27
121 33 28
144 NA NA
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: poisson ( log )
Formula: seed_no ~ treatment + (1 | pop/mother) + (1 | pop/father)
Data: d
AIC BIC logLik deviance df.resid
592.5 609.2 -290.2 580.5 113
Scaled residuals:
Min 1Q Median 3Q Max
-1.8950 -0.8038 -0.2178 0.4440 1.7991
Random effects:
Groups Name Variance Std.Dev.
father.pop (Intercept) 3.566e-01 5.971e-01
mother.pop (Intercept) 9.456e-01 9.724e-01
pop (Intercept) 1.083e-10 1.041e-05
pop.1 (Intercept) 1.017e-10 1.008e-05
Number of obs: 119, groups: father:pop, 81; mother:pop, 24; pop, 2
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.74664 0.24916 2.997 0.00273 **
treatmentIE 7x -0.05789 0.17894 -0.324 0.74629
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
tretmntIE7x -0.364
It seems there are no differences between treatments. But as there are many zeros in the data, a zero-inflated model would be worthy to try. I tried with glmmabmd, and I wrote the script like this:
compareTreat<-function(d)
{
d$treatment<-factor(d$treatment)
print(tapply(d$pop,list(d$pop,d$treatment), length))
print(summary(fit_zip<-glmmadmb(seed_no~treatment + (1|pop/mother)+
(1|pop/father),data=d,family="poisson", zeroInflation=TRUE)))
}
Then I compared again the treatments. Here I have not changed the code.
compareTreat(subset(dat,treatment%in%c("IE 5x","IE 7x")&pop%in%c(64,121)))
But in that case, the output is
IE 5x IE 7x
10 NA NA
45 NA NA
64 31 27
121 33 28
144 NA NA
Error in pop:father : NA/NaN argument
In addition: Warning messages:
1: In pop:father :
numerical expression has 119 elements: only the first used
2: In pop:father :
numerical expression has 119 elements: only the first used
3: In eval(parse(text = x), data) : NAs introduced by coercion
Called from: eval(parse(text = x), data)
I tried to change everything I came up with, but I still don't know where the problem is.
If I remove the (1|pop/father) from the glmmadmb script, the model runs, but it feels not correct. I wonder if the mistake is in the loop prior to the glmmadmb but it worked OK in the glmer model, or if it is in the comparison itself after the model. I tried as well to remove NAs with na.omit in case that was an issue, but it did not make a difference. Why does the script stop and does not continue running?
I am a student beginner with RStudio, my version is 3.4.2, called Short Summer. If someone with experience could point me in the right direction I would be very grateful!
H.
I try to extract GPS metadata using exiftool
$ exiftool input.mov (attached)
Which able to display GPS data.
However when try to run with some app (eg:from http://www.registratorviewer.com) the GPS data is not display.
Perhap there is another way. I would like to ask:
if one would know how to extract GPS data (if need) in order to
display location on the map while play that movie
Here the metada:
ExifTool Version Number : 9.85
File Name : input.mov
Directory : .
File Size : 391 MB
File Modification Date/Time : 2015:02:17 21:19:42+07:00
File Access Date/Time : 2015:02:19 17:23:53+07:00
File Inode Change Date/Time : 2015:02:19 17:23:25+07:00
File Permissions : rwxrwxrwx
File Type : MOV
MIME Type : video/quicktime
Major Brand : Apple QuickTime (.MOV/QT)
Minor Version : 0.0.0
Compatible Brands : qt
Movie Data Size : 409646393
Movie Data Offset : 36
Movie Header Version : 0
Create Date : 2015:02:17 14:19:43
Modify Date : 2015:02:17 14:23:00
Time Scale : 600
Duration : 0:03:17
Preferred Rate : 1
Preferred Volume : 100.00%
Preview Time : 0 s
Preview Duration : 0 s
Poster Time : 0 s
Selection Time : 0 s
Selection Duration : 0 s
Current Time : 0 s
Next Track ID : 3
Track Header Version : 0
Track Create Date : 2015:02:17 14:19:43
Track Modify Date : 2015:02:17 14:23:00
Track ID : 1
Track Duration : 0:03:17
Track Layer : 0
Track Volume : 0.00%
Image Width : 1920
Image Height : 1080
Clean Aperture Dimensions : 1920x1080
Production Aperture Dimensions : 1920x1080
Encoded Pixels Dimensions : 1920x1080
Graphics Mode : ditherCopy
Op Color : 32768 32768 32768
Compressor ID : avc1
Source Image Width : 1920
Source Image Height : 1080
X Resolution : 72
Y Resolution : 72
Compressor Name : H.264
Bit Depth : 24
Video Frame Rate : 25.5
Matrix Structure : 1 0 0 0 1 0 0 0 1
Media Header Version : 0
Media Create Date : 2015:02:17 14:19:43
Media Modify Date : 2015:02:17 14:23:00
Media Time Scale : 44100
Media Duration : 0:03:17
Media Language Code : und
Balance : 0
Handler Class : Data Handler
Handler Vendor ID : Apple
Handler Description : Core Media Data Handler
Audio Format : mp4a
Audio Channels : 1
Audio Bits Per Sample : 16
Audio Sample Rate : 44100
Purchase File Format : mp4a
Handler Type : Metadata Tags
Make (tha-TH) : Apple
Creation Date (tha-TH) : 2015:02:17 21:19:43+07:00
GPS Coordinates (tha-TH) : 5 deg 46' 19.20" N, 101 deg 4' 19.92" E, 287 m Above Sea Level
Software (tha-TH) : 8.1.3
Model (tha-TH) : iPhone 5
Make (tha) : Apple
Software Version (tha) : 8.1.3
Content Create Date (tha) : 2015:02:17 21:19:43+07:00
GPS Coordinates (tha) : 5 deg 46' 19.20" N, 101 deg 4' 19.92" E, 287 m Above Sea Level
Model (tha) : iPhone 5
Make : Apple
Creation Date : 2015:02:17 21:19:43+07:00
GPS Coordinates : 5 deg 46' 19.20" N, 101 deg 4' 19.92" E, 287 m Above Sea Level
Software : 8.1.3
Model : iPhone 5
Software Version : 8.1.3
Content Create Date : 2015:02:17 21:19:43+07:00
Avg Bitrate : 16.6 Mbps
GPS Altitude : 287 m
GPS Altitude Ref : Above Sea Level
GPS Latitude : 5 deg 46' 19.20" N
GPS Longitude : 101 deg 4' 19.92" E
GPS Position : 5 deg 46' 19.20" N, 101 deg 4' 19.92" E
Image Size : 1920x1080
Megapixels : 2.1
Rotation : 90
I have image A and image B from same camera.
Points in Image A
PA=[
1 2172 998.9
2 2405 225.2
3 1480 1420
4 1045 1342
5 3039 1789
6 3727 968.7
7 1038 443.1
8 3606 856.6
9 1248 520.1
10 2189 976.8
]
Points in Image B
PB=[
1 2363 1598
2 2551 840.7
3 1768 2045
4 1404 1985
5 3040 2335
6 3636 1485
7 1393 1142
8 3514 1379
9 1550 1199
10 2378 1575]
t=1e-4;
Fundamental matrix
[F, inliers] = ransacfitfundmatrix(x1, x2, t);
F=[ 5.12243654806919e-009 -5.65511649689218e-008 -3.90901140383986e-006
9.48853562184938e-008 4.56036186476569e-008 -0.00133231474573608
-0.000178137312702315 0.00112651242300972 1.10421882784367]
Camera file
focallength =18.6188 mm
format size
width =22.6791 mm
height=15.1130 mm
Image size
5184*3456 pixel
Principle point
x0=11.5399 mm
y0=07.8574 mm
lens distortion (ideal)
K1=0 mm
K2=0 mm
K3=0
P1=0mm
P2=0 mm
Homography
H = vgg_H_from_x_lin(x1,x2)
**Question A= I want to get back PointsB
e.g.,
PointsB(:,1)==H*x1(:,1)
The results are wrong, why, any thing missing
More detail:
x2(:,1)'*F*x1(:,1)= -0.000644154818346676 % I guess its OK.
PointsB(:,1)==H*x1(:,1)= [ 2240.66095080911
1522.92361373263
0.953866074561989] %%%%%% WHY not 1
PB=[ 1 2363 1598]; SHOULD BE
Question B= How can I have 3D points from above informations.
Any link or matlab code would be helpful.
How can I use
vgg_X_from_xP_lin.m 3D point from image projections and cameras,
linear
X = vgg_X_from_xP_lin(u,P,imsize) % what is u
Are the two images taken with the same camera?
Question A: what you are looking for is point correspondences between the two images. One way to find corresponding points is to use local feature matching. There are many algorithms for detecting interest points and finding feature desriptors, such as SIFT, SURF, BRISK, FREAK, etc.
Question B: You can get the 3D points using triangulation. Also see Direct Linear Transformation in Multiple View Geometry in computer vision by Hartley and Zisserman.