Jump to content

TestPatternOp

From RidgeRun Developer Wiki

🚧 Documentation is under development

The Holoscan SDK guide is currently under active development. Some sections may be incomplete or change without notice.

Questions? Contact RidgeRun or email to support@ridgerun.com.

Contents Pin






Preliminary reference
This reference is preliminary. The set of available operators and HSDK applications, along with their APIs and documented behavior, may change in future releases.


TestPatternOp

TestPatternOp generates deterministic CUDA BGRA Tensor frames for graph validation without a camera. It supports color bars and a moving checkerboard pattern.


Graph validation
Contact RidgeRun for custom test sources. We can build validation graphs to check transport and display before your camera is ready.


Input arguments

The constructor takes positive width, height and fps values, plus a TestPatternKind of kColorBars or kCheckerboard. The operator emits one frame per clock period.

Ports and data contract

Port Memory Queue Trigger Contract
output CUDA device, contiguous runtime pool N/A OnClock U8 rank-3 tensor with shape [height, width, 4] in BGRA order. Each sample receives a monotonically increasing frame ID.
TestPatternOp: color bars   -> endpoint A
TestPatternOp: checkerboard -> endpoint B

The color-bar pattern changes its phase as frames advance. The checkerboard changes its cell phase as frames advance, making endpoint changes visible in the receiver window.

Build

Follow Holoscan RidgeRun Build and Installation for the module build and installation. The operator-specific include, target, and runtime requirements are listed below.

Include test_pattern/test_pattern.hpp and link holoscan::test_pattern.

Example

The constructor validates positive dimensions and frame rate, checks for byte-size overflow and converts the rate to a nanosecond clock period. The color-bar kernel creates six phase-shifted bars; its phase changes every 30 frame IDs. The checkerboard uses 48-pixel cells and changes phase every 15 frame IDs. Both patterns write BGRA with an opaque alpha channel.

The output is allocated from the runtime Tensor pool and produced by a 16×16 CUDA launch. The operator emits one frame per clock activation and sets a monotonically increasing frame ID. A missing CUDA stream, failed output loan, empty allocation or kernel-launch error is returned as an operator error.

auto pattern = graph.op<TestPatternOp>(
    "pattern", 1920, 1080, 30, TestPatternKind::kColorBars);
graph.add_flow(pattern->output, display->input);


Test source only
The generated image is synthetic. It validates Tensor transport, endpoint switching and display plumbing, but it does not measure camera capture or ISP behavior.


Source reference
You can find the source code at TestPatternOp.


Related pages


Cookies help us deliver our services. By using our services, you agree to our use of cookies.