117 Returns the HDR algorithm used by this object.
119 The algorithm is defined at construction time and determines how
120 the input images are combined during HDR reconstruction.
122 @return The HDR algorithm identifier.
124 @since ids_peak_icv 1.2
126 algorithm = ctypes.c_int()
127 execute_and_map_return_codes(
128 lib_loader.dll().peak_icv_HDR_GetAlgorithm,
130 ctypes.pointer(algorithm),
137 Estimates the *Camera Response Curve* (CRC) from a set of input images.
139 This method calculates the response characteristics of the camera sensor.
140 The CRC defines the relationship between
141 scene radiance and the measured pixel values.
143 All input images must meet the following conditions:
144 - Represent the same scene.
145 - Be compatible in size and pixel format.
146 - Contain valid metadata for either exposure time or gain,
147 and the values for the chosen parameter must vary across the given images
148 (e.g., `ids_peak_common.datatype.MetadataKey.DeviceExposureTime` or
149 `ids_peak_common.datatype.MetadataKey.DeviceGain`).
151 Performing this estimation step explicitly can significantly reduce the processing
152 time of subsequent calls to ``process()``, as the curve does not need to be
155 If this method is not called, the response curve is estimated automatically
156 during the first call to ``process()``.
158 @supportedPixelformats{HDR}
161 Images of the same scene with different exposure time or gain metadata.
164 @since ids_peak_icv 1.3
166 if not isinstance(images, np.ndarray):
168 "Parameter images has to be a numpy array of ids_peak_icv or ids_peak_ipl images.")
172 _images.append(_check_and_get_icv_image(image))
174 image_handles = create_array(peak_icv_image_handle, len(_images))
175 transform(_images, image_handles,
lambda image: image._handle)
177 execute_and_map_return_codes(
178 lib_loader.dll().peak_icv_HDR_EstimateResponseCurve,
181 ctypes.c_size_t(len(image_handles)),
184 def process(self, images: ImageArray) -> Image:
187 Generates an HDR image from the specified input images.
189 Processes the provided images and combines them into a single HDR image.
191 All input images must meet the following conditions:
192 - Represent the same scene.
193 - Be compatible in size and pixel format.
194 - Contain valid metadata for either exposure time or gain,
195 and the values for the chosen parameter must vary across the given images
196 (e.g., `ids_peak_common.datatype.MetadataKey.DeviceExposureTime` or
197 `ids_peak_common.datatype.MetadataKey.DeviceGain`).
199 If the camera response curve has not been explicitly estimated
200 using ``estimate_response_curve()``,
201 an internal estimation step is performed automatically
202 when it is first called.
203 This may increase the overall processing time for the first call.
205 @supportedPixelformats{HDR}
208 Images of the same scene with different exposure time or gain metadata.
212 The resulting HDR image with pixel format Mono32fIDS resp. RGB32fIDS.
214 @since ids_peak_icv 1.2
216 if not isinstance(images, np.ndarray):
218 "Parameter images has to be a numpy array of ids_peak_icv images.")
222 _images.append(_check_and_get_icv_image(image))
224 image_handles = create_array(peak_icv_image_handle, len(images))
225 transform(images, image_handles,
lambda image: image._handle)
228 output_pixel_format = ctypes.c_uint()
229 execute_and_map_return_codes(
230 lib_loader.dll().peak_icv_HDR_Process_GetOutputPixelFormat,
232 ctypes.c_uint(images[0].pixel_format.value),
233 ctypes.pointer(output_pixel_format),
236 output_image = Image.create_from_pixel_format_and_size(
237 PixelFormat(output_pixel_format.value),
238 Size(images[0].width, images[0].height),
241 execute_and_map_return_codes(
242 lib_loader.dll().peak_icv_HDR_Process,
245 ctypes.c_size_t(len(image_handles)),
246 output_image._handle,