public static dynamic Record1(string path) { dynamic ddata = new System.Dynamic.ExpandoObject(); var image = File.ReadAllBytes(path); var image_c = Identification.BytesCutRight(image); JObject jb; try { jb = Identification.IdentifyImage(image_c, ApiVersion.AccurateBasic); } catch (NoApiTimesException e) { throw e; } StringWriter strWriter = new StringWriter(); StringBuilder sb = strWriter.GetStringBuilder(); string words_all = ""; foreach (var jd in jb["words_result"]) { string words = jd["words"].ToString(); sb.Insert(sb.Length, words); } words_all = sb.ToString(); ddata.HistoryOfPastIllness = Regex.Match(words_all, @"(?:既往史:)([\S|\s]*)(?:个人史:)").Groups[1].Value; return(ddata); }
public override void CutPicture(ResetPictures reset) { var image = reset.originImages[0]; var image_c = Identification.BytesCutRight(image); reset.rearrayImages.Add(image_c); }