public static void CreatText() { MLText text = CreateUtility.Create <MLText>("MLText"); text.raycastTarget = false; text.text = "New Text"; text.color = Color.white; }
/// <summary> /// Display result in TextView /// for local analyze /// </summary> private void DisplaySuccess(MLText mlText) { string result = "Local Analyze:" + "\n\n"; IList <MLText.Block> blocks = mlText.Blocks; foreach (MLText.Block block in blocks) { foreach (MLText.TextLine line in block.Contents) { result += line.StringValue + "\n"; } } this.mTextView.Text = result; }
/// <summary> /// Transform the detected text into BlockItem structure. /// </summary> /// <param name="blocks"></param> /// <returns></returns> private IList <BlockItem> GetOriginItems(IList <MLText.Block> blocks) { IList <BlockItem> originItems = new List <BlockItem>(); foreach (MLText.Block block in blocks) { IList <MLText.Base> lines = block.Contents; foreach (MLText.TextLine line in lines) { string text = line.StringValue; text = FilterString(text, "[^a-zA-Z0-9\\.\\-,<\\(\\)\\s]"); Log.Info("PassCardProcess", "PassCardProcess text: " + text); Point[] points = line.GetVertexes(); Rect rect = new Rect(points[0].X, points[0].Y, points[2].X, points[2].Y); BlockItem item = new BlockItem(text, rect); originItems.Add(item); } } return(originItems); }
/// <summary> /// Display result in TextView /// for remote analyze /// </summary> private void RemoteDisplaySuccess(MLText mlTexts) { string result = "Remote Analyze:" + "\n\n"; IList <MLText.Block> blocks = mlTexts.Blocks; foreach (MLText.Block block in blocks) { IList <MLText.Base> lines = block.Contents; foreach (MLText.TextLine line in lines) { IList <MLText.Base> words = line.Contents; foreach (MLText.Base word in words) { result += word.StringValue + " "; } } result += "\n"; } this.mTextView.Text = result; }
public PassCardProcess(MLText text) { this.text = text; }
public HomeCardProcess(MLText text) { this.text = text; }
public HKIdCardProcess(MLText text) { this.text = text; }