IronQR를 사용한 실시간 비디오 스트림 스캔
휴대폰 카메라에서 QR 코드를 실시간으로 읽고자 하지만, IronQR은 실시간 비디오 스트림 스캔을 위한 내장 메서드를 제공하지 않습니다. 해결책은 카메라에서 개별 프레임을 하나씩 독립적으로 읽어들이는 것입니다.
해결책
IronQR은 고정밀 정적 QR 코드 인식에 중점을 두고 있습니다. 실시간 비디오 디코딩은 OpenCV와 같은 컴퓨터 비전 프레임워크 또는 플랫폼 네이티브 카메라 SDK의 분야입니다. 라이브 스캔 효과를 얻으려면 프레임을 직접 캡처하여 각각을 정지 이미지로 디코딩합니다.
1. 장치의 카메라 피드를 엑세스하기
플랫폼 네이티브 API를 통해 카메라를 엽니다: Xamarin.Essentials, MAUI 카메라 또는 Android/iOS SDK를 직접 사용합니다.
2. 지속적으로 프레임 가져오기
100ms마다 한 번씩 프레임을 끌어와 그것을 비트맵으로 변환합니다.
3. 각 프레임을 읽기에 전달하기
캡처한 비트맵을 QrImageInput에 설정하고 QrReader.Read()에 전달합니다.
// Load the asset into QrImageInput
QrImageInput imageInput = new QrImageInput(capturedBitmap);
// Create a QR Reader object
QrReader reader = new QrReader();
// Read the Input an get all embedded QR Codes
IEnumerable<QrResult> results = reader.Read(imageInput);
// Load the asset into QrImageInput
QrImageInput imageInput = new QrImageInput(capturedBitmap);
// Create a QR Reader object
QrReader reader = new QrReader();
// Read the Input an get all embedded QR Codes
IEnumerable<QrResult> results = reader.Read(imageInput);
' Load the asset into QrImageInput
Dim imageInput As New QrImageInput(capturedBitmap)
' Create a QR Reader object
Dim reader As New QrReader()
' Read the Input and get all embedded QR Codes
Dim results As IEnumerable(Of QrResult) = reader.Read(imageInput)
각 호출은 하나의 정지 프레임을 분석합니다. 이를 연속으로 디코드하여 카메라는 실시간으로 스캔하는 것처럼 보이지만, 사실 IronQR은 개별 이미지만 봅니다.

