.NET에서 공간 왜곡이 있는 2D 매트릭스 바코드 인식

블로그 카테고리: 바코드.NET

2020/05/066

VintaSoft Barcode .NET SDK는 .NET/C# 애플리케이션에서 표면 왜곡이 있는 2차원 아즈텍, QR 코드 및 한신 코드 바코드를 인식하는 데 사용할 수 있습니다. 실제로 이 SDK를 사용하면 사진 카메라, 웹 카메라 또는 스마트폰 카메라를 사용한 바코드 인식이 크게 간소화됩니다. 이제 바코드를 카메라 앞에 정렬할 필요가 없으며, 표면이 고르지 않은 바코드도 인식할 수 있습니다.




저희 개발팀은 웹 카메라와 사진 카메라를 사용한 왜곡 보정 알고리즘을 개발하고 개선하는 데 많은 시간을 투자했습니다. 아래에서 저희 바코드 리더의 "눈"을 통해 이러한 바코드를 확인할 수 있습니다.



개발팀은 어느 순간부터 바코드를 정확히 이렇게 인식하기 시작했습니다. :)


다음은 공간 왜곡이 있는 아즈텍, QR 및 한신 코드 바코드를 인식할 수 있는 C# 코드입니다.
/// <summary>
/// Recognizes 2D matrix barcodes (Aztec, QR Code and Han Xin Code) with spatial distortions.
/// </summary>
public void Recognize2dBarcodeWithSpatialDistortions()
{
    // create barcode reader
    using (Vintasoft.Barcode.BarcodeReader reader = new Vintasoft.Barcode.BarcodeReader())
    {
        // specify that reader must search for Aztec, QR and Han Xin Code barcodes
        reader.Settings.ScanBarcodeTypes = Vintasoft.Barcode.BarcodeType.Aztec |
            Vintasoft.Barcode.BarcodeType.QR |
            Vintasoft.Barcode.BarcodeType.HanXinCode;

        // specify that reader must search for horizontal and vertical barcodes only
        reader.Settings.ScanDirection = Vintasoft.Barcode.ScanDirection.Horizontal | Vintasoft.Barcode.ScanDirection.Vertical;

        // read barcodes from image file
        Vintasoft.Barcode.IBarcodeInfo[] barcodeInfos = reader.ReadBarcodes("barcodes.png");

        // if barcodes are not detected
        if (barcodeInfos.Length == 0)
        {
            System.Console.WriteLine("Barcodes are not found.");
        }
        // if barcodes are detected
        else
        {
            // get information about recognized barcodes

            System.Console.WriteLine(string.Format("{0} barcode(s) found:", barcodeInfos.Length));
            System.Console.WriteLine();
            for (int i = 0; i &lt; barcodeInfos.Length; i++)
            {
                Vintasoft.Barcode.IBarcodeInfo barcodeInfo = barcodeInfos[i];
                System.Console.WriteLine(string.Format("[{0}:{1}]", i + 1, barcodeInfo.BarcodeType));
                System.Console.WriteLine(string.Format("Value:      {0}", barcodeInfo.Value));
                System.Console.WriteLine(string.Format("Region:     {0}", barcodeInfo.Region));
                System.Console.WriteLine();
            }
        }
    }
}


테스트 결과, 바코드 판독기는 아래에 명시된 하나 이상의 왜곡 유형을 성공적으로 처리할 수 있는 것으로 나타났습니다.

다음은 왜곡된 바코드가 포함된 이미지입니다.













더 많은 왜곡된 바코드 이미지는 VintaSoft Barcode .NET SDK 배포 패키지에서 찾을 수 있습니다.

바코드 인식에 문제가 발생하여 당사의 바코드 인식 알고리즘으로 해결할 수 있다고 생각되시면 support@vintasoft.com으로 이미지를 보내 테스트 및 검토를 요청해 주십시오.