Identyfy barcode and patch code

Hi Team,

We are using the following way to identify Patchcode

using (BarCodeReader reader = new BarCodeReader(FullImageName, BarCodeReadType.PatchCode))

To identify Barcode we are using the following way
Aspose.BarCodeRecognition.BarCodeReader BarcodeReader = new Aspose.BarCodeRecognition.BarCodeReader(FullImageName, Aspose.BarCodeRecognition.BarCodeReadType.Code39Standard);


So it is taking lot of time to complete large IFO file.


Is there any way to identify both(Barcode and Patchcode) in a single line of code?

Regards

Anish

Hi Anish,


Thank you for contacting support. Well, you can concatenate symbologies while initializing the BarCodeReader object. So you don’t need to initialize second BarCodeReader object. Please have a look over this help topic: Recognizing Multiple Symbologies in Single Image
anishvj:
So it is taking lot of time to complete large IFO file.
In addition to that you can cut the part where bar code resides, if some placement rules are exists for bar code i.e. top right corner. This can significantly speed up the processing as we will have to process only a small portion of the image. Please see an example there: Read Barcode from Specific Region of Image

We hope, this helps. Please feel free to reply us in case of any confusion or questions.

Hi Imran,


We have followed your way to identify patch and barcode but still it took 5 minutes.
We have about 165 images and an IFO file.
Is there any way to improve the performance to a little.
Please find the zipped attachment.
Code we have used is pasted below, Please have a look


private int ReadImageBarcodesWithAspose(ref ACS.PMO.IFOComp.IFOImage image)
{

if (image.ImageName.ToUpper().IndexOf(“C”) != -1)
return 0;

string FullImageName = image[“ImageName”];
if (FullImageName == null || FullImageName.Trim() == string.Empty)
throw new Exception(“IFO Line With No ImageName Attribute Found.”);
if (!System.IO.File.Exists(FullImageName))
throw new Exception(“Image Not Found At Path '” + FullImageName + “’.”);

int BarCodeCount = 0;


try
{

using (BarCodeReader reader = new BarCodeReader(FullImageName, BarCodeReadType.PatchCode | BarCodeReadType.Code39Standard))
{

while (reader.Read())
{

string getType = reader.GetReadType().ToString();
// Console.WriteLine("Code Text: " + reader.GetCodeText() + " Type: " + reader.GetReadType());

// PatchCode = reader.GetCodeText();

string bc = reader.GetCodeText().ToString();

if (image[“PatchCode”] == null && !getType.ToUpper().Equals(“CODE39STANDARD”) )
{
switch (bc.ToUpper())
{

case “PATCH I”:
case “PATCHI”:
case “PATCH 1”:
case “PATCH1”:
//PatchCode = “PATCH2”;
image[“PatchCode”] = “Patch1”;
break;

case “PATCH II”:
case “PATCHII”:
case “PATCH 2”:
case “PATCH2”:
//PatchCode = “PATCH2”;
image[“PatchCode”] = “Patch2”;
break;

case “PATCH III”:
case “PATCHIII”:
case “PATCH 3”:
case “PATCH3”:
//PatchCode = “PATCH2”;
image[“PatchCode”] = “Patch3”;
break;


case “PATCH IV”:
case “PATCHIV”:
case “PATCH 4”:
case “PATCH4”:
image[“PatchCode”] = “Patch4”;
break;


case “PATCH V”:
case “PATCHV”:
case “PATCH 5”:
case “PATCH5”:
image[“PatchCode”] = “Patch5”;
break;


case “PATCH VI”:
case “PATCHVI”:
case “PATCH 6”:
case “PATCH6”:
image[“PatchCode”] = “Patch6”;
break;


}
}


// – we want to check the barcode against the regex
// – if we don’t find a match, throw this barcode away
// – but only do this logic if they have at least one regex defined


IDictionaryEnumerator masks = filters.GetEnumerator();
while (masks.MoveNext())
{
if (Regex.IsMatch(bc, Convert.ToString(masks.Value), RegexOptions.IgnoreCase)) //f))
{
BarCodeCount++;
image[String.Format(“BarCode{0}”, BarCodeCount)] = bc;
// image[Convert.ToString(masks.Key)] = BarCodeList[i].BarcodeValue;
//break;
}
}



}

}


}
catch (Exception ex)
{
throw new Exception(ex.Message);
}



return BarCodeCount;

}

Hi Anish,


Thank you for sharing sample graphics. Did you try using the latest version of Aspose.BarCode for 6.3.0? Please share details about the version number. In the exe mode, it does not take more than 1.5 seconds to recognize a single image. Please refer to the download page:
http://www.aspose.com/community/files/51/.net-components/aspose.barcode-for-.net/default.aspx