RawBayerToBgraOp
🚧 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.
-
Overview
-
Build, Run, and Validate
-
Core Concepts
-
Operators and Graphs
-
Tensor Data and Memory
-
Interprocess Communication
-
-
Application and Operator Development
- Building an HSDK Application
- Writing a Minimal Operator
- Typed Parameters and Configuration
- Reading, Writing, and Forwarding Data
- Writing Tensor Operators
- Complete Operator Patterns
- Authoring Runtime Behavior
- Runtime Parameter Updates
- Lifecycle Callbacks and Restart Control
- Performance and Debugging
- SDK Source Map
-
Operator Reference
-
Core Operators
-
Holoscan Camera
-
Holoscan RidgeRun
- Overview
- Build and Installation
- ArgusCameraOp
- V4L2SourceOp
- V4L2UserPtrSourceOp
- BgraToPlanarTensorOp
- RawBayerToBgraOp
- RawBayerToYoloTensorOp
- YuyvToBgraOp
- TensorRtInferenceOp
- DrmDisplayOp
- DrmBgraDisplayOp
- X11DisplayOp
- CudaCompositorOp
- DepthColorizerOp
- FakesinkOp
- FrameSkipperOp
- InterprocessSrcOp
- TestPatternOp
-
-
Migration from Holoscan 4.x
-
Examples
-
Core
-
Holoscan Camera
-
Holoscan RidgeRun
-
-
Benchmark and Use Cases
-
Holoscan vs GStreamer
- Overview
-
Capture and Display
-
Capture and Inference
- Compare the workloads
- Implemented Applications
- Framework Selection
- Interprocess
-
RawBayerToBgraOp
RawBayerToBgraOp converts an RG10 Bayer frame into a display-ready CUDA BGRA image. It combines optical-black subtraction, per-frame gray-world white balance, Bayer demosaicing, display gain and gamma encoding in one CUDA processing stage.
Input arguments
| Argument | Default and meaning |
|---|---|
width, height
|
Positive RG10 input dimensions. |
optical_black
|
100; black-level value subtracted after raw decoding.
|
bayer_grid
|
1; RGGB, the pattern used by the IMX274 RG10 path. Values 0–3 select the supported Bayer layouts.
|
cuda_device
|
CUDA device used by the kernels; defaults to 0.
|
raw_shift
|
0; right shift applied before the 10-bit mask.
|
display_gain, gamma
|
Both default to 1.0; display scaling and gamma encoding applied to the output.
|
Ports and data contract
| Port | Memory | Queue | Trigger | Contract |
|---|---|---|---|---|
input
|
CUDA-visible memory, contiguous | SDK default | OnEach
|
U16 rank-3 tensor with shape [height, width, 1]. The valid raw sample is the lower 10-bit value after raw_shift.
|
output
|
CUDA device, runtime pool | N/A | Same activation | New U8 rank-3 tensor with shape [height, width, 4] in BGRA order.
|
Processing behavior
The operator first decodes and clamps the RG10 values after optical-black subtraction. It accumulates red, green and blue channel averages, calculates bounded gray-world gains, then performs local Bayer interpolation. The final kernel applies display gain and gamma and writes BGRA bytes. The output is not resized and retains the input dimensions.
V4L2UserPtrSourceOp -> RawBayerToBgraOp -> X11DisplayOp V4L2UserPtrSourceOp -> RawBayerToBgraOp -> DrmBgraDisplayOp
The operator emits on an input-driven contract and forwards frame metadata. It is the fused Holoscan 5 replacement for the separate historical 4.5 raw-processing, demosaic and gain stages; those application-local names are not registered operators in the current RidgeRun repository.
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 raw_bayer_to_bgra/raw_bayer_to_bgra.hpp and link holoscan::raw_bayer_to_bgra.
Example
The capture source and converter must use the same dimensions and CUDA device. The repository's display applications follow this pattern:
auto camera = graph.op<V4L2UserPtrSourceOp>(
"camera", "/dev/video0", width, height, 60, 0);
auto convert = graph.op<RawBayerToBgraOp>(
"convert", width, height, 100, 1, 0, 0, 1.0F, 1.0F);
graph.add_flow(camera->frame, convert->input);
compile_options.deployment.bind_tensor_output_device(
holoscan::TensorOutputDevicePlacement{
.operator_path = "convert",
.output_port = "output",
.device = holoscan::DeviceId{0}});
The bayer_grid values are 0=BGGR, 1=RGGB, 2=GRBG and 3=GBRG. raw_shift is applied before extracting the ten-bit value. The corrected value is clamped after subtracting optical_black; the display scale uses the remaining range 1023 - optical_black.