Specifying a Topology

This code snippet shows how to create and set a topology.

C++

#include <eVision/EasyOcr/EasyDeepOCR/ETextReader.h>
using namespace eVision;
namespace EDO = eVision::EasyDeepOCR;
// Create an ETopologyLine vector
std::vector<ETopologyLine> topologyLines;
// Fill the vector
topologyLines.emplace_back("[Lot:] 00[-]0{1,3}");
topologyLines.emplace_back("[Exp:] 00[/]00[/]0{4}");
// Create an ETopology instance
ETopology topology;
// Set the lines
topology.SetTopologyLines(topologyLines);
// Create an ETextReader instance
EDO::ETextReader reader;
// Set the topology
reader.SetTopology(topology);
// ...

C#

using eVision;
using EDO = eVision.EasyDeepOCR;
// Create an ETopologyLine array
ETopologyLine[] topologyLines = new ETopologyLine[2];
// Fill the array
topologyLines[0] = new ETopologyLine("[Lot:] 00[-]0{1,3}");
topologyLines[1] = new ETopologyLine("[Exp:] 00[/]00[/]0{4}");
// Create an ETopology instance
ETopology topology = new ETopology();
// Set the lines
topology.TopologyLines = topologyLines;
// Create an ETextReader instance
EDO.ETextReader reader = new EDO.ETextReader();
// Set the topology
reader.Topology = topology;
// ...

Python

import eVision
from eVision import EasyDeepOCR as EDO
# Create an ETopologyLine list
topologyLines = []
# Fill the vector
topologyLines.append(eVision.ETopologyLine("[Lot:] 00[-]0{1,3}"))
topologyLines.append(eVision.ETopologyLine("[Exp:] 00[/]00[/]0{4}"))
# Create an ETopology instance
topology = eVision.ETopology()
# Set the lines
topology.TopologyLines = topologyLines
# Create an ETextReader instance
reader = EDO.ETextReader()
# Set the topology
reader.Topology = topology