Revision 8526ae8c
| R/Bestimmung_Umformungen_Rotm/Bestimmung_Drehrichtungen.r | ||
|---|---|---|
| 1 |
#!/usr/bin/env Rscript |
|
| 2 |
|
|
| 3 |
#Argumente einlesen |
|
| 4 |
args <- commandArgs(TRUE) |
|
| 5 |
if(length(args) == 2){
|
|
| 6 |
cat("dateiname=\"",args[1],"\"\n",sep="")
|
|
| 7 |
dateiname <- args[1] |
|
| 8 |
cat("vergleichsdatei=\"",args[2],"\"\n",sep="")
|
|
| 9 |
vergleichsdatei <- args[2] |
|
| 10 |
}else |
|
| 11 |
{
|
|
| 12 |
cat("Fehler: Bitte zwei Dateinamen angeben!","\n")
|
|
| 13 |
quit() |
|
| 14 |
} |
|
| 15 |
|
|
| 16 |
#Einlesen |
|
| 17 |
cat("Lese ","/home/jonas/Bachelorarbeit/bart2/",dateiname,"\n",sep="")
|
|
| 18 |
bart <- read.csv(file=paste("/home/jonas/Bachelorarbeit/bart2/",dateiname,sep=""),header=F)
|
|
| 19 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/alvar/2.0.0/alvar-2.0.0-sdk-linux64-gcc44/build/build_gcc44_release/sample/",dateiname,"\n",sep="")
|
|
| 20 |
alvar <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/alvar/2.0.0/alvar-2.0.0-sdk-linux64-gcc44/build/build_gcc44_release/sample/",dateiname,sep=""),header=F)
|
|
| 21 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,"\n",sep="")
|
|
| 22 |
aruco <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,sep=""),header=F)
|
|
| 23 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,"\n",sep="")
|
|
| 24 |
aruco <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,sep=""),header=F)
|
|
| 25 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/blender-files/Positions/",vergleichsdatei, "\n",sep="")
|
|
| 26 |
blender <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/blender-files/Positions/",vergleichsdatei, sep=""),header=F)
|
|
| 27 |
#Doppelte Zeilen mit identischen Daten entfernen |
|
| 28 |
bart <- unique(bart) |
|
| 29 |
alvar <- unique(alvar) |
|
| 30 |
aruco <- unique(aruco) |
|
| 31 |
|
|
| 32 |
#Ermittelt die aktuell von fit.r benutzte Rotationsmatrix und gibt sie aus |
|
| 33 |
printRotm <- function(liste,pfadInvMat){
|
|
| 34 |
init_mat_table <- read.table(file=pfadInvMat) |
|
| 35 |
init_rotm_inv <- matrix(unlist(init_mat_table), ncol=3, nrow=3, byrow=TRUE) |
|
| 36 |
matA <- matrix(unlist(liste[3,3:11]),ncol=3,byrow=TRUE) |
|
| 37 |
matB <- matA %*% init_rotm_inv |
|
| 38 |
print(matB) |
|
| 39 |
matA <- matrix(unlist(liste[103,3:11]),ncol=3,byrow=TRUE) |
|
| 40 |
matB <- matA %*% init_rotm_inv |
|
| 41 |
print(matB) |
|
| 42 |
} |
|
| 43 |
|
|
| 44 |
cat("BART","\n")
|
|
| 45 |
printRotm(bart,"bart_init_rotm_inv.table") |
|
| 46 |
cat("ALVAR","\n")
|
|
| 47 |
printRotm(alvar,"alvar_init_rotm_inv.table") |
|
| 48 |
#Zeilen vertauschen |
|
| 49 |
aruco[3,3:8] <- aruco[3,c(6:8,3:5)] |
|
| 50 |
aruco[103,3:8] <- aruco[103,c(6:8,3:5)] |
|
| 51 |
cat("ARUCO","\n")
|
|
| 52 |
printRotm(aruco,"aruco_init_rotm_inv.table") |
|
| 53 |
cat("BLENDER","\n")
|
|
| 54 |
printRotm(aruco,"blender_init_rotm_inv.table") |
|
| 55 |
|
|
| R/Bestimmung_Umformungen_Rotm/Bestimmung_Drehrichtungen.r~ | ||
|---|---|---|
| 1 |
#!/usr/bin/env Rscript |
|
| 2 |
|
|
| 3 |
#Argumente einlesen |
|
| 4 |
args <- commandArgs(TRUE) |
|
| 5 |
if(length(args) == 2){
|
|
| 6 |
cat("dateiname=\"",args[1],"\"\n",sep="")
|
|
| 7 |
dateiname <- args[1] |
|
| 8 |
cat("vergleichsdatei=\"",args[2],"\"\n",sep="")
|
|
| 9 |
vergleichsdatei <- args[2] |
|
| 10 |
}else |
|
| 11 |
{
|
|
| 12 |
cat("Fehler: Bitte zwei Dateinamen angeben!","\n")
|
|
| 13 |
quit() |
|
| 14 |
} |
|
| 15 |
|
|
| 16 |
#Einlesen |
|
| 17 |
cat("Lese ","/home/jonas/Bachelorarbeit/bart2/",dateiname,"\n",sep="")
|
|
| 18 |
bart <- read.csv(file=paste("/home/jonas/Bachelorarbeit/bart2/",dateiname,sep=""),header=F)
|
|
| 19 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/alvar/2.0.0/alvar-2.0.0-sdk-linux64-gcc44/build/build_gcc44_release/sample/",dateiname,"\n",sep="")
|
|
| 20 |
alvar <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/alvar/2.0.0/alvar-2.0.0-sdk-linux64-gcc44/build/build_gcc44_release/sample/",dateiname,sep=""),header=F)
|
|
| 21 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,"\n",sep="")
|
|
| 22 |
aruco <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,sep=""),header=F)
|
|
| 23 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,"\n",sep="")
|
|
| 24 |
aruco <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/",dateiname,sep=""),header=F)
|
|
| 25 |
cat("Lese ","/home/jonas/Dokumente/Studium/Bachelorarbeit/blender-files/Positions/",vergleichsdatei, sep="")
|
|
| 26 |
blender <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/blender-files/Positions/",vergleichsdatei, sep=""),header=F)
|
|
| 27 |
#Doppelte Zeilen mit identischen Daten entfernen |
|
| 28 |
bart <- unique(bart) |
|
| 29 |
alvar <- unique(alvar) |
|
| 30 |
aruco <- unique(aruco) |
|
| 31 |
|
|
| 32 |
#Ermittelt die aktuell von fit.r benutzte Rotationsmatrix und gibt sie aus |
|
| 33 |
printRotm <- function(liste,pfadInvMat){
|
|
| 34 |
init_mat_table <- read.table(file=pfadInvMat) |
|
| 35 |
init_rotm_inv <- matrix(unlist(init_mat_table), ncol=3, nrow=3, byrow=TRUE) |
|
| 36 |
matA <- matrix(unlist(liste[3,3:11]),ncol=3,byrow=TRUE) |
|
| 37 |
matB <- matA %*% init_rotm_inv |
|
| 38 |
print(matB) |
|
| 39 |
matA <- matrix(unlist(liste[103,3:11]),ncol=3,byrow=TRUE) |
|
| 40 |
matB <- matA %*% init_rotm_inv |
|
| 41 |
print(matB) |
|
| 42 |
} |
|
| 43 |
|
|
| 44 |
cat("BART","\n")
|
|
| 45 |
printRotm(bart,"bart_init_rotm_inv.table") |
|
| 46 |
cat("ALVAR","\n")
|
|
| 47 |
printRotm(alvar,"alvar_init_rotm_inv.table") |
|
| 48 |
#Zeilen vertauschen |
|
| 49 |
aruco[3,3:8] <- aruco[3,c(6:8,3:5)] |
|
| 50 |
aruco[103,3:8] <- aruco[103,c(6:8,3:5)] |
|
| 51 |
cat("ARUCO","\n")
|
|
| 52 |
printRotm(aruco,"aruco_init_rotm_inv.table") |
|
| 53 |
cat("BLENDER","\n")
|
|
| 54 |
printRotm(aruco,"blender_init_rotm_inv.table") |
|
| 55 |
|
|
| R/Bestimmung_Umformungen_Rotm/alvar_init_rotm_inv.table | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -1 0 0 |
|
| 3 |
"2" 0 -1 0 |
|
| 4 |
"3" 0 0 1 |
|
| R/Bestimmung_Umformungen_Rotm/alvar_init_rotm_inv.table~ | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -1 -6.41318e-05 -0.000671618 |
|
| 3 |
"2" 6.41307e-05 -1 1.68697e-06 |
|
| 4 |
"3" -0.000671619 1.6439e-06 1 |
|
| R/Bestimmung_Umformungen_Rotm/aruco_init_rotm_inv.table | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -1 0 0 |
|
| 3 |
"2" 0 1 0 |
|
| 4 |
"3" 0 0 -1 |
|
| R/Bestimmung_Umformungen_Rotm/aruco_init_rotm_inv.table~ | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -1 2.11015e-05 -3.47431e-07 |
|
| 3 |
"2" 2.11013e-05 1 0.000720771 |
|
| 4 |
"3" 3.62641e-07 0.000720771 -1 |
|
| R/Bestimmung_Umformungen_Rotm/bart_init_rotm_inv.table | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -1 0 0 |
|
| 3 |
"2" 0 1 0 |
|
| 4 |
"3" 0 0 -1 |
|
| R/Bestimmung_Umformungen_Rotm/bart_init_rotm_inv.table~ | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -0.999989 5.06776e-05 -0.00460636 |
|
| 3 |
"2" 5.1958e-05 1 -0.000277859 |
|
| 4 |
"3" 0.00460634 -0.000278095 -0.999989 |
|
| R/Bestimmung_Umformungen_Rotm/blender_init_rotm_inv.table | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" -1 0 0 |
|
| 3 |
"2" 0 1 0 |
|
| 4 |
"3" 0 0 -1 |
|
| R/Bestimmung_Umformungen_Rotm/blender_init_rotm_inv.table~ | ||
|---|---|---|
| 1 |
"V1" "V2" "V3" |
|
| 2 |
"1" 1 0 0 |
|
| 3 |
"2" 0 1 0 |
|
| 4 |
"3" 0 0 1 |
|
| R/README.txt | ||
|---|---|---|
| 1 |
benchmark.r: Enthält den Benchmark |
|
| 2 |
|
|
| 3 |
rotm.r: Erzeugt Plotts von Rotationsungenauigkeiten |
|
| 4 |
transl.r: Erzeugt Plotts von Translationsungenauigkeiten |
|
| 5 |
hinstogramm_markernummern.r: Erzeugt ein Histogramm der Erkennungen über den Markernummern |
|
| 6 |
|
|
| 7 |
|
|
| 8 |
main2.r: Wandelt Rotationsungenauigkeiten in Eulerwinkel um |
|
| 9 |
- fit.r: Wandelt dafür eine einzelne Rotationsmatrix um |
|
| 10 |
|
|
| 11 |
share: Enthält ein gemeinsam genutztes Skript zum Laden der Dateien |
|
| 12 |
Bestimmung_Umformung_Rotm: Enthält die Anpassungsmatritzen für die Roatationsmatritzen der Bibliotheken. |
|
| R/README.txt~ | ||
|---|---|---|
| 1 |
benchmark.r: Enthält den Benchmark |
|
| 2 |
|
|
| 3 |
rotm.r: Erzeugt Plotts von Rotationsungenauigkeiten |
|
| 4 |
transl.r: Erzeugt Plotts von Translationsungenauigkeiten |
|
| 5 |
hinstogramm_markernummern.r: Erzeugt ein Histogramm der Erkennungen über den Markernummern |
|
| 6 |
|
|
| 7 |
|
|
| 8 |
main2.r: Wandelt Rotationsungenauigkeiten in Eulerwinkel um |
|
| 9 |
- fit.r: Wandelt dafür eine einzelne Rotationsmatrix um |
|
| 10 |
|
|
| 11 |
share: Enthält ein gemeinsam genutztes Skript zum Laden der Dateien |
|
| 12 |
Bestimmung_Umformung_Rotm: Enthält die Anpassungsmatritzen für die Roatationsmatritzen der Bibliotheken. |
|
| R/benchmark.r | ||
|---|---|---|
| 1 |
#Hilfsfunktionen |
|
| 2 |
|
|
| 3 |
filter <- function(selektor,wert){
|
|
| 4 |
if(selektor){
|
|
| 5 |
return(wert) |
|
| 6 |
}else{
|
|
| 7 |
return(0) |
|
| 8 |
} |
|
| 9 |
} |
|
| 10 |
|
|
| 11 |
zusammenfassen <- function(selektoren,werte){
|
|
| 12 |
#Punkte der Bibliothek für diese Phase nach Testen |
|
| 13 |
phase <- mapply(filter,selektoren,werte) |
|
| 14 |
#Summe zurückgeben |
|
| 15 |
return(sum(phase)) |
|
| 16 |
} |
|
| 17 |
|
|
| 18 |
zusammenfassenFuerAllePhasen <- function(werte,selektoren){
|
|
| 19 |
ret <- lapply(selektoren,zusammenfassen,werte) |
|
| 20 |
return(t(ret)) |
|
| 21 |
} |
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
#Liest die Logdatei zu dem übergebenen Basisnamen ein |
|
| 26 |
leseBart <- function(basisname){
|
|
| 27 |
bart <- read.csv(file=paste("/home/jonas/Bachelorarbeit/bart2/stat/",basisname,"_log.txt",sep=""),header=F)
|
|
| 28 |
return(bart) |
|
| 29 |
} |
|
| 30 |
leseAlvar <- function(basisname){
|
|
| 31 |
alvar <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/alvar/2.0.0/alvar-2.0.0-sdk-linux64-gcc44/build/build_gcc44_release/sample/stat/",basisname,"_log.txt",sep=""),header=F)
|
|
| 32 |
return(alvar) |
|
| 33 |
} |
|
| 34 |
leseAruco <- function(basisname){
|
|
| 35 |
aruco <- read.csv(file=paste("/home/jonas/Dokumente/Studium/Bachelorarbeit/aruco/aruco-1.2.5/stat/",basisname,"_log.txt",sep=""),header=F)
|
|
| 36 |
return(aruco) |
|
| 37 |
} |
|
| 38 |
|
|
| 39 |
#Funktionen für das Parsen |
|
| 40 |
|
|
| 41 |
parse <- function(text){
|
|
| 42 |
|
|
| 43 |
# Extrahiere Zahl (mit Prozentzeichen um die Markerzahlen auszuschließen |
|
| 44 |
position <- regexpr("[[:digit:]|[:punct:]]{1,}[[:blank:]]%",text,perl=TRUE)
|
|
| 45 |
zahl <- regmatches(text,position) |
|
| 46 |
# Entferne Prozentzeichen |
|
| 47 |
position <- regexpr("[[:digit:]|[:punct:]]{1,}",zahl,perl=TRUE)
|
|
| 48 |
zahl <- regmatches(zahl,position) |
|
| 49 |
|
|
| 50 |
if(length(zahl) == 0){
|
|
| 51 |
return("-")
|
|
| 52 |
} |
|
| 53 |
|
|
| 54 |
#Ausgabeformat (in das Latex-Dokument): Zahl mit genau einer Nachkommastelle |
|
| 55 |
zahl <- as.numeric(zahl) |
|
| 56 |
|
|
| 57 |
return(zahl) |
|
| 58 |
} |
|
| 59 |
|
|
| 60 |
# gewichtungsZeile: Eine Liste, die an den Positionen 1 bis 8 den Wahrheitswert enthält, ob die Prozentzahl berücksichtigt wird und an der Position 9 die Gruppengröße angibt. |
|
| 61 |
# benchmarkErgebnisse: Eine Liste, die für alle Auflösungen eine Liste mit den aktuellen Punkten für alle Phasen enthält. |
|
| 62 |
parseZeile <- function(stringTabelle,basisname,bezeichnung,gewichtungsZeile){
|
|
| 63 |
|
|
| 64 |
#print("Parse Zeile:")
|
|
| 65 |
#print(stringTabelle) |
|
| 66 |
#print(basisname) |
|
| 67 |
#print(bezeichnung) |
|
| 68 |
#print(gewichtungsZeile) |
|
| 69 |
|
|
| 70 |
# Parsen |
|
| 71 |
stringTabelle <- within(stringTabelle,zahlen <- parse(V1)) |
|
| 72 |
|
|
| 73 |
# Berechne Gewichtungsfaktor (aus den Normierungen) |
|
| 74 |
gewichtungsZeile[1:8] <- unlist(as.logical(gewichtungsZeile[1:8])) |
|
| 75 |
divisor <- length(Filter(function(x) x,gewichtungsZeile[1:8])) # Anzahl der TRUE |
|
| 76 |
divisor <- divisor*as.numeric(gewichtungsZeile[9]) |
|
| 77 |
|
|
| 78 |
# Teile Werte durch Divisor um die Punkte zu erhalten, die in die Kategorien eingehen |
|
| 79 |
if(divisor > 0){
|
|
| 80 |
punkte <- sapply(stringTabelle$zahlen,function(x){x/divisor})
|
|
| 81 |
}else{
|
|
| 82 |
# divisor = 0 bedeutet, dass die Punkte in keine Phase eingehen |
|
| 83 |
punkte <- c(0,0,0,0,0,0,0,0,0) |
|
| 84 |
} |
|
| 85 |
return(punkte[1:9]) |
|
| 86 |
} |
|
| 87 |
|
|
| 88 |
leseUndParseBa <- function(zeile){
|
|
| 89 |
# Eingaben umwandeln |
|
| 90 |
basisname <- as.character(unlist(zeile[1])) |
|
| 91 |
bezeichnung <- as.character(unlist(zeile[2])) |
|
| 92 |
gewichtungsZeile <- zeile[3:11] |
|
| 93 |
|
|
| 94 |
cat("### BART: Lese und verarbeite",bezeichnung,"###\n")
|
|
| 95 |
# Einlesen |
|
| 96 |
stringTabelle <- leseBart(basisname) |
|
| 97 |
# Parsen |
|
| 98 |
ret <- parseZeile(stringTabelle, basisname, bezeichnung,gewichtungsZeile) |
|
| 99 |
return(ret) |
|
| 100 |
} |
|
| 101 |
|
|
| 102 |
leseUndParseAl <- function(zeile){
|
|
| 103 |
# Eingaben umwandeln |
|
| 104 |
basisname <- as.character(unlist(zeile[1])) |
|
| 105 |
bezeichnung <- as.character(unlist(zeile[2])) |
|
| 106 |
gewichtungsZeile <- zeile[3:11] |
|
| 107 |
|
|
| 108 |
cat("### ALVAR: Lese und verarbeite",bezeichnung,"###\n")
|
|
| 109 |
# Einlesen |
|
| 110 |
stringTabelle <- leseAlvar(basisname) |
|
| 111 |
# Parsen |
|
| 112 |
ret <- parseZeile(stringTabelle, basisname, bezeichnung,gewichtungsZeile) |
|
| 113 |
|
|
| 114 |
return(ret) |
|
| 115 |
} |
|
| 116 |
|
|
| 117 |
leseUndParseAr <- function(zeile){
|
|
| 118 |
# Eingaben umwandeln |
|
| 119 |
basisname <- as.character(unlist(zeile[1])) |
|
| 120 |
bezeichnung <- as.character(unlist(zeile[2])) |
|
| 121 |
gewichtungsZeile <- zeile[3:11] |
|
| 122 |
|
|
| 123 |
cat("### ARUCO: Lese und verarbeite",bezeichnung,"###\n")
|
|
| 124 |
# Einlesen |
|
| 125 |
stringTabelle <- leseAruco(basisname) |
|
| 126 |
# Parsen |
|
| 127 |
ret <- parseZeile(stringTabelle, basisname, bezeichnung,gewichtungsZeile) |
|
| 128 |
|
|
| 129 |
return(ret) |
|
| 130 |
} |
|
| 131 |
|
|
| 132 |
# Wrapperfunktionen um Error wegen leerer Dateien abzufangen |
|
| 133 |
leseUndParseBaWrapper <- function(zeile){
|
|
| 134 |
ret <- try(leseUndParseBa(zeile)) |
|
| 135 |
#Teste ob ein Fehler auftrat (vgl. ?try) |
|
| 136 |
if(inherits(ret,"try-error")){
|
|
| 137 |
cat(paste("WARNUNG: Konnte",as.character(unlist(zeile[2])),"nicht auswerten. Nehme an, dass keine Marker erkannt wurden.\n"))
|
|
| 138 |
return(c(0,0,0,0,0,0,0,0,0)) |
|
| 139 |
} |
|
| 140 |
return(ret) |
|
| 141 |
} |
|
| 142 |
|
|
| 143 |
leseUndParseAlWrapper <- function(zeile){
|
|
| 144 |
ret <- try(leseUndParseAl(zeile)) |
|
| 145 |
#Teste ob ein Fehler auftrat (vgl. ?try) |
|
| 146 |
if(inherits(ret,"try-error")){
|
|
| 147 |
cat(paste("WARNUNG: Konnte",as.character(unlist(zeile[2])),"nicht auswerten. Nehme an, dass keine Marker erkannt wurden.\n"))
|
|
| 148 |
return(c(0,0,0,0,0,0,0,0,0)) |
|
| 149 |
} |
|
| 150 |
return(ret) |
|
| 151 |
} |
|
| 152 |
|
|
| 153 |
leseUndParseArWrapper <- function(zeile){
|
|
| 154 |
ret <- try(leseUndParseAr(zeile)) |
|
| 155 |
#Teste ob ein Fehler auftrat (vgl. ?try) |
|
| 156 |
if(inherits(ret,"try-error")){
|
|
| 157 |
print(paste("WARNUNG: Konnte",as.character(unlist(zeile[2])),"nicht auswerten. Nehme an, dass keine Marker erkannt wurden.\n"))
|
|
| 158 |
return(c(0,0,0,0,0,0,0,0,0)) |
|
| 159 |
} |
|
| 160 |
return(ret) |
|
| 161 |
} |
|
| 162 |
|
|
| 163 |
teste <- read.csv(file="/home/jonas/Dokumente/Studium/Bachelorarbeit/evaluation/tests.csv",header=FALSE) |
|
| 164 |
print(teste) |
|
| 165 |
|
|
| 166 |
# Umwandlung in eine Liste von Listen |
|
| 167 |
testeL <- split(teste,row(teste)) |
|
| 168 |
|
|
| 169 |
# ermittle gewichtete Punkte |
|
| 170 |
bartPunkte <- data.frame(t(mapply(leseUndParseBaWrapper,testeL))) |
|
| 171 |
alvarPunkte <- data.frame(t(mapply(leseUndParseAlWrapper,testeL))) |
|
| 172 |
arucoPunkte <- data.frame(t(mapply(leseUndParseArWrapper,testeL))) |
|
| 173 |
|
|
| 174 |
# Umrechnung in Phasen |
|
| 175 |
bartDaten <- lapply(bartPunkte,zusammenfassenFuerAllePhasen,teste[3:10]) |
|
| 176 |
alvarDaten <- lapply(alvarPunkte,zusammenfassenFuerAllePhasen,teste[3:10]) |
|
| 177 |
arucoDaten <- lapply(arucoPunkte,zusammenfassenFuerAllePhasen,teste[3:10]) |
|
| 178 |
|
|
| 179 |
# In Frames umwandeln |
|
| 180 |
bartDaten <- do.call(rbind,bartDaten) |
|
| 181 |
bartDaten <- data.frame(t(bartDaten)) |
|
| 182 |
|
|
| 183 |
alvarDaten <- do.call(rbind,alvarDaten) |
|
| 184 |
alvarDaten <- data.frame(t(alvarDaten)) |
|
| 185 |
|
|
| 186 |
arucoDaten <- do.call(rbind,arucoDaten) |
|
| 187 |
arucoDaten <- data.frame(t(arucoDaten)) |
|
| 188 |
|
|
| 189 |
# Numerisch machen |
|
| 190 |
bartDaten <- lapply(bartDaten,as.numeric) |
|
| 191 |
alvarDaten <- lapply(alvarDaten,as.numeric) |
|
| 192 |
arucoDaten <- lapply(arucoDaten,as.numeric) |
|
| 193 |
|
|
| 194 |
# Normalisierung, so dass für jede Phase 0 bis 100 Punkte erreicht werden können |
|
| 195 |
divisoren <- c(16.667,33.333,131.667,79.167,119.444,137.778,110.0,171.944) |
|
| 196 |
divisorenFrame <- data.frame(divisoren,divisoren,divisoren,divisoren,divisoren,divisoren,divisoren,divisoren,divisoren) |
|
| 197 |
bartDaten <- bartDaten / divisorenFrame * 100 |
|
| 198 |
alvarDaten <- alvarDaten / divisorenFrame * 100 |
|
| 199 |
arucoDaten <- arucoDaten / divisorenFrame * 100 |
|
| 200 |
|
|
| 201 |
# Beschriftung ergänzen |
|
| 202 |
zeilenBeschriftungen <- c("Graubild","Entstörung","Binarisierung","Segmentierung","Kanten und Eckenerkennung","Kandidatensuche","Normalisierung","Identifikation")
|
|
| 203 |
bartDaten <- cbind(zeilenBeschriftungen,bartDaten) |
|
| 204 |
alvarDaten <- cbind(zeilenBeschriftungen,alvarDaten) |
|
| 205 |
arucoDaten <- cbind(zeilenBeschriftungen,arucoDaten) |
|
| 206 |
|
|
| 207 |
print(bartDaten[c(1,2,3,4),]) |
|
| 208 |
print(alvarDaten[c(1,2,3,4),]) |
|
| 209 |
print(arucoDaten[c(1,2,3,4),]) |
|
| 210 |
|
|
| 211 |
# Zusammenführen |
|
| 212 |
tabelle1080p <- merge(bartDaten[c(1,2,3,4)],alvarDaten[c(1,2,3,4)],by=c("zeilenBeschriftungen"))
|
|
| 213 |
tabelle1080p <- merge(tabelle1080p,arucoDaten[c(1,2,3,4)],by=c("zeilenBeschriftungen"))
|
|
| 214 |
tabelle720p <- merge(bartDaten[c(1,5,6,7)],alvarDaten[c(1,5,6,7)],by=c("zeilenBeschriftungen"))
|
|
| 215 |
tabelle720p <- merge(tabelle720p,arucoDaten[c(1,5,6,7)],by=c("zeilenBeschriftungen"))
|
|
| 216 |
tabelle360p <- merge(bartDaten[c(1,8,9,10)],alvarDaten[c(1,8,9,10)],by=c("zeilenBeschriftungen"))
|
|
| 217 |
tabelle360p <- merge(tabelle360p,arucoDaten[c(1,8,9,10)],by=c("zeilenBeschriftungen"))
|
|
| 218 |
|
|
| 219 |
# Zeilen wieder in die Reihenfolge bringen, in der die Phasen beschrieben wurden |
|
| 220 |
positionen <- c(3,2,1,8,6,5,7,4) |
|
| 221 |
tabelle1080p <- tabelle1080p[positionen,] |
|
| 222 |
tabelle720p <- tabelle720p[positionen,] |
|
| 223 |
tabelle360p <- tabelle360p[positionen,] |
|
| 224 |
|
|
| 225 |
# Umwandlung in Latextabellenobjekte |
|
| 226 |
zeilen = nrow(tabelle1080p) |
|
| 227 |
#print(zeilen) |
|
| 228 |
if(zeilen > 32){
|
|
| 229 |
# erste Seiten |
|
| 230 |
latex1080p <- xtable::xtable(tabelle1080p[1:32,]) |
|
| 231 |
latex720p <- xtable::xtable(tabelle720p[1:32,]) |
|
| 232 |
latex360p <- xtable::xtable(tabelle360p[1:32,]) |
|
| 233 |
# print(latex1080p) |
|
| 234 |
# Ausgabe in die Latexdateien |
|
| 235 |
print(latex1080p,file="../text/tabellen/benchm_tabelle1080p.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(decimal.mark = ",")) |
|
| 236 |
print(latex720p,file="../text/tabellen/benchm_tabelle720p.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(decimal.mark = ",")) |
|
| 237 |
print(latex360p,file="../text/tabellen/benchm_tabelle360p.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(decimal.mark = ",")) |
|
| 238 |
|
|
| 239 |
# zweite Seiten |
|
| 240 |
latex1080p <- xtable::xtable(tabelle1080p[33:zeilen,]) |
|
| 241 |
latex720p <- xtable::xtable(tabelle720p[33:zeilen,]) |
|
| 242 |
latex360p <- xtable::xtable(tabelle360p[33:zeilen,]) |
|
| 243 |
|
|
| 244 |
# Ausgabe in die Latexdateien |
|
| 245 |
print(latex1080p,file="../text/tabellen/benchm_tabelle1080p2.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(big.mark = "'", decimal.mark = ",")) |
|
| 246 |
print(latex720p,file="../text/tabellen/benchm_tabelle720p2.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(big.mark = "'", decimal.mark = ",")) |
|
| 247 |
print(latex360p,file="../text/tabellen/benchm_tabelle360p2.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(big.mark = "'", decimal.mark = ",")) |
|
| 248 |
|
|
| 249 |
} else {
|
|
| 250 |
latex1080p <- xtable::xtable(tabelle1080p) |
|
| 251 |
latex720p <- xtable::xtable(tabelle720p) |
|
| 252 |
latex360p <- xtable::xtable(tabelle360p) |
|
| 253 |
|
|
| 254 |
# Ausgabe in die Latexdateien |
|
| 255 |
print(latex1080p,file="../text/tabellen/benchm_tabelle1080p.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(decimal.mark = ",")) |
|
| 256 |
print(latex720p,file="../text/tabellen/benchm_tabelle720p.tex",tabular.environment="tabulary",only.contents=TRUE,include.rownames=FALSE,include.colnames=FALSE,hline.after=NULL,format.args=list(decimal.mark = ",")) |
|
| 257 | ||