Running Infield Correction
Introduction
Infield Verification과 Infield Correction은 카메라 정확도의 체계적 구성 요소인 치수 진실도를 측정하고 보정합니다. 정확도, 진실도, 정밀도의 정의에 대해서는 Zivid Specs Terminology 를 참조하세요.
카메라에서 Infield Verification 또는 Correction을 실행하기 위해 다음을 사용할 수 있습니다.
Zivid Studio
CLI tool
SDK
팁
Infield Correction을 처음 실행하는 경우 Zivid Studio를 사용하는 것이 좋습니다.
다음 각 방법을 통해 카메라의 치수 진실도를 Verify(확인)하고, Correct(보정)하며, 마지막으로 보정이 적용된 시점을 Read(확인)하고, 보정을 Reset(재설정)할 수 있습니다. 새 보정을 확인하거나 적용하기 전에 기존 보정을 재설정할 필요는 없습니다.
Studio
기능 개요
Last correction Infield Correction이 카메라에 기록된 마지막 날짜와 시간을 보여줍니다.
Capture & Measure 는 Zivid 보정 보드가 놓인 위치에서 포인트 클라우드의 로컬 Dimension Trueness 오류를 결정하기 위해 캡처합니다.
Current Camera Metrics Capture & Measure 로 마지막으로 캡처된 항목의 로컬 차원 Dimension trueness 오류와 모든 캡처의 평균 및 최대값을 보여줍니다.
Current trueness Capture & Measure 로 수행한 마지막으로 캡처된 항목의 로컬 차원 Dimension Trueness 오류를 보여줍니다.
Average trueness 지금까지 Capture & Measure 로 수행된 모든 캡처에 대한 Local Dimension Trueness 오류의 평균을 보여줍니다.
Maximum trueness 지금까지 Capture & Measure 로 수행된 모든 캡처에 대한 Local Dimension Trueness 오류의 최대값을 보여줍니다.
Expected Post-Correction Metrics 는 이미지가 캡처된 작동 거리에 대한 1σ 통계적 불확실성 내에서 추정된 보정 후 오류를 보여줍니다.
Save Correction to Camera 는 Capture & Measure 로 찍은 Zivid 캘리브레이션 보드의 캡처에서 결정된 포인트 클라우드의 치수 진실도를 개선하기 위한 파라미터를 카메라에 기록합니다.
Reset Camera Correction 는 이전 올바른 인스턴스에 적용된 모든 Infield Correction을 제거합니다. 새로운 Infield Correction을 하기 전에 재설정을 할 필요는 없습니다.
Verify
보드를 원하는 위치에 놓습니다. 라이브 캡처 모드에서 Zivid Studio를 사용하여 보드를 올바르게 정렬할 것을 권장합니다. Infield Correction 데이터 세트에서 첫 번째 캡처를 위해 캡처하려는 가장 가까운 거리에 체커보드를 배치합니다. 보드를 카메라의 좌표계와 최대한 평행하게 만들고 전체 보드가 카메라 프레임에 표시되는지 확인하십시오.
그런 다음 Infield Correction 도구를 엽니다. 툴바에서 Tools → Infield Correction 클릭합니다.
연결된 카메라의 로컬 치수 Dimension Trueness 오류를 확인하려면 Capture & Measure 클릭하세요.
결과는 Current Camera Metrics 아래에 표시됩니다:
Correct
카메라에서 Infield Correction을 수행하려면 Guidelines for Performing Infield Correction 에 설명된 대로 다양한 거리와 시야각의 다양한 위치에서 보드를 사용하여 Capture & Measure 을 클릭하여 데이터를 수집합니다.
Infield Correction을 위해 캡처를 수행하면, 수정을 적용할 경우 주어진 캡처 수에 대한 예상 치수 진실도 오차가 표시됩니다.
이 프로세스를 완료하여 반환되는 정보에는 다음 내용이 포함됩니다.
주요 FOV에 대해 추정된 새 최대 Dimension Trueness 오차입니다.
보정 이미지가 촬영된 거리에 따라 이 오류가 예상되는 범위입니다.
보정 결과에 만족하면 보정 매개변수를 카메라에 적용하도록 선택합니다.
Clear Measurements
참고
Camera Metrics 의 값보다 Expected Post-Correction Metrics 의 값이 더 크게 나오는 것은 예상치 못한 일이 아닙니다. 이는 Expected Post-Correction Metrics 가 Infield Correction 데이터 세트에 사용된 대부분의 FOV와 거리 범위에 대해 제공되기 때문입니다. 반면에 Camera Metrics 는 캘리브레이션 보드가 커버하는 FOV와 보드까지의 거리에 대한 캡처에 대해 계산된 local dimension trueness 오차입니다.
마지막으로 Save Correction to Camera 클릭하여 카메라에 Infield correction을 적용합니다.
CLI
기능 개요
DESCRIPTION
Tool for verifying, computing and updating in-field correction parameters on a Zivid camera
SYNOPSIS
ZividInfieldCorrection.exe (verify|correct|read|reset)
ZividInfieldCorrection [--version] [-h]
OPTIONS
verify verify camera correction quality based on a single capture
correct calculate infield correction based on a series of captures at different distances and positions
read get information about the correction currently on the connected camera
reset reset correction on connected camera to factory settings
--version print version and exit
-h, --help show this help message and exit
Windows
설치 중에 Zivid가 PATH를 추가한 경우 CLI 도구는 PATH에 있으며, 그렇지 않은 경우 CLI 도구는 C:\Program Files\Zivid\bin 에 있습니다.
Ubuntu
CLI 도구는 기본 PATH에 있습니다.
Verify
명령어을 사용하여 입력 인수 verify 로 확인 기능을 실행합니다(Zivid Studio에서 카메라와의 연결을 끊는 것을 잊지 마십시오).
ZividInfieldCorrection verify
Potential Issues
보드가 카메라에서 너무 멀리 떨어져 있거나 캡처 품질이 좋지 않아 충분한 데이터를 제공할 수 없는 경우 잠재적인 설정 문제에 대해 아래와 같이 알려줍니다.
보드가 X, Y 또는 Z 평면에서 너무 기울어져 있습니다.
모든 특징점을 감지할 수 없습니다.
기준 마커가 표시되지 않습니다.
보드 이미지의 품질이 너무 낮아 충분한 데이터를 제공할 수 없습니다.
Correct
command line을 사용하여 입력 인수 correct 로 확인 기능을 실행합니다(Zivid Studio에서 카메라와의 연결을 끊는 것을 잊지 마십시오).
ZividInfieldCorrection correct
Potential Issues
보드가 카메라에서 너무 멀리 떨어져 있거나 캡처 품질이 좋지 않아 충분한 데이터를 제공할 수 없는 경우 잠재적인 설정 문제에 대해 아래와 같이 알려줍니다.
보드가 X, Y 또는 Z 평면에서 너무 기울어져 있습니다.
모든 특징점을 감지할 수 없습니다.
기준 마커가 표시되지 않습니다.
보드 이미지의 품질이 너무 낮아 충분한 데이터를 제공할 수 없습니다.
참고
각 캡처 측정에서 얻은 값보다 예상 보정 후 치수 진실도 오차 값이 더 크게 나오는 것은 예상치 못한 일이 아닙니다. 이는 예상 보정 후 지표가 Infield Correction 데이터 세트에 사용된 대부분의 FOV와 거리 범위에 대해 제공되기 때문입니다. 반면, 캡처 측정값은 캘리브레이션 보드가 커버하는 FOV와 보드까지의 거리에서의 캡처에 대해 계산된 로컬 치수 진실도 오차입니다.
Read
입력 인수 read 사용하여 카메라에 마지막 보정이 적용된 시기를 확인하십시오.
ZividInfieldCorrection read
Reset
입력 인수 reset 사용하여 카메라에 적용된 보정을 제거하십시오.
ZividInfieldCorrection reset
SDK
기능 개요
verify : 이 기능은 단일 캡처를 사용하여 Zivid 캘리브레이션 보드가 배치된 지점의 포인트 클라우드의 로컬 치수 Dimension Trueness 오류를 확인합니다.
correct: 이 기능은 Zivid 캘리브레이션 보드의 캡처를 사용하여 포인트 클라우드의 치수 진실도를 개선하는 데 필요한 매개변수를 결정하는 데 사용됩니다. 이렇게 하면 이미지가 캡처된 작동 거리에 대해 1σ 통계적 불확실성 내에서 보정 후 오류가 반환됩니다.
reset: 재설정을 사용하면 이전의 올바른 경우에 적용된 모든 Infield Correction 값이 제거됩니다. 새로운 Infield Correction을 수행하기 전에 재설정을 수행할 필요는 없습니다.
read: 읽기 기능은 Infield Correction이 카메라에 마지막으로 기록된 시간을 반환합니다.
Verify
SDK에서 카메라의 로컬 치수 Dimension Trueness 오류를 확인하려면 먼저 카메라에 연결하세요. (Zivid Studio에서 카메라 연결을 해제하는 것을 잊지 마세요).
그런 다음 Zivid 캘리브레이션 보드를 캡처하여 데이터를 수집합니다.
std::cout << "Capturing calibration board" << std::endl;
const auto detectionResult = Zivid::Calibration::detectCalibrationBoard(camera);
if(!detectionResult.valid())
{
throw std::runtime_error("Detection failed! Feedback: " + detectionResult.statusDescription());
}
Verify from ZDF file
ZDF 파일에서 카메라 치수 진실도를 확인하는 것이 유용한 이유는 무엇입니까?
시스템이 생산 중이라고 가정해 보겠습니다. 시스템이 실행되는 동안 카메라의 치수 진실도를 확인하려고 합니다. 동시에 로봇과 카메라가 빈 피킹과 같은 주요 작업 이외의 용도로 사용되는 시간을 최소화하고자 합니다. 캡처, 감지, 치수 진실도 추정으로 구성된 전체 Infield Verification을 실시간으로 실행하는 대신, 캡처만 수행하고 결과를 디스크의 ZDF 파일로 저장할 수 있습니다. 로봇과 카메라가 주요 작업으로 돌아가면 생산에 사용된 PC와는 다른 PC를 사용하여 ZDF 파일을 로드하고 오프라인에서 치수 진실도를 확인할 수 있습니다. 또한 이러한 ZDF 파일을 조사를 위해 Zivid Customer Success에 보낼 수 있습니다.
ZDF 파일에서 카메라 치수 진실도를 확인하려면 먼저 캘리브레이션 보드를 캡처합니다.
그런 다음 프레임을 디스크에 저장합니다.
ZDF 파일에서 프레임을 로드합니다.
std::cout << "Reading frame from file: " << dataFile << ", for offline infield verification" << std::endl;
const auto loadedFrame = Zivid::Frame(dataFile);
그런 다음 프레임에서 캘리브레이션 보드 특징점을 감지합니다.
참고
A frame captured with Calibration::captureCalibrationBoard is not the same as a frame resulting from Camera::capture2D3D().
Calibration::detectFeaturePoints only supports frame objects returned from Calibration::captureCalibrationBoard.
그런 다음 데이터를 준비하고 Infield Verification에 적합한지 확인합니다.
const auto input = Zivid::Calibration::InfieldCorrectionInput{ detectionResult };
if(!input.valid())
{
throw std::runtime_error(
"Capture not valid for infield verification! Feedback: " + input.statusDescription());
}
마지막으로 검증 결과를 보여줍니다.
std::cout << "Successful measurement at " << detectionResult.centroid() << std::endl;
const auto verification = Zivid::Calibration::verifyCamera(input);
std::cout << "Estimated dimension trueness error at measured position: " << std::setprecision(2) << std::fixed
<< verification.localDimensionTrueness() * 100.0F << "%" << std::endl;
Console.WriteLine("Successful measurement at " + detectionResult.Centroid().ToString());
var verification = Zivid.NET.Calibration.Calibrator.VerifyCamera(input);
Console.WriteLine("Estimated dimenstion trueness error at measured position: " + (verification.LocalDimensionTrueness * 100).ToString("0.00") + "%");
Potential Issues
보드가 카메라에서 너무 멀리 떨어져 있거나 캡처 품질이 좋지 않아 충분한 데이터를 제공할 수 없는 경우 잠재적인 설정 문제에 대해 아래와 같이 알려줍니다.
보드가 X, Y 또는 Z 평면에서 너무 기울어져 있습니다.
모든 특징점을 감지할 수 없습니다.
기준 마커가 표시되지 않습니다.
보드 이미지의 품질이 너무 낮아 충분한 데이터를 제공할 수 없습니다.
해당 API에 대해서는 Infield Verification and Correction 을 참조하세요.
Correct
SDK에서 카메라에 대해 Infield correction을 수행하려면 먼저 카메라에 연결합니다(Zivid Studio에서 카메라와의 연결을 해제하는 것을 잊지 마십시오).
그런 다음 카메라를 Zivid 캘리브레이션 보드로 향하게 하고 Infield correction을 위한 데이터를 수집합니다.
std::vector<Zivid::Calibration::InfieldCorrectionInput> dataset;
std::cout << "Please point the camera at a Zivid infield calibration board. " << std::endl;
const std::string printLine = "------------------------------------------------------------------------";
while(true)
{
std::cout << printLine << std::endl;
if(yesNoPrompt("Capture (y) or finish (n)?"))
{
std::cout << "Capturing calibration board" << std::endl;
const auto detectionResult = Zivid::Calibration::detectCalibrationBoard(camera);
if(detectionResult.valid())
{
const auto input = Zivid::Calibration::InfieldCorrectionInput{ detectionResult };
if(input.valid())
{
dataset.emplace_back(input);
std::cout << "Valid measurement at: " << input.detectionResult().centroid() << std::endl;
}
else
{
std::cout << "****Invalid Input****" << std::endl;
std::cout << "Feedback: " << input.statusDescription() << std::endl;
}
}
else
{
std::cout << "****Failed Detection****" << std::endl;
std::cout << "Feedback: " << detectionResult.statusDescription() << std::endl;
}
std::cout << printLine << std::endl;
}
else
{
std::cout << "End of capturing stage." << std::endl;
std::cout << printLine << std::endl;
break;
}
std::cout << "You have collected " << dataset.size() << " valid measurements so far." << std::endl;
}
var dataset = new List<Zivid.NET.Calibration.InfieldCorrectionInput>();
Console.WriteLine("Please point the camera at a Zivid infield calibration board.");
const string printLine = "------------------------------------------------------------------------";
while (true)
{
Console.WriteLine(printLine);
if (YesNoPrompt("Capture (y) or finish (n)?"))
{
Console.WriteLine("Capturing calibration board");
var detectionResult = Zivid.NET.Calibration.Detector.DetectCalibrationBoard(camera);
if (detectionResult.Valid())
{
var input = new Zivid.NET.Calibration.InfieldCorrectionInput(detectionResult);
if (input.Valid)
{
dataset.Add(input);
Console.WriteLine("Valid measurement at: " + input.DetectionResult.Centroid().ToString());
}
else
{
Console.WriteLine("****Invalid Input****");
Console.WriteLine("Feedback: " + input.StatusDescription());
}
}
else
{
Console.WriteLine("****Failed Detection****");
Console.WriteLine("Feedback: " + detectionResult.StatusDescription());
}
Console.WriteLine(printLine);
}
else
{
Console.WriteLine("End of capturing stage.");
Console.WriteLine(printLine);
break;
}
Console.WriteLine("You have collected " + dataset.Count + " valid measurements so far.");
}
dataset = []
print("Please point the camera at a Zivid infield calibration board. ")
print_line = "------------------------------------------------------------------------"
while True:
print(print_line)
if _yes_no_prompt("Capture (y) or finish (n)? "):
print("Capturing calibration board")
detection_result = zivid.calibration.detect_calibration_board(camera)
if detection_result.valid():
infield_input = zivid.calibration.InfieldCorrectionInput(detection_result)
if infield_input.valid():
dataset.append(infield_input)
else:
print("****Invalid Input****")
print(f"Feedback: {infield_input.status_description()}")
else:
print("****Failed Detection****")
print(f"Feedback: {detection_result.status_description()}")
print(print_line)
else:
print("End of capturing stage.")
print(print_line)
break
print(f"You have collected {len(dataset)} valid measurements so far.")
새로운 보정을 적용하기 전에 예상 치수 진실도 오차를 추정하세요.
const auto accuracyEstimate = correction.accuracyEstimate();
std::cout
<< "If written to the camera, this correction can be expected to yield a dimension trueness error of "
<< std::fixed << std::setprecision(2) << 100.0F * accuracyEstimate.dimensionAccuracy()
<< "% or better in the range of z=[" << static_cast<int>(std::round(accuracyEstimate.zMin())) << ","
<< static_cast<int>(std::round(accuracyEstimate.zMax()))
<< "] across the full FOV. Accuracy close to where the correction data was collected is likely better."
<< std::endl;
var accuracyEstimate = correction.AccuracyEstimate;
Console.WriteLine("If written to the camera, this correction can be expected to yield a dimension trueness error of "
+ (accuracyEstimate.DimensionAccuracy * 100).ToString("0.00") + "% or better in the range of z=["
+ accuracyEstimate.ZMin.ToString("0.00") + "," + accuracyEstimate.ZMax.ToString("0.00")
+ "] across the full FOV. Accuracy close to where the correction data was collected is likely better.");
accuracy_estimate = correction.accuracy_estimate()
print(
"If written to the camera, this correction can be expected to yield a dimension trueness error of",
f"{accuracy_estimate.dimension_accuracy() * 100:.3f}% or better in the range of z=[{accuracy_estimate.z_min():.3f}, {accuracy_estimate.z_max():.3f}] across the full FOV.",
"Accuracy close to where the correction data was collected is likely better.",
)
이 프로세스를 완료하여 반환되는 정보에는 다음 내용이 포함됩니다.
주요 FOV에 대해 추정된 새 최대 Dimension Trueness 오차입니다.
보정 이미지가 촬영된 거리에 따라 이 오류가 예상되는 범위입니다.
보정 결과에 만족하면 보정 매개변수를 카메라에 적용하도록 선택합니다.
참고
각 캡처 측정에서 얻은 값보다 예상 보정 후 치수 진실도 오차 값이 더 크게 나오는 것은 예상치 못한 일이 아닙니다. 이는 예상 보정 후 지표가 Infield Correction 데이터 세트에 사용된 대부분의 FOV와 거리 범위에 대해 제공되기 때문입니다. 반면, 캡처 측정값은 캘리브레이션 보드가 커버하는 FOV와 보드까지의 거리에서의 캡처에 대해 계산된 로컬 치수 진실도 오차입니다.
마지막으로 카메라에 Infield correction을 적용합니다.
Potential Issues
보드가 카메라에서 너무 멀리 떨어져 있거나 캡처 품질이 좋지 않아 충분한 데이터를 제공할 수 없는 경우 잠재적인 설정 문제에 대해 아래와 같이 알려줍니다.
보드가 X, Y 또는 Z 평면에서 너무 기울어져 있습니다.
모든 특징점을 감지할 수 없습니다.
기준 마커가 표시되지 않습니다.
보드 이미지의 품질이 너무 낮아 충분한 데이터를 제공할 수 없습니다.
Read
읽기 기능을 사용하여 카메라에 마지막 보정이 적용된 시점을 확인하십시오.
if(Zivid::Calibration::hasCameraCorrection(camera))
{
const auto timestamp = Zivid::Calibration::cameraCorrectionTimestamp(camera);
const auto time = std::chrono::system_clock::to_time_t(timestamp);
std::cout << "Timestamp of current camera correction: " << std::put_time(std::gmtime(&time), "%FT%TZ")
<< std::endl;
}
else
{
std::cout << "This camera has no infield correction written to it." << std::endl;
}
if (Zivid.NET.Calibration.Calibrator.HasCameraCorrection(camera))
{
var timestamp = Zivid.NET.Calibration.Calibrator.CameraCorrectionTimestamp(camera);
Console.WriteLine("Timestamp of curent camera correction: " + timestamp.ToString());
}
else
{
Console.WriteLine("This camera has no infield correction written to it.");
}
참고
이 재설정은 현재 보정 내용을 삭제하고 카메라가 공장 출고 시 보정값만 적용하도록 재설정합니다. 최적의 성능을 위해 Infield Correction을 수행하는 것이 좋습니다.
Version History
SDK |
Changes |
|---|---|
2.11.0 |
Python에 대한 지원이 추가되었습니다. |