public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X = word.MatchedWord.BoundingBox.Vertices[1].X; //Set "Karosserie" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2.8); X = X + Math.Round(wordLenght * 1.25); } //Set "Carrosserie" label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 0.8); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 1.6); X = X + Math.Round(wordLenght * 1.1); } //Set "Carrozzeria" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 1.8); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 0.8); X = X + Math.Round(wordLenght * 1.01); } //Set "Carossaria" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2.7); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 1.25); } IList <Word> bodyCodeMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY1 > Y1 && blokY2 < Y2 && blokX2 > X) { bodyCodeMatchedWords.Add(w); } } } } return(bodyCodeMatchedWords); }
public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X = word.MatchedWord.BoundingBox.Vertices[1].X; //Set "Farbe" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2.65); X = X + Math.Round(wordLenght * 3.12); } //Set "Couleur" label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 1.6); X = X + Math.Round(wordLenght * 2.03); } //Set "Colore" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(1.7 * wordHeight); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight); X = X + Math.Round(wordLenght * 2.75); } //Set "Colur" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2.7); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 3.5); } IList <Word> colorMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY1 > Y1 && blokY2 < Y2 && blokX2 > X) { colorMatchedWords.Add(w); } } } } return(colorMatchedWords); }
public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X = word.MatchedWord.BoundingBox.Vertices[1].X; //Set "Fahrgestell" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 3); X = X + Math.Round(wordLenght * 1.1); } //Set "Nr." label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 3); X = X + Math.Round(wordLenght * 3.3); } //Set "Chassis" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2); X = X + Math.Round(wordLenght * 2.2); } //Set "Telaio" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight); X = X + Math.Round(wordLenght * 2.75); } //Set "Schassis" label coordinates range. if (word.TargetValueOrder == 4) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2.5); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 1.48); } //Set "nr." label coordinates range. if (word.TargetValueOrder == 5) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2.5); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 4.8); } IList <Word> chassisNumMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY1 > Y1 && blokY2 < Y2 && blokX2 > X) { chassisNumMatchedWords.Add(w); } } } } return(chassisNumMatchedWords); }
public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X = word.MatchedWord.BoundingBox.Vertices[1].X; //Set "Art" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 3); X = X + Math.Round(wordLenght * 10); } //Set "Fahrzeugs" label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 3); X = X + Math.Round(wordLenght * 2.2); } //Set "Genre" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2); X = X + Math.Round(wordLenght * 2.5); } //Set "véhicule" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2); X = X + Math.Round(wordLenght * 0.6); } //Set "Genere" label coordinates range. if (word.TargetValueOrder == 4) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight); X = X + Math.Round(wordLenght * 2.3); } //Set "veicolo" label coordinates range. if (word.TargetValueOrder == 5) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight); X = X + Math.Round(wordLenght * 0.8); } //Set "Gener" label coordinates range. if (word.TargetValueOrder == 6) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 3); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 2.5); } //Set "vehichel" label coordinates range. if (word.TargetValueOrder == 7) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 3); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 0.4); } IList <Word> typeMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY1 > Y1 && blokY2 < Y2 && blokX2 > X) { typeMatchedWords.Add(w); } } } } return(typeMatchedWords); }
public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X1 = word.MatchedWord.BoundingBox.Vertices[1].X; double X2 = X1; //Set "Stammnummer" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2.4); X1 = X1 + Math.Round(wordLenght * 0.45); X2 = X2 + Math.Round(wordLenght * 3); } //Set "matricule" label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 1.6); X1 = X1 + Math.Round(wordLenght * 1.35); X2 = X2 + Math.Round(wordLenght * 6.2); } //Set "matricola" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 1.5); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 0.7); X1 = X1 + Math.Round(wordLenght * 1.1); X2 = X2 + Math.Round(wordLenght * 6.05); } //Set "matricla" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 2.5); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X1 = X1 + Math.Round(wordLenght * 1.2); X2 = X2 + Math.Round(wordLenght * 7.1); } IList <Word> matriculeNumMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY2 > Y1 && blokY1 < Y2 && blokX1 > X1 && blokX2 < X2) { matriculeNumMatchedWords.Add(w); } } } } return(matriculeNumMatchedWords); }
public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X1 = word.MatchedWord.BoundingBox.Vertices[1].X; double X2 = X1; //Set "Inverkehrsetzung" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + 2 * wordHeight; X1 = X1 + Math.Round(wordLenght * 0.3); X2 = X2 + Math.Round(wordLenght * 2.75); } //Set "mise" label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 0.8); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + wordHeight; X1 = X1 + Math.Round(wordLenght * 4.3); X2 = X2 + Math.Round(wordLenght * 15.2); } //Set "circulation" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 0.8); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + wordHeight; X1 = X1 + Math.Round(wordLenght * 0.3); X2 = X2 + Math.Round(wordLenght * 4.8); } //Set "messa" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 0.5); X1 = X1 + Math.Round(wordLenght * 3); X2 = X2 + Math.Round(wordLenght * 10.9); } //Set "circolazione" label coordinates range. if (word.TargetValueOrder == 4) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + +Math.Round(wordHeight * 0.5); X1 = X1 + Math.Round(wordLenght * 0.2); X2 = X2 + Math.Round(wordLenght * 4.1); } //Set "entrada" label coordinates range. if (word.TargetValueOrder == 5) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - 2 * wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X1 = X1 + Math.Round(wordLenght * 2.2); X2 = X2 + Math.Round(wordLenght * 8.3); } //Set "{" label coordinates range. if (word.TargetValueOrder == 6) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - 2 * wordHeight; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X1 = X1 + Math.Round(wordLenght * 0.2); X2 = X2 + Math.Round(wordLenght * 4.8); } IList <Word> firstRegistrationDateMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY2 > Y1 && blokY1 < Y2 && blokX1 > X1 && blokX2 < X2) { firstRegistrationDateMatchedWords.Add(w); } } } } return(firstRegistrationDateMatchedWords); }
public IList <Word> FindWords(MatchedAnnotation word) { double wordHeight = word.MatchedWord.BoundingBox.Vertices[3].Y - word.MatchedWord.BoundingBox.Vertices[0].Y; double wordLenght = word.MatchedWord.BoundingBox.Vertices[1].X - word.MatchedWord.BoundingBox.Vertices[0].X; double Y1 = 0; double Y2 = 0; double X = word.MatchedWord.BoundingBox.Vertices[1].X; //Set "Marke" label coordinates range. if (word.TargetValueOrder == 0) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2.7); X = X + Math.Round(wordLenght * 3.1); } //Set "Typ" label coordinates range. if (word.TargetValueOrder == 1) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y; Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 2.7); X = X + Math.Round(wordLenght * 2.3); } //Set "Marque" label coordinates range. if (word.TargetValueOrder == 2) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 0.7); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 1.3); X = X + Math.Round(wordLenght * 2.1); } //Set "type" label coordinates range. if (word.TargetValueOrder == 3) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 0.7); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 1.3); X = X + Math.Round(wordLenght * 1.6); } //Set "Marca" label coordinates range. if (word.TargetValueOrder == 4) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 1.5); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 0.85); X = X + Math.Round(wordLenght * 3.2); } //Set "tipo" label coordinates range. if (word.TargetValueOrder == 5) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 1.5); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y + Math.Round(wordHeight * 0.85); X = X + Math.Round(wordLenght * 3.1); } //Set "Marca" label coordinates range. if (word.TargetValueOrder == 6) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 3); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 5); } //Set "tig" label coordinates range. if (word.TargetValueOrder == 7) { Y1 = word.MatchedWord.BoundingBox.Vertices[0].Y - Math.Round(wordHeight * 3); Y2 = word.MatchedWord.BoundingBox.Vertices[3].Y; X = X + Math.Round(wordLenght * 9); } IList <Word> markAndModelMatchedWords = new List <Word>(); foreach (var block in annotationContext.Pages[0].Blocks) { foreach (var paragraph in block.Paragraphs) { foreach (var w in paragraph.Words) { int blokY1 = w.BoundingBox.Vertices[0].Y; int blokY2 = w.BoundingBox.Vertices[3].Y; int blokX1 = w.BoundingBox.Vertices[0].X; int blokX2 = w.BoundingBox.Vertices[1].X; if (blokY1 > Y1 && blokY2 < Y2 && blokX2 > X) { markAndModelMatchedWords.Add(w); } } } } return(markAndModelMatchedWords); }