2D Image Capture Process

획득이 완료되면 2D 캡처 API가 반환됩니다.

소스로 이동

source

const auto frame2D = camera.capture2D(settings);
소스로 이동

source

using (var frame2D = camera.Capture2D(settings))
소스로 이동

source

frame_2d = camera.capture_2d(settings)

Frame2D 객체에서 이미지를 가져오는 메서드는 CPU 메모리에서 2D 이미지를 사용할 수 있게 된 후에 반환됩니다. 이 함수 호출은 처리 및 복사가 완료될 때까지 차단됩니다. 이미지 개체는 CPU 메모리의 이미지 데이터에 대한 핸들을 보유합니다.

recommended hardware 를 사용해서 2D 이미지 처리 시간을 최소화하십시오.

소스로 이동

source

const auto imageSRGB = frame2D.imageRGBA_SRGB();
소스로 이동

source

var imageSRGB = frame2D.ImageRGBA_SRGB();
소스로 이동

source

image_srgb = frame_2d.image_rgba_srgb()

Linear RGB( BGRARGBA ) 및 sRGB( SRGB )와 같이 다양한 색상 공간에서 이미지를 얻을 수 있습니다. 자세한 내용은 2D Color Spaces, Lens Distortion, and Output Formats 을 참조하세요.

참고

In C++ and C#, class Image inherits from Array2D and provides, in addition, a method to save the image in PNG file format.

CPU 메모리에서 이미지를 사용할 수 있으면 머신 비전 애플리케이션에서 활용하거나 디스크에 저장할 수 있습니다.

소스로 이동

source

const auto imageFile = "ImageRGBA_sRGB.png";
std::cout << "Saving 2D color image (sRGB color space) to file: " << imageFile << std::endl;
imageSRGB.save(imageFile);
소스로 이동

source

var imageFile = "ImageRGBA_sRGB.png";
Console.WriteLine($"Saving 2D color image (sRGB color space) to file: {imageFile}");
imageSRGB.Save(imageFile);
소스로 이동

source

image_file = "ImageRGBA_sRGB.png"
print(f"Saving 2D color image (sRGB color space) to file: {image_file}")
image_srgb.save(image_file)

타이밍을 최적화하려면 2D 캡처 API가 반환된 후 장면에서 로봇을 이동하거나 개체를 이동하십시오. 이는 Frame2D 개체에서 이미지를 가져오기 위해 API를 호출하기 전 또는 동시에 발생해야 합니다.

A 2D frame can be saved to a .zdf file and later loaded back into memory. This is primarily useful when diagnostics are enabled, to share the raw frame data with Zivid support for more thorough troubleshooting.

소스로 이동

source

const auto dataFile2D = "Frame2D.zdf";
std::cout << "Saving 2D frame to file: " << dataFile2D << std::endl;
frame2D.save(dataFile2D);
소스로 이동

source

var dataFile2D = "Frame2D.zdf";
Console.WriteLine("Saving 2D frame to file: " + dataFile2D);
frame2D.Save(dataFile2D);
소스로 이동

source

data_file_2d = "Frame2D.zdf"
print(f"Saving 2D frame to file: {data_file_2d}")
frame_2d.save(data_file_2d)

The saved file can be loaded using the Frame2D constructor that takes a file path.

소스로 이동

source

std::cout << "Loading 2D frame from file: " << dataFile2D << std::endl;
const auto loadedFrame2D = Zivid::Frame2D{ dataFile2D };
소스로 이동

source

Console.WriteLine("Loading 2D frame from file: " + dataFile2D);
using (var loadedFrame2D = new Zivid.NET.Frame2D(dataFile2D))
소스로 이동

source

print(f"Loading 2D frame from file: {data_file_2d}")
loaded_frame_2d = zivid.Frame2D(data_file_2d)

The readFrameFileType function returns whether a .zdf file contains a 3D Frame or a Frame2D. This is useful when a file path is given as input and the type is not known in advance.

소스로 이동

source

const auto frameFileType2D = Zivid::readFrameFileType(dataFile2D);
std::cout << "Frame file type: " << (frameFileType2D == Zivid::FrameFileType::frame2D ? "Frame2D" : "Frame")
          << std::endl;
소스로 이동

source

var frameFileType2D = Zivid.NET.FrameFile.ReadFrameFileType(dataFile2D);
Console.WriteLine("Frame file type: " + frameFileType2D);
소스로 이동

source

frame_file_type_2d = zivid.read_frame_file_type(data_file_2d)
print(f"Frame file type: {frame_file_type_2d}")

Version History

SDK

Changes

2.18.0

Added support for saving and loading Frame2D to and from .zdf files, and readFrameFileType to identify the frame type in a file.

2.12.0

Zivid 2+에서는 2D 수집 시간이 최대 50%까지 단축됩니다.

2.11.0

SRGB 색 공간에 대한 지원이 추가되었습니다.

2.9.0

수집이 완료되면 캡처 기능이 반환되고 캡처 속도가 향상됩니다.

2.8.0

Zivid 2의 캡처 속도가 향상되었습니다.