public async Task <ActionResult <Fingerprint> > PostFingerprint([FromBody] FPforSend fingerprint) { byte[] arr = fingerprint.FingerImage; bool[][] array = OperationsWithImage.ImgOperations(arr); MinutionsIssue minutions = new MinutionsIssue(); minutions.SearchMinutions(array); int[,] minutiaArr = minutions.GeneralPoints; int[] qq = MinutionsIssue.Make1DArray(minutiaArr, 338, 248); int qqscore = 0; for (int i = 0; i < qq.Length; i++) { if (qq[i] != 0) { qqscore++; } } byte[] minutiaB = MinutionsIssue.IntToByteArr(qq); // int[] aa = MinutionsIssue.ByteToIntArray(minutiaB); Fingerprint fingerprintForADD = new Fingerprint { FingerImage = arr, Minutions = minutiaB, EmploeeId = fingerprint.EmploeeId }; db.Fingerprints.Add(fingerprintForADD); await db.SaveChangesAsync(); return(CreatedAtAction(nameof(GetFingerprint), new { id = fingerprint.Id }, fingerprint)); }
public async Task <ActionResult <List <MyDictionary> > > Operations(byte[] array) { bool[][] arr = OperationsWithImage.ImgOperations(array); MinutionsIssue minutions = new MinutionsIssue(); minutions.SearchMinutions(arr); int[,] minutiaArr = minutions.GeneralPoints; List <Fingerprint> list = await db.Fingerprints.ToListAsync(); List <MyDictionary> dictionary = MinutionsIssue.Compare(minutiaArr, list); dictionary = dictionary.OrderByDescending(i => i.score).ToList(); List <MyDictionary> res = dictionary.Take(3).ToList(); int qq = 20; return(Created("", res)); }