CVBpy 14.0
cvb.foundation Namespace Reference

Common Vision Blox Foundation module for Python. More...

Classes

class  AlignmentConfiguration
 A set of parameters that configures an alignment operation. More...
 
class  AlignmentResult2D
 A set of parameters that stores the result of alignment operation. More...
 
class  AQS12DensePointCloudSegmentor
 Segmentor object to configure face segmentation of AQS12 calibration piece on dense point clouds. More...
 
class  AQS12Piece
 Object to collect all input parameters for the AQS12 calibration piece. More...
 
class  AQS12RangeMapSegmentor
 Segmentor object to configure face segmentation of AQS12 calibration piece on range maps. More...
 
class  Axis
 Axis enumeration. More...
 
class  BayerPattern
 Bayer pattern of the sensor used to acquire the image to be converted. More...
 
class  BlobBorderFilter
 Enumeration for filtering blobs, that touch the boundaries of the AOI specified for blob extraction. More...
 
class  BlobFilter
 Class to build a filter for the blob search. More...
 
class  BlobRangeFilter
 Defines the attribute for a blob filter range. More...
 
class  BlobResult
 Container for a blob analysis result. More...
 
class  CalibrationConfiguration
 Calibration configuration object. More...
 
class  CalibrationPatternContrast
 Definition of the contrast of the pattern used for automatic calibration. More...
 
class  CalibrationPatternFormat
 Definition of the paper format used for printing calibration patterns. More...
 
class  CalibrationPatternOrientation
 Format orientation for the CalibrationPatternFormat. More...
 
class  CalibrationPatternStyle
 Definition of the calibration pattern style used for automatic calibration. More...
 
class  CalibrationPiece
 Defines the calibration piece to use for face segmentation. More...
 
class  ColorTwistMatrix
 Matrix defining color transformations. More...
 
class  CorrelationMethod
 Correlation calculation methods. More...
 
class  DensePointCloudSegmentor
 Base class for segmentor object to configure and compute segmentation on dense point clouds. More...
 
class  DistanceNorm
 Norm for calculating distances. More...
 
class  DynamicThresholdNorm
 Norm calculation approaches for dynamic thresholding. More...
 
class  EdgeDetectionResult
 A set of parameters that stores the result from an edge detection. More...
 
class  EdgeFilter
 Edge filter modes. More...
 
class  EdgeResult
 Edge search result. More...
 
class  EdgeResultPair
 A pair of found edges. More...
 
class  EdgeSearchMode
 Determines the algorithm for finding an edge. More...
 
class  EdgeType
 Type of the edges to be searched. More...
 
class  FilterOrientation
 Orientation options for edge filters. More...
 
class  FixedFilterSize
 Filter size values for filters using a fixed or discrete sized kernel. More...
 
class  GammaCorrection
 Gamma correction. More...
 
class  Histogram
 A single histogram result. More...
 
class  HuMoments
 Results of Hu moment calculation. More...
 
class  ImageMoments
 State object for calculating various image moments. More...
 
class  ImageResolution
 Possible up sampling modes for extracted polarization planes. More...
 
class  Interpolation
 Interpolation modes available inside the Foundation package. More...
 
class  LineScanCalibrationConfiguration
 A set of parameters, which is used to configure line-scan calibration. More...
 
class  LineScanCalibrator
 A set of parameters that stores the result of line-scan calibration. More...
 
class  LutInterpolation
 Different approaches for interpolating between lookup table (LUT) values and levels. More...
 
class  LutLevel
 Combine a LUT (lookup table) level and the value assigned to this level. More...
 
class  MomentsCalculation
 Choose between speed and accuracy during image moment calculation. More...
 
class  MomentsNormalization
 Available normalization modes for moments calculations. More...
 
class  MomentsOrder
 Enumerated order for x and y central or spatial moments. More...
 
class  MorphologyMask
 Available morphology masks. More...
 
class  NonLinearTransformation
 Object implementing the non linear polynomially approximated transform implemented in the CVB Foundation package. More...
 
class  Pattern
 Possible patterns of raw polarization images. More...
 
class  PerspectiveTransformation
 Perspective transformation coefficients. More...
 
class  PixelOverflow
 Defines how arithmetic overflows and underflows are handled. More...
 
class  PreAlignmentMode
 Specifies if the pre-alignment is required. More...
 
class  PreDefinedPixelSizeMode
 Specifies if the predefined pixel resolution is used for the metric calibration. More...
 
class  Projection
 Projection that the Edge analysis of Common Vision Blox is using. More...
 
class  ProjectionMode
 Options affecting the result of the projection. More...
 
class  ProjectionValue
 Single projection value. More...
 
class  PseudoColorMode
 Available colorization modes to visualize polarization. More...
 
class  RangeMapSegmentor
 Base class for segmentor object to configure and compute segmentation on range maps. More...
 
class  RGBConversion
 Available conversion modes from Bayer patterns to RGB images. More...
 
class  RobertsDirection
 Directions of the Roberts edge filter. More...
 
class  ScanDirection
 Specifies the scanning direction. More...
 
class  SegmentationMethod
 Defines the segmentation method for labeling the faces of the calibration piece. More...
 
class  SqrtPixelScaling
 Defines the post processing of the sqrt function. More...
 
class  StartSelectionMode
 Decides which start point should be used for the new curve. More...
 
class  StaticThresholding
 Comparisons for static thresholding. More...
 
class  TestImageDataType
 Data types usable for test image generation. More...
 
class  ValueNormalization
 Available normalization modes for norm calculations. More...
 

Functions

cvb.Image absolute (cvb.Image image)
 Determines the absolute values of the pixels in the input image. More...
 
cvb.Image add_constant (cvb.Image image, Union[float, List[float]] values, int pixel_overflow)
 Add constant offsets to the pixel values of the input image. More...
 
cvb.Image add_gauss_noise (cvb.Image image, float mean, float std_dev, int seed)
 Add noise with Gaussian distribution to an image. More...
 
cvb.Image add_image (cvb.Image image1, cvb.Image image2, int pixel_overflow)
 Add the pixel values of both input images to obtain the output image. More...
 
cvb.Image add_uniform_noise (cvb.Image image, float lowest, float highest, int seed)
 Add noise with uniform distribution to an image. More...
 
cvb.foundation.AlignmentResult2D align_curve (List[cvb.Point2D] curve, List[cvb.Point2D] curve_to_be_aligned, cvb.foundation.AlignmentConfiguration config)
 Aligns two 2D curves via an iterative closest point method considering consensus correspondence for better shape alignment. More...
 
cvb.Image and_constant (cvb.Image image, Union[int, List[int]] values)
 Bit-wise AND operation on the input image with a constant value or values. More...
 
cvb.Image and_image (cvb.Image image1, cvb.Image image2)
 Performs a bit-wise AND operation between the pixels of the two input images. More...
 
cvb.Image apply_8bit_lut (cvb.ImagePlane plane, List[int] values)
 Apply a lookup table to an 8 bit per pixel input image plane. More...
 
cvb.Image apply_interpolated_lut (cvb.ImagePlane plane, List[cvb.foundation.LutLevel] levels, int interpolation)
 Apply a lookup table, that is the result of interpolation between a series of levels and values, to an input image. More...
 
cvb.Image bayer_to_mono (cvb.Image image, int conversion, Optional[int] gamma, Optional[cvb.WhiteBalanceFactors] white_balance)
 Convert a monochrome image with a Bayer pattern to a proper monochrome image. More...
 
cvb.Image bayer_to_rgb (cvb.Image image, int pattern, int conversion, Optional[int] gamma, Optional[cvb.WhiteBalanceFactors] white_balance)
 Convert a Bayer-pattern image to an RGB image. More...
 
None bayer_to_rgb_to_dst (cvb.Image image_src, cvb.Image image_dst, int pattern, int conversion, Optional[int] gamma, Optional[cvb.WhiteBalanceFactors] white_balance)
 Convert a Bayer-pattern image to an RGB image. More...
 
List[cvb.foundation.BlobResultbinarize_and_search_blobs (cvb.ImagePlane plane, cvb.NumberRange binarization_threshold, Optional[cvb.Rect] aoi, Optional[int] filter)
 Searches for all blobs in the given image plane. More...
 
cvb.Image box_max (cvb.Image image, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 This function sets each pixel in the output image to the maximum value of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters. More...
 
cvb.Image box_mean (cvb.Image image, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 This function sets each pixel in the output image to the average of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters. More...
 
cvb.Image box_median (cvb.Image image, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 This function sets each pixel in the output image to the median value of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters. More...
 
cvb.Image box_min (cvb.Image image, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 This function sets each pixel in the output image to the minimum value of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters. More...
 
cvb.AffineMatrix3D calculate_affine_transformation (List[cvb.Point3D] reference_points, List[cvb.Point3D] measured_points)
 Calculates affine transformation. More...
 
Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] calculate_correction_of_laser_plane_inclination_from_aqs12_piece (cvb.DensePointCloud cloud, cvb.foundation.AQS12DensePointCloudSegmentor segmentor, cvb.foundation.CalibrationConfiguration config, Optional[cvb.Rect] aoi)
 Calculates the correction of the laser plane inclination (affine transformation) from the given dense point cloud of an AQS12 calibration piece. More...
 
float calculate_enclosed_area (List[cvb.Point2D] curve)
 Calculates the enclosed area of the given curve. More...
 
cvb.Image calculate_min_reflection_image (cvb.Image polarization_image)
 From an extracted polarization_image the minimum reflection image is calculated and returned. More...
 
cvb.Matrix2D calculate_quadratic_differences_to_closest_point (List[cvb.Point2D] curve, List[cvb.Point2D] points)
 Calculates the quadratic distance of the points to the closest point of the given curve. More...
 
cvb.AffineMatrix3D calculate_rigid_body_transformation (List[cvb.Point3D] reference_points, List[cvb.Point3D] measured_points)
 Calculates rigid body transformation. More...
 
Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] calculate_rigid_body_transformation_from_aqs12_piece (cvb.DensePointCloud cloud, cvb.foundation.AQS12DensePointCloudSegmentor segmentor, cvb.foundation.AQS12Piece aqs12, Optional[cvb.Rect] aoi)
 Calculates the correction of the laser plane inclination (affine transformation) from the given dense point cloud of an AQS12 calibration piece. More...
 
List[float] calculate_signed_differences (List[cvb.Point2D] curve, List[cvb.Point2D] points)
 Calculates signed differences along the y axis of given points to curve. More...
 
cvb.Image calculate_stokes_0 (cvb.Image polarization_image)
 From an extracted polarization_image a new image is returned with the Stokes 0 as content. More...
 
cvb.Image calculate_stokes_1 (cvb.Image polarization_image)
 From an extracted polarization_image a new image is returned with the Stokes 1 as content. More...
 
cvb.Image calculate_stokes_2 (cvb.Image polarization_image)
 From an extracted polarization_image a new image is returned with the Stokes 2 as content. More...
 
cvb.Image calculate_stokes_image (cvb.Image polarization_image)
 From an extracted polarization_image a new image is returned with the Stokes 0 to 2 as planes. More...
 
Tuple[cvb.Point2D, cvb.Point2Dcalculate_two_points_for_calibration_of_movement (cvb.ImagePlane image_plane, cvb.Area2D aoi, int contrast, int min_contrast, cvb.NumberRange point_size_range, int scan_direction)
 Extracts two points which can be used for the calibration of the movement of line-scan cameras. More...
 
cvb.Image canny (cvb.ImagePlane image_plane, int edge_filter, int lower_threshold, int upper_threshold)
 Edge filter using the Canny algorithm. More...
 
cvb.Circle circle_regression (List[cvb.Point2D] points)
 Create a circle, that fits best into a collection of points. More...
 
cvb.Image close (cvb.Image image, int mask_type, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 Perform a close operation with a selectable filter mask. More...
 
cvb.Image close_custom (cvb.Image image, cvb.Image mask, Optional[cvb.Point2D] mask_offset)
 Perform a close operation with a custom filter mask. More...
 
cvb.Image color_median (cvb.Image image, int mask_type)
 Apply a color-correct box median filter to an RGB image. More...
 
cvb.Image colorize_stokes_image (cvb.Image stokes_image, int color_mode)
 An extracted stokes_image is colorized in a chosen way to visualize the polarization. More...
 
cvb.Image convert_to_16bpp_signed (cvb.Image image)
 Convert the input image to an image with 16 bits per pixel signed data. More...
 
cvb.Image convert_to_16bpp_unsigned (cvb.Image image)
 Convert the input image to an image with 16 bits per pixel unsigned data. More...
 
cvb.Image convert_to_32bpp_float (cvb.Image image)
 Convert the input image to an image with 32 bits per pixel float data. More...
 
cvb.Image convert_to_32bpp_signed (cvb.Image image)
 Convert the input image to an image with 32 bits per pixel signed data. More...
 
cvb.Image convert_to_8bpp_unsigned (cvb.Image image)
 Convert the input image to an image with 8 bits per pixel unsigned data. More...
 
cvb.Image convert_to_cie_lab16 (cvb.Image image)
 Convert the input image to CIE Lab with cvb.DataType.int16_bpp_unsigned() for better precision. More...
 
cvb.Image convert_to_cie_lab8 (cvb.Image image)
 Convert the input image to CIE Lab with cvb.DataType.int8_bpp_unsigned(). More...
 
cvb.Image convert_to_cie_luv (cvb.Image image)
 Convert the input image to CIE LUV. More...
 
cvb.Image convert_to_cie_xyz (cvb.Image image)
 Convert the input image to CIE XYZ. More...
 
cvb.Image convert_to_hls (cvb.Image image)
 Convert the input image to HLS. More...
 
cvb.Image convert_to_hsv (cvb.Image image)
 Convert the input image to HSV. More...
 
cvb.Image convert_to_mono (cvb.Image image, Optional[float] weight_r, Optional[float] weight_g, Optional[float] weight_b)
 Convert the input image to mono. More...
 
cvb.Image convert_to_planes (cvb.Image rawImage, int pattern, int resolution)
 Extracts the four polarization angles from a raw image to a four plane image. More...
 
cvb.Image convert_to_rgb (cvb.Image image, int guess_to_color_model=cvb.ColorModel.RGB)
 Convert the input image to RGB. More...
 
cvb.Image convert_to_ycbcr (cvb.Image image)
 Convert the input image to YCbCr. More...
 
cvb.Image convert_to_ycc (cvb.Image image)
 Convert the input image to YCC. More...
 
cvb.Image convert_to_yuv (cvb.Image image)
 Convert the input image to YUV. More...
 
cvb.Image correlate (cvb.ImagePlane image_plane, cvb.ImagePlane template_plane, Optional[cvb.Rect] aoi, Optional[int] method)
 Calculate the correlation between a plane and a template using a selectable calculation method. More...
 
cvb.Image create_calibration_pattern (int style, int contrast, int width, int height, int num_columns, int num_rows)
 Create a user-definable calibration pattern. More...
 
Tuple[cvb.LaserPlaneHomographyCalibrator3D, List[cvb.Point3D]] create_calibrator_from_aqs12_piece (cvb.ImagePlane image_plane, cvb.foundation.AQS12RangeMapSegmentor segmentor, cvb.foundation.CalibrationConfiguration config, Optional[cvb.Rect] aoi)
 Calculates intrinsic calibration parameters from the given range map image of an AQS12 calibration piece and creates a new calibration object. More...
 
cvb.Image create_destination_image (cvb.Size2D size, int mode)
 Create a destination image for Bayer to RGB conversions. More...
 
List[cvb.foundation.Histogramcreate_image_histograms (cvb.Image image, Optional[Union[cvb.Area2D, cvb.Rect]] aoi, float density=1.0)
 Creates a histogram for each plane of the aoi in the given image. More...
 
cvb.Image create_jaehne_image (cvb.Size2D size, int num_planes, int data_type)
 Create a filter test image as suggested by Professor Jaehne, suitable for investigating the isotropy characteristics of a filter. More...
 
cvb.foundation.LineScanCalibrator create_line_scan_calibration (cvb.Point2D calibration_point_1, cvb.Point2D calibration_point_2, float reference_distance_calibration_points, cvb.foundation.EdgeDetectionResult edge_detection_result, float reference_width_stripes, cvb.foundation.LineScanCalibrationConfiguration configuration)
 Calibrates line-scan cameras. More...
 
cvb.foundation.Histogram create_plane_histogram (cvb.ImagePlane plane, Optional[Union[cvb.Area2D, cvb.Rect]] aoi, float density=1.0)
 Creates a histogram for the aoi in the given plane. More...
 
cvb.Image create_printable_calibration_pattern (int style, int contrast, int paper_size, int orientation, int num_columns, int num_rows, float horizontal_border, float vertical_border, int dpi)
 Create a user-definable calibration pattern suitable for printing on a sheet of paper. More...
 
cvb.Image create_ramp_image (cvb.Size2D size, int num_planes, int data_type, int axis, float offset=0.0, float slope=1.0)
 Create a gray ramp test image. More...
 
cvb.foundation.EdgeDetectionResult detect_edges_of_stripe_target (cvb.Image image_stripes, cvb.Area2D aoi, int num_stripes, int scan_direction, float threshold)
 This function detects edges from a calibration pattern with alternating black and white stripes. More...
 
cvb.Image dilate (cvb.Image image, int mask_type, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 Perform a dilation operation with a selectable filter mask. More...
 
cvb.Image dilate_custom (cvb.Image image, cvb.Image mask, Optional[cvb.Point2D] mask_offset)
 The custom filter mask effective is a CVB image of up to 256x256 pixels where irrelevant pixels have been set to black and pixels that are part of the filter mask have been set to white (255). More...
 
cvb.Image distance_transform (cvb.ImagePlane plane, int mask_size, int norm)
 This function calculates (and writes into the output image) the distance to the closest pixel in the source image with the value zero for all nonzero pixels in the input image. More...
 
cvb.Image divide_constant (cvb.Image image, Union[float, List[float]] values)
 Divide pixel values from the input image by constant values. More...
 
cvb.Image divide_image (cvb.Image image1, cvb.Image image2, int upshift)
 Divide the pixel values of image1 by the pixel values of image 2 to obtain the output image and shift them up by upshift bits to preserve information. More...
 
cvb.Image downshift (cvb.Image image, Union[int, List[int]] values)
 Bit-wise shift the input image with a constant value or values. More...
 
cvb.Image dynamic_threshold (cvb.Image image, int window_size, int threshold, int norm=cvb.foundation.DynamicThresholdNorm.Mean)
 This function performs dynamic thresholding on the input image. More...
 
cvb.Ellipse ellipse_regression (List[cvb.Point2D] points)
 Create an ellipse, that fits best into a collection of points. More...
 
cvb.Image erode (cvb.Image image, int mask_type, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 Perform an erosion operation with a selectable filter mask. More...
 
cvb.Image erode_custom (cvb.Image image, cvb.Image mask, Optional[cvb.Point2D] mask_offset)
 Perform an erosion operation with a custom filter mask. More...
 
Tuple[List[cvb.Point2D], List[cvb.Point2D]] extract_calibration_lists (cvb.ImagePlane plane, int style, int contrast, int grid_spacing, int min_contrast, float max_ratio, Optional[cvb.Area2D] aoi)
 Automatically extracts the pixel lists required for creating a NonLinearTransformation object. More...
 
List[float] filter_histogram (List[Union[int, float]] histogram, List[Union[int, float]] kernel)
 Filter a histogram array with the given kernel. More...
 
List[cvb.foundation.EdgeResultfind_all_edges (cvb.ImagePlane plane, int mode, int type, float threshold, Optional[cvb.Area2D] aoi, float density=1.0)
 Find all edges inside the aoi. More...
 
Optional[cvb.foundation.EdgeResultfind_best_edge (cvb.ImagePlane plane, int type, Optional[cvb.Area2D] aoi, float density=1.0)
 Use the 2nd derivative method to find the edge with the highest intensity in the area of interest. More...
 
Optional[cvb.foundation.EdgeResultfind_first_edge (cvb.ImagePlane plane, int mode, int type, float threshold, Optional[cvb.Area2D] aoi, float density=1.0)
 Find the first edge (as specified) in the aoi. More...
 
List[int] find_histogram_peaks (List[int] histogram, int blur_size, int min_diff)
 Find peaks in the histogram identified by the supplied criteria. More...
 
List[cvb.LocalMaximumfind_matches (cvb.ImagePlane image_plane, cvb.ImagePlane template_plane, float threshold, int locality, Optional[cvb.Rect] aoi, Optional[int] sub_pix_mode, Optional[int] sub_pix_radius)
 Use the correlation coefficient calculation method to find locations in the input image plane that match the given template. More...
 
cvb.Image gauss (cvb.Image image, int size)
 This function applies a low high pass Gaussian filter to an image. More...
 
cvb.Image gaussian_pyramid_down (cvb.Image image)
 This function down samples an image in the sense of a Gaussian pyramid. More...
 
cvb.Image gaussian_pyramid_up (cvb.Image image)
 This function up samples an image in the sense of a Gaussian pyramid. More...
 
cvb.WhiteBalanceFactors get_white_balance (cvb.Image image, int pattern, Optional[cvb.Area2D] aoi)
 Determine a suitable white balance from a monochrome image with a Bayer pattern. More...
 
cvb.Image high_pass (cvb.Image image, int size)
 This function applies a square high pass filter to an image. More...
 
None init_aoi (cvb.Image image, cvb.Rect aoi, Union[float, List[float]] values)
 Initialize the planes of AOI (area of interest) in this image. More...
 
None init_image (cvb.Image image, Union[float, List[float]] values)
 Initialize the planes of this image. More...
 
List[cvb.Point2Dintersect_with_line (List[cvb.Point2D] curve, cvb.Line2D line)
 Intersects a 2D curve with a line. More...
 
cvb.Image laplace (cvb.Image image, int size)
 This function applies a square high pass Laplace filter to an image. More...
 
cvb.Line2D line_regression (List[cvb.Point2D] points)
 Create a line, that fits best into a collection of points. More...
 
Tuple[cvb.Image, cvb.Image, cvb.Image, cvb.Image, cvb.Image, cvb.Imagelocal_eigen_values_and_vectors (int derivator_size, int blur_size)
 Calculate the local eigenvalues and eigenvectors of the Hesse matrix applied to the pixels of the input image. More...
 
cvb.Image local_min_eigen_values (cvb.ImagePlane plane, int derivator_size, int blur_size)
 Calculate the minimum local eigenvalues of the Hesse matrix applied to the pixels of the input image. More...
 
cvb.Image low_pass (cvb.Image image, int size)
 This function applies a square low pass filter to an image. More...
 
cvb.Image matrix_transform (cvb.Image image, cvb.Matrix2D matrix, int interpolation=cvb.foundation.Interpolation.Linear)
 Use a matrix to transform an image. More...
 
List[cvb.Point2Dmerge_two_curves (List[cvb.Point2D] curve_lhs, List[cvb.Point2D] curve_rhs, int mode)
 Merges two curves into one curve with interpolation. More...
 
cvb.Image mirror (cvb.Image image, int axis)
 Mirror the input image. More...
 
cvb.Image multiply_constant (cvb.Image image, Union[float, List[float]] values, int pixel_overflow)
 Multiply constant values to the pixel values of the input image. More...
 
cvb.Image multiply_image (cvb.Image image1, cvb.Image image2, int pixel_overflow)
 Multiply the pixel values of both input images to obtain the output image. More...
 
cvb.Image negate (cvb.Image image)
 Performs a bit-wise NOT operation on the pixels of the input image to create the output image. More...
 
float norm_l1 (cvb.ImagePlane plane, int normalize, Optional[cvb.Rect] aoi)
 Calculate and return the L1 norm (sum of absolute values) over all the pixels inside the plane. More...
 
float norm_l2 (cvb.ImagePlane plane, int normalize, Optional[cvb.Rect] aoi)
 Calculate and return the L2 norm (euclidean norm) over the pixels inside the plane. More...
 
float norm_linf (cvb.ImagePlane plane, int normalize, Optional[cvb.Rect] aoi)
 Calculate and return the L infinity norm (maximum norm) over the pixels inside the plane. More...
 
cvb.Image open (cvb.Image image, int mask_type, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset)
 Perform an open operation with a selectable filter mask. More...
 
cvb.Image open_custom (cvb.Image image, cvb.Image mask, Optional[cvb.Point2D] mask_offset)
 Perform an open operation with a custom filter mask. More...
 
cvb.Image or_constant (cvb.Image image, Union[int, List[int]] values)
 Bit-wise OR operation on the input image with a constant value or values. More...
 
cvb.Image or_image (cvb.Image image1, cvb.Image image2)
 Performs a bit-wise OR operation between the pixels of the two input images. More...
 
cvb.Image perspective (cvb.Image image, cvb.foundation.PerspectiveTransformation coeffs, cvb.Size2D target_size, int interpolation=cvb.foundation.Interpolation.Linear)
 Apply the perspective transformation coefficients to the image. More...
 
cvb.Image prewitt (cvb.Image image, int orientation)
 Applies a Prewitt edge filter to the input image. More...
 
cvb.Image range_threshold (cvb.ImagePlane plane, cvb.NumberRange range, Optional[cvb.Rect] aoi)
 A range based binarization algorithm to the given input. More...
 
None range_threshold_to_dst (cvb.ImagePlane plane, cvb.NumberRange range, cvb.Image image_dst, Optional[cvb.Rect] aoi)
 A range based binarization algorithm to the given input. More...
 
List[cvb.Point2Dresample_curve (List[cvb.Point2D] curve, int resampled_curve_length)
 Resamples a 2-dimensional curve via linear interpolation assuming that the "speed" of the time mapping is constant. More...
 
cvb.Image resize (cvb.Image image, cvb.Size2D target_size, int interpolation=cvb.foundation.Interpolation.Linear)
 Resize the input image. More...
 
cvb.Image rgb_to_bayer (cvb.Image image, int pattern)
 Convert an RGB image to a monochrome image with Bayer pattern. More...
 
cvb.Image roberts (cvb.Image image, int direction)
 Apply a Roberts edge detector to the input image. More...
 
cvb.Image rotate (cvb.Image image, cvb.Angle angle, int interpolation=cvb.foundation.Interpolation.Linear)
 Rotate the input image by the given angle. More...
 
cvb.Image scale_to_16bpp_signed (cvb.Image image)
 Convert the input image to an image with 16 bits per pixel signed data. More...
 
cvb.Image scale_to_16bpp_unsigned (cvb.Image image)
 Convert the input image to an image with 16 bits per pixel unsigned data. More...
 
cvb.Image scale_to_32bpp_float (cvb.Image image, float min_val, float max_val)
 Convert the input image to an image with 32 bits per pixel float data. More...
 
cvb.Image scale_to_32bpp_signed (cvb.Image image)
 Convert the input image to an image with 32 bits per pixel signed data. More...
 
cvb.Image scale_to_8bpp_unsigned (cvb.Image image)
 Convert the input image to an image with 8 bits per pixel unsigned data. More...
 
cvb.Image scharr (cvb.Image image, int orientation)
 Applies a Scharr edge filter to the input image. More...
 
List[cvb.foundation.BlobResultsearch_blobs (cvb.Image binarized_image, Optional[cvb.Rect] aoi, Optional[cvb.foundation.BlobFilter] filter)
 Searches for all blobs in the given binarized image. More...
 
cvb.Image sharpen (cvb.Image image)
 This function applies a FixedFilterSize.Kernel3x3 sharpen filter to an image. More...
 
cvb.Image shear (cvb.Image image, float shear_x, float shear_y, int interpolation=cvb.foundation.Interpolation.Linear)
 Shear the input image. More...
 
cvb.Image sobel (cvb.Image image, int orientation, int mask_size)
 Applies a Sobel edge filter to the input image. More...
 
cvb.Image sobel_2nd (cvb.Image image, int orientation, int mask_size)
 Applies a 2nd order Sobel edge filter to the input image. More...
 
cvb.Image sobel_2nd_cross (cvb.Image image, int mask_size)
 Applies a 2nd order Sobel cross edge filter to the input image. More...
 
cvb.Image sqrt (cvb.Image image, int scaling)
 Calculates the square roots of pixel values of a source image and writes them into the destination image. More...
 
cvb.Image square (cvb.Image image, int pixel_overflow)
 Squares the pixel values of the input image to obtain the output image. More...
 
cvb.Image static_constant_threshold (cvb.Image image, Union[float, List[float]] values, int comparison)
 Create an output image, that is the result of static thresholding. More...
 
cvb.Image static_image_threshold (cvb.Image image, cvb.Image thresholds, int comparison)
 This function performs thresholding of an input image with pixel-by-pixel thresholds stored in the pixels of a thresholds image. More...
 
cvb.Image static_transparent_threshold (cvb.Image image, Union[float, List[float]] thresholds, int comparison, Optional[Union[float, List[float]]] values)
 Create a thresholded image using a transparency approach. More...
 
cvb.Image sub_image (cvb.Image image, cvb.Area2D aoi, int interpolation)
 Extract the content of an AOI (area of interest) into a new image. More...
 
cvb.Image subtract_constant (cvb.Image image, Union[float, List[float]] values)
 Subtract constant offsets from the pixel values of the input image. More...
 
cvb.Image subtract_constant_abs (cvb.Image image, Union[float, List[float]] values)
 Subtract constant offsets from the pixel values of the input image. More...
 
cvb.Image subtract_image (cvb.Image image1, cvb.Image image2)
 Subtract the pixel values of image 2 from image 1 to obtain the output image. More...
 
cvb.Image subtract_image_abs (cvb.Image image1, cvb.Image image2)
 Subtract the pixel values of image 2 from image 1 to obtain the output image. More...
 
int sum_histogram_between (List[int] histogram, int lower_limit, int upper_limit)
 Count the number of pixels that lie between two limits in the histogram. More...
 
cvb.Image swap_channels (cvb.Image image, List[int] new_arrangement)
 Create a new image by rearranging the planes of the input image. More...
 
cvb.Image twist_colors (cvb.Image image, cvb.foundation.ColorTwistMatrix matrix)
 Apply the color twist matrix to the input image. More...
 
cvb.Image upshift (cvb.Image image, Union[int, List[int]] values)
 Bit-wise shift the input image with a constant value or values. More...
 
float wang_quality (cvb.ImagePlane plane1, cvb.ImagePlane plane2)
 Calculate the Wang quality for two images. More...
 
cvb.Image wiener (cvb.Image image, cvb.Size2D mask_size, Optional[cvb.Point2D] mask_offset, Optional[float] noise_threshold)
 This function performs adaptive filtering of an image degraded by constant power additive noise. More...
 
None write_projection (cvb.ImagePlane plane, cvb.Area2D aoi, float density=1.0)
 Write the projection that Edge is using internally as the basis for its calculations into an image plane (might be useful for debugging). More...
 
cvb.Image xor_constant (cvb.Image image, Union[int, List[int]] values)
 Bit-wise XOR operation on the input image with a constant value or values. More...
 
cvb.Image xor_image (cvb.Image image1, cvb.Image image2)
 Performs a bit-wise XOR operation between the pixels of the two input images. More...
 

Detailed Description

Common Vision Blox Foundation module for Python.

Function Documentation

◆ absolute()

cvb.Image absolute ( cvb.Image  image)

Determines the absolute values of the pixels in the input image.

Of course calling this function on an image with unsigned pixels will have no effect.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image The result image.

◆ add_constant()

cvb.Image add_constant ( cvb.Image  image,
Union[float, List[float]]  values,
int  pixel_overflow 
)

Add constant offsets to the pixel values of the input image.

If the parameter overflow is set to PixelOverflow.Scale, the resulting pixel values are divided to fit the dynamic range of the image (truncated otherwise).

Parameters

image : cvb.Image Input image.

values : Union[float, List[float]] Values to be added (list with one value per plane in image or single value to be added to each plane).

pixel_overflow : int Defines how arithmetic overflow is handled (see cvb.foundation.PixelOverflow).

Returns

cvb.Image The result image.

◆ add_gauss_noise()

cvb.Image add_gauss_noise ( cvb.Image  image,
float  mean,
float  std_dev,
int  seed 
)

Add noise with Gaussian distribution to an image.

Pixel values that exceed the image's value range are saturated at the minimum and maximum value.

Parameters

image : cvb.Image Image to add the noise to.

mean : float Mean value of the gaussian distribution.

std_dev : float Standard deviation of the gaussian distribution.

seed : int Seed value for the pseudo random number generator.

Returns

cvb.Image Result image with added noise.

◆ add_image()

cvb.Image add_image ( cvb.Image  image1,
cvb.Image  image2,
int  pixel_overflow 
)

Add the pixel values of both input images to obtain the output image.

If the parameter overflow is set to PixelOverflow.Scale, the resulting pixel values are divided to fit the dynamic range of the image (truncated otherwise). If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

pixel_overflow : int Defines how arithmetic overflow is handled (see cvb.foundation.PixelOverflow).

Returns

cvb.Image The result image.

◆ add_uniform_noise()

cvb.Image add_uniform_noise ( cvb.Image  image,
float  lowest,
float  highest,
int  seed 
)

Add noise with uniform distribution to an image.

Pixel values that exceed the image's value range are saturated at the minimum and maximum value.

Parameters

image : cvb.Image Image to add the noise to.

lowest : float Lower bound of the uniform distribution.

highest : float Upper bound of the uniform distribution.

seed : int Seed value for the pseudo random number generator.

Returns

cvb.Image Result image with added noise.

◆ align_curve()

cvb.foundation.AlignmentResult2D align_curve ( List[cvb.Point2D curve,
List[cvb.Point2D curve_to_be_aligned,
cvb.foundation.AlignmentConfiguration  config 
)

Aligns two 2D curves via an iterative closest point method considering consensus correspondence for better shape alignment.

The method used here is a version of the ICP (iterative closest point) method. It uses a consensus metric to find the correspondence between points to stabilize the iterations needed in the alignment method. It supports only rigid transformations for the alignment.

If not enough points within a given consens are found a classical ICP step is performed by finding correspondences solely based on nearest neighbours without any feasibility check.

Parameters

curve : List[cvb.Point2D] Reference curve.

curve_to_be_aligned : List[cvb.Point2D] Curve to be aligned to the reference curve.

config : cvb.foundation.AlignmentConfiguration Configuration of alignment.

Returns

cvb.foundation.AlignmentResult2D Alignment result.

◆ and_constant()

cvb.Image and_constant ( cvb.Image  image,
Union[int, List[int]]  values 
)

Bit-wise AND operation on the input image with a constant value or values.

Parameters

image : cvb.Image Input image.

values : Union[int, List[int]] Values to be AND'ed (list with one value per plane in image or single value to be AND'ed to each plane).

Returns

cvb.Image The result image.

◆ and_image()

cvb.Image and_image ( cvb.Image  image1,
cvb.Image  image2 
)

Performs a bit-wise AND operation between the pixels of the two input images.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

Returns

cvb.Image The result image.

◆ apply_8bit_lut()

cvb.Image apply_8bit_lut ( cvb.ImagePlane  plane,
List[int]  values 
)

Apply a lookup table to an 8 bit per pixel input image plane.

Parameters

plane : cvb.ImagePlane Plane to which the lookup table is to be applied.

values : List[int] The lookup table as a list of integers (must have at least 256 entries). Exceed is ignored.

Returns

cvb.Image The result image.

◆ apply_interpolated_lut()

cvb.Image apply_interpolated_lut ( cvb.ImagePlane  plane,
List[cvb.foundation.LutLevel levels,
int  interpolation 
)

Apply a lookup table, that is the result of interpolation between a series of levels and values, to an input image.

Parameters

plane : cvb.ImagePlane Plane to which the lookup table is to be applied.

levels : List[cvb.foundation.LutLevel] Levels defining the lookup table as a range of LUT levels.

interpolation : int Interpolation mode between the levels (see cvb.foundation.LutInterpolation).

Returns

cvb.Image The result image.

◆ bayer_to_mono()

cvb.Image bayer_to_mono ( cvb.Image  image,
int  conversion,
Optional[int]  gamma,
Optional[cvb.WhiteBalanceFactors white_balance 
)

Convert a monochrome image with a Bayer pattern to a proper monochrome image.

Parameters

image : cvb.Image Monochrome image with the Bayer pattern to be converted.

conversion : int Conversion method (see cvb.foundation.RGBConversion).

gamma : Optional[int] Gamma correction (default cvb.foundation.GammaCorrection.Gamma100).

white_balance : Optional[cvb.WhiteBalanceFactors] White balance factors (default identity).

Returns

cvb.Image Newly created image that contains the conversion result.

◆ bayer_to_rgb()

cvb.Image bayer_to_rgb ( cvb.Image  image,
int  pattern,
int  conversion,
Optional[int]  gamma,
Optional[cvb.WhiteBalanceFactors white_balance 
)

Convert a Bayer-pattern image to an RGB image.

Parameters

image : cvb.Image Monochrome image with the Bayer pattern to be converted.

pattern : int Pattern in the top left corner of the sensor with which image was acquired (see cvb.foundation.BayerPattern).

conversion : int Conversion method (see cvb.foundation.RGBConversion).

gamma : Optional[int] Gamma correction (default cvb.foundation.GammaCorrection.Gamma100).

white_balance : Optional[cvb.WhiteBalanceFactors] White balance factors (default identity).

Returns

cvb.Image Newly created image that contains the conversion result.

◆ bayer_to_rgb_to_dst()

None bayer_to_rgb_to_dst ( cvb.Image  image_src,
cvb.Image  image_dst,
int  pattern,
int  conversion,
Optional[int]  gamma,
Optional[cvb.WhiteBalanceFactors white_balance 
)

Convert a Bayer-pattern image to an RGB image.

Parameters

image_src : cvb.Image Monochrome image with the Bayer pattern to be converted.

image_dst : cvb.Image Destination to receive the conversion results (preferably created by create_destination_image()).

pattern : int Pattern in the top left corner of the sensor with which image_dst was acquired (see cvb.foundation.BayerPattern).

conversion : int Conversion method (see cvb.foundation.RGBConversion).

gamma : Optional[int] Gamma correction (default cvb.foundation.GammaCorrection.Gamma100).

white_balance : Optional[cvb.WhiteBalanceFactors] White balance factors (default identity).

◆ binarize_and_search_blobs()

List[cvb.foundation.BlobResult] binarize_and_search_blobs ( cvb.ImagePlane  plane,
cvb.NumberRange  binarization_threshold,
Optional[cvb.Rect aoi,
Optional[int]  filter 
)

Searches for all blobs in the given image plane.

Parameters

plane : cvb.ImagePlane Image plane to process.

binarization_threshold : cvb.NumberRange Minimum and maximum gray values (inclusive) to be considered as an object.

aoi : Optional[cvb.Rect] Region in which blobs are to be searched (default the entire plane).

filter : Optional[int] Filter which blobs are to be returned (default no filter).

Returns

List[cvb.foundation.BlobResult] Unordered blob results.

◆ box_max()

cvb.Image box_max ( cvb.Image  image,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

This function sets each pixel in the output image to the maximum value of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters.

This has the effect of smoothing or blurring the input image.

Parameters

image : cvb.Image Image to be filtered.

mask_size : cvb.Size2D Filter mask to be used.

mask_offset : Optional[cvb.Point2D] Mask center pixel location. If missing, the mask offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ box_mean()

cvb.Image box_mean ( cvb.Image  image,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

This function sets each pixel in the output image to the average of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters.

This has the effect of smoothing or blurring the input image.

Parameters

image : cvb.Image Image to be filtered.

mask_size : cvb.Size2D Filter mask to be used.

mask_offset : Optional[cvb.Point2D] Mask center pixel location. If missing, the mask offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ box_median()

cvb.Image box_median ( cvb.Image  image,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

This function sets each pixel in the output image to the median value of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters.

This has the effect of smoothing or blurring the input image.

Parameters

image : cvb.Image Image to be filtered.

mask_size : cvb.Size2D Filter mask to be used.

mask_offset : Optional[cvb.Point2D] Mask center pixel location. If missing, the mask offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ box_min()

cvb.Image box_min ( cvb.Image  image,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

This function sets each pixel in the output image to the minimum value of all the input image pixels in the rectangular neighborhood defined by the mask_size and the mask_offset parameters.

This has the effect of smoothing or blurring the input image.

Parameters

image : cvb.Image Image to be filtered.

mask_size : cvb.Size2D Filter mask to be used.

mask_offset : Optional[cvb.Point2D] Mask center pixel location. If missing, the mask offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ calculate_affine_transformation()

cvb.AffineMatrix3D calculate_affine_transformation ( List[cvb.Point3D reference_points,
List[cvb.Point3D measured_points 
)

Calculates affine transformation.

Parameters

reference_points : List[cvb.Point3D] List with reference points.

measured_points : List[cvb.Point3D] List with corresponding measured points. Note, that these points have to represent the same body as the reference points.

Returns

cvb.AffineMatrix3D Affine transformation.

◆ calculate_correction_of_laser_plane_inclination_from_aqs12_piece()

Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] calculate_correction_of_laser_plane_inclination_from_aqs12_piece ( cvb.DensePointCloud  cloud,
cvb.foundation.AQS12DensePointCloudSegmentor  segmentor,
cvb.foundation.CalibrationConfiguration  config,
Optional[cvb.Rect aoi 
)

Calculates the correction of the laser plane inclination (affine transformation) from the given dense point cloud of an AQS12 calibration piece.

Parameters

cloud : cvb.DensePointCloud Dense point cloud.

segmentor : cvb.foundation.AQS12DensePointCloudSegmentor AQS12 segmentor object for dense point clouds.

config : cvb.foundation.CalibrationConfiguration Calibration configuration object.

aoi : Optional[cvb.Rect] Area of interest (default entire plane).

Returns

Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] The calibration result (a tuple of affine transformation and array with residuals).

◆ calculate_enclosed_area()

float calculate_enclosed_area ( List[cvb.Point2D curve)

Calculates the enclosed area of the given curve.

Uses the shoelace algorithm to calculate the enclosed area of the given curve. All points are assumed to be in order, clock - wise or anti clock - wise will not affect the outcome. This algorithm can only handle not self intersecting curves, e.g. a figure eight curve will not work with this algorithm.

For numerical stabilization all points are shifted to be centered around the origin.

If the curve is not closed, i.e. the first and last point in the given point set don't match, the curve is closed automatically by connecting the first and last point.

Note

The points on the curve are evaluated in the order in which they are listed. We assume a ordered point set (not ordered by axis, but ordered according to the curve).

Parameters

curve : List[cvb.Point2D] Curve.

Returns

float The enclosed area of the given curve.

◆ calculate_min_reflection_image()

cvb.Image calculate_min_reflection_image ( cvb.Image  polarization_image)

From an extracted polarization_image the minimum reflection image is calculated and returned.

The minimum reflection image is calculated by taking the minimum value of all the polarization angles that are contained in the input image.

Parameters

polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.

Returns

cvb.Image The resulting image with one plane.

◆ calculate_quadratic_differences_to_closest_point()

cvb.Matrix2D calculate_quadratic_differences_to_closest_point ( List[cvb.Point2D curve,
List[cvb.Point2D points 
)

Calculates the quadratic distance of the points to the closest point of the given curve.

Note

The points have to be ordered by time, i.e. two consecutive points must adjoin another on the curve.

For the calculation of the signed differences the curve is assumed to be infinite. It is extended at the starting and endpoint.

Parameters

curve : List[cvb.Point2D] Curve

points : List[cvb.Point2D] Points

Returns

cvb.Matrix2D The closest point of the given curve.

◆ calculate_rigid_body_transformation()

cvb.AffineMatrix3D calculate_rigid_body_transformation ( List[cvb.Point3D reference_points,
List[cvb.Point3D measured_points 
)

Calculates rigid body transformation.

Parameters

reference_points : List[cvb.Point3D] List with reference points.

measured_points : List[cvb.Point3D] List with corresponding measured points. Note, that these points have to represent the same body as the reference points.

Returns

cvb.AffineMatrix3D The Transformation.

◆ calculate_rigid_body_transformation_from_aqs12_piece()

Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] calculate_rigid_body_transformation_from_aqs12_piece ( cvb.DensePointCloud  cloud,
cvb.foundation.AQS12DensePointCloudSegmentor  segmentor,
cvb.foundation.AQS12Piece  aqs12,
Optional[cvb.Rect aoi 
)

Calculates the correction of the laser plane inclination (affine transformation) from the given dense point cloud of an AQS12 calibration piece.

Parameters

cloud : cvb.DensePointCloud Dense point cloud.

segmentor : cvb.foundation.AQS12DensePointCloudSegmentor AQS12 segmentor object for dense point clouds.

aqs12 : cvb.foundation.AQS12Piece AQS12 calibration piece.

aoi : Optional[cvb.Rect] Area of interest (default entire plane).

Returns

Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] The calibration result (a tuple of affine transformation and list with residuals).

◆ calculate_signed_differences()

List[float] calculate_signed_differences ( List[cvb.Point2D curve,
List[cvb.Point2D points 
)

Calculates signed differences along the y axis of given points to curve.

For the calculation of the signed differences the curve is assumed to be infinite. It is extended at the starting and endpoint.

Note

The points have to be ordered by time, i.e. two consecutive points must adjoin another on the curve.

Parameters

curve : List[cvb.Point2D] Curve.

points : List[cvb.Point2D] Points.

Returns

List[float] List of signed differences,the length is the amount of points.

◆ calculate_stokes_0()

cvb.Image calculate_stokes_0 ( cvb.Image  polarization_image)

From an extracted polarization_image a new image is returned with the Stokes 0 as content.

From an extracted polarization image Stokes 0 is calculated and returned. Stokes 0 is calculated as (0 45 90 135) * 0.25.

Parameters

polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.

Returns

cvb.Image The resulting image with one plane.

◆ calculate_stokes_1()

cvb.Image calculate_stokes_1 ( cvb.Image  polarization_image)

From an extracted polarization_image a new image is returned with the Stokes 1 as content.

From an extracted polarization image Stokes 1 is calculated and returned.

Parameters

polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.

Returns

cvb.Image The resulting image with one plane.

◆ calculate_stokes_2()

cvb.Image calculate_stokes_2 ( cvb.Image  polarization_image)

From an extracted polarization_image a new image is returned with the Stokes 2 as content.

From an extracted polarization image Stokes 2 is calculated and returned.

Parameters

polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.

Returns

cvb.Image The resulting image with one plane.

◆ calculate_stokes_image()

cvb.Image calculate_stokes_image ( cvb.Image  polarization_image)

From an extracted polarization_image a new image is returned with the Stokes 0 to 2 as planes.

From a extracted polarization image the three first Stokes are calculated and returned. Stokes 0 is calculated as (0 45 90 135) All 0.25. The index of the plane represents the Stokes number.

Parameters

polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.

Returns

cvb.Image The resulting image with 3 planes.

◆ calculate_two_points_for_calibration_of_movement()

Tuple[cvb.Point2D, cvb.Point2D] calculate_two_points_for_calibration_of_movement ( cvb.ImagePlane  image_plane,
cvb.Area2D  aoi,
int  contrast,
int  min_contrast,
cvb.NumberRange  point_size_range,
int  scan_direction 
)

Extracts two points which can be used for the calibration of the movement of line-scan cameras.

Parameters

image_plane : cvb.ImagePlane An image plane containing the calibration points.

aoi : cvb.Area2D Area of interest where the calibration points can be found.

contrast : int Selects whether the image shows white on black or black on white dots (see cvb.foundation.CalibrationPatternContrast).

min_contrast : int Minimum gray value contrast between the object and the background of the calibration points. Value to be set depends on the quality of the image taken.

point_size_range : cvb.NumberRange Desired range of the point size (in number of pixels)

scan_direction : int Scan direction of the camera (see cvb.foundation.ScanDirection).

Returns

Tuple[cvb.Point2D, cvb.Point2D] The first element: X and Y coordinate of left calibration point if the scan direction is X, otherwise top point. The second element: X and Y coordinate of right calibration point if the scan direction is Y, otherwise bottom point.

◆ canny()

cvb.Image canny ( cvb.ImagePlane  image_plane,
int  edge_filter,
int  lower_threshold,
int  upper_threshold 
)

Edge filter using the Canny algorithm.

The algorithm uses three stages:

  1. image_plane is differentiated in x and y direction using the cvb.foundation.EdgeFilter. From the two derivatives the direction and magnitude is computed.
  2. The directional information is simplified and then the local maximum along an edge contour is determined that lies above the upper_threshold.
  3. The contours are then traced starting from the local maximum using hysteresis thresholding with the lower_threshold to counter broken edges.

Parameters

image_plane : cvb.ImagePlane Image plane to be filtered.

edge_filter : int Edge filter method to be used (see cvb.foundation.EdgeFilter).

lower_threshold : int Lower threshold for hysteresis thresholding.

upper_threshold : int Upper threshold for edge detection and hysteresis thresholding.

Returns

cvb.Image The filtered image.

◆ circle_regression()

cvb.Circle circle_regression ( List[cvb.Point2D points)

Create a circle, that fits best into a collection of points.

Parameters

points : List[cvb.Point2D] Points to fit circle in.

Returns

cvb.Circle Circle object.

◆ close()

cvb.Image close ( cvb.Image  image,
int  mask_type,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

Perform a close operation with a selectable filter mask.

Parameters

image : cvb.Image Image to perform the operation on.

mask_type : int Type of morphological mask to be used (see cvb.foundation.MorphologyMask).

mask_size : cvb.Size2D Size of the morphological mask.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ close_custom()

cvb.Image close_custom ( cvb.Image  image,
cvb.Image  mask,
Optional[cvb.Point2D mask_offset 
)

Perform a close operation with a custom filter mask.

The custom filter mask effective is a CVB image of up to 256x256 pixels where irrelevant pixels have been set to black and pixels that are part of the filter mask have been set to white (255).

Parameters

image : cvb.Image Image to perform the operation on.

mask : cvb.Image Custom filter mask to use.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ color_median()

cvb.Image color_median ( cvb.Image  image,
int  mask_type 
)

Apply a color-correct box median filter to an RGB image.

The input image must have an RGB color model.

Parameters

image : cvb.Image Image to apply the filter to.

mask_type : int Mask size to use (see cvb.foundation.FixedFilterSize).

Returns

cvb.Image The filtered image.

◆ colorize_stokes_image()

cvb.Image colorize_stokes_image ( cvb.Image  stokes_image,
int  color_mode 
)

An extracted stokes_image is colorized in a chosen way to visualize the polarization.

Depending on the color_mode the polarization of the input image is visualized in different ways. See the comments for PseudoColorMode on information what colorization modes are available.

Parameters

stokes_image : cvb.Image Input image with calculated stokes from a polarization image. Usually from convert_to_planes.

color_mode : int The PseudoColorMode that will be used to colorize the image (see cvb.foundation.PseutoColorMode).

Returns

cvb.Image The resulting image is a mono or rgb image, depending on the selected color_mode.

◆ convert_to_16bpp_signed()

cvb.Image convert_to_16bpp_signed ( cvb.Image  image)

Convert the input image to an image with 16 bits per pixel signed data.

Conversion means that when converting to a data type with higher value range, the image data will simply be padded with zeros but the actual values will be conserved. When converting to lower value ranges, the pixel values from the source image will be saturated at the value limits of the target format where necessary.

Parameters

image : cvb.Image Image to be converted.

Returns

cvb.Image Converted image.

◆ convert_to_16bpp_unsigned()

cvb.Image convert_to_16bpp_unsigned ( cvb.Image  image)

Convert the input image to an image with 16 bits per pixel unsigned data.

Conversion means that when converting to a data type with higher value range, the image data will simply be padded with zeros but the actual values will be conserved. When converting to lower value ranges, the pixel values from the source image will be saturated at the value limits of the target format where necessary.

Parameters

image : cvb.Image Image to be converted.

Returns

cvb.Image Converted image.

◆ convert_to_32bpp_float()

cvb.Image convert_to_32bpp_float ( cvb.Image  image)

Convert the input image to an image with 32 bits per pixel float data.

Conversion means that when converting to a data type with higher value range, the image data will simply be padded with zeros but the actual values will be conserved. When converting to lower value ranges, the pixel values from the source image will be saturated at the value limits of the target format where necessary.

Parameters

image : cvb.Image Image to be converted.

Returns

cvb.Image Converted image.

◆ convert_to_32bpp_signed()

cvb.Image convert_to_32bpp_signed ( cvb.Image  image)

Convert the input image to an image with 32 bits per pixel signed data.

Conversion means that when converting to a data type with higher value range, the image data will simply be padded with zeros but the actual values will be conserved. When converting to lower value ranges, the pixel values from the source image will be saturated at the value limits of the target format where necessary.

Parameters

image : cvb.Image Image to be converted.

Returns

cvb.Image Converted image.

◆ convert_to_8bpp_unsigned()

cvb.Image convert_to_8bpp_unsigned ( cvb.Image  image)

Convert the input image to an image with 8 bits per pixel unsigned data.

Conversion means that when converting to a data type with higher value range, the image data will simply be padded with zeros but the actual values will be conserved. When converting to lower value ranges, the pixel values from the source image will be saturated at the value limits of the target format where necessary.

Parameters

image : cvb.Image Image to be converted.

Returns

cvb.Image Converted image.

◆ convert_to_cie_lab16()

cvb.Image convert_to_cie_lab16 ( cvb.Image  image)

Convert the input image to CIE Lab with cvb.DataType.int16_bpp_unsigned() for better precision.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_cie_lab8()

cvb.Image convert_to_cie_lab8 ( cvb.Image  image)

Convert the input image to CIE Lab with cvb.DataType.int8_bpp_unsigned().

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_cie_luv()

cvb.Image convert_to_cie_luv ( cvb.Image  image)

Convert the input image to CIE LUV.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_cie_xyz()

cvb.Image convert_to_cie_xyz ( cvb.Image  image)

Convert the input image to CIE XYZ.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_hls()

cvb.Image convert_to_hls ( cvb.Image  image)

Convert the input image to HLS.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_hsv()

cvb.Image convert_to_hsv ( cvb.Image  image)

Convert the input image to HSV.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_mono()

cvb.Image convert_to_mono ( cvb.Image  image,
Optional[float]  weight_r,
Optional[float]  weight_g,
Optional[float]  weight_b 
)

Convert the input image to mono.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly. All coefficients must be >= 0 and satisfy the condition weight_r + weight_g + weight_b <= 1. If the weight arguments are not specified, standard mono conversion is performed.

Parameters

image : cvb.Image Input image.

weight_r : Optional[float] Optional weight (multiplier) for the red channel. All three weights should be specified or none of them.

weight_g : Optional[float] Optional weight (multiplier) for the green channel. All three weights should be specified or none of them.

weight_b : Optional[float] Optional weight (multiplier) for the blue channel. All three weights should be specified or none of them.

Returns

cvb.Image New converted image.

◆ convert_to_planes()

cvb.Image convert_to_planes ( cvb.Image  rawImage,
int  pattern,
int  resolution 
)

Extracts the four polarization angles from a raw image to a four plane image.

From a raw polarization image this function extracts the polarization angles to outImage. The returned image holds the polarization data as 4 planes sorted by increasing angle: 0, 45, 90, 135. The expected pattern of the raw image with Pattern.Square_90_45_135_0 for example is a 2x2 pattern with: Top-left: 90, Top-right: 45, Bottom-left: 135, Bottom-right: 0. If resolution is set to Resolution.full> the image is interpolated and has the same size as rawImage, otherwise it will be half the size.

Parameters

rawImage : cvb.Image Input image with raw polarization data.

pattern : int Indicates in which pattern the polarization angles are ordered in raw image (see cvb.foundation.Pattern).

resolution : int Resolution of outImage. If set to Resolution.Full the image is interpolated and will equal the size of rawImage, otherwise it will be half the size (see cvb.foundation.Resolution).

Returns

cvb.Image The resulting image with 4 planes.

◆ convert_to_rgb()

cvb.Image convert_to_rgb ( cvb.Image  image,
int   guess_to_color_model = cvb.ColorModel.RGB 
)

Convert the input image to RGB.

If the color model is cvb.ColorModel.RGBGuess, then guess_to_color_model is used. With that you can build your own images consisting of the desired color space and convert it to RGB.

Parameters

image : cvb.Image Input image.

guess_to_color_model : int Input color model to use if image's color model is cvb.ColorModel.RGBGuess.

Returns

cvb.Image New converted image.

◆ convert_to_ycbcr()

cvb.Image convert_to_ycbcr ( cvb.Image  image)

Convert the input image to YCbCr.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_ycc()

cvb.Image convert_to_ycc ( cvb.Image  image)

Convert the input image to YCC.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ convert_to_yuv()

cvb.Image convert_to_yuv ( cvb.Image  image)

Convert the input image to YUV.

If the input image is something other than RGB, an internal conversion to RGB happens, increasing the processing time accordingly.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image New converted image.

◆ correlate()

cvb.Image correlate ( cvb.ImagePlane  image_plane,
cvb.ImagePlane  template_plane,
Optional[cvb.Rect aoi,
Optional[int]  method 
)

Calculate the correlation between a plane and a template using a selectable calculation method.

The result of the correlation will be an accumulator image with 32 bit floating point pixels containing the results. Note that the accumulator will be smaller than the input aoi, the difference being width (or height) of the template - 1. The template will be anchored at its central pixel (fractional positions cut off).

In other words: The pixel (0, 0) of the accumulator corresponds to image position (int)(template width / 2, template height / 2) and its value will be a representation of the correlation between the input image and the template, centered around this very pixel.

Parameters

image_plane : cvb.ImagePlane Image plane to perform the correlation on.

template_plane : cvb.ImagePlane Template plane to perform the correlation with.

aoi : Optional[cvb.Rect] Area of interest to perform the correlation on (default entire image).

method : Optional[int] Correlation method to use, cvb.foundation.CorrelationMethod.CorrelationCoefficients by default (see cvb.foundation.CorrelationCoefficients).

Returns

cvb.Image Accumulator image (cvb.DataType.float32_bpp).

◆ create_calibration_pattern()

cvb.Image create_calibration_pattern ( int  style,
int  contrast,
int  width,
int  height,
int  num_columns,
int  num_rows 
)

Create a user-definable calibration pattern.

The calibration pattern will consist of a regular spaced matrix of dots, the size of which will be determined by the input parameters. The distance between the dots in x- and y-direction will be 2.5 times the diameter of the dots. If an asymmetric pattern was selected, the bigger dots will have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).

Parameters

style : int Dot style to use (see cvb.foundation.CalibrationPatternStyle).

contrast : int Selects whether to use white on black or black on white dots (see cvb.foundation.CalibrationPatternContrast).

width : int Width of the output image in pixels.

height : int Height of the output image in pixels.

num_columns : int Number of dot columns in the image.

num_rows : int Number of dot rows in the image.

Returns

cvb.Image Calibration pattern image.

◆ create_calibrator_from_aqs12_piece()

Tuple[cvb.LaserPlaneHomographyCalibrator3D, List[cvb.Point3D]] create_calibrator_from_aqs12_piece ( cvb.ImagePlane  image_plane,
cvb.foundation.AQS12RangeMapSegmentor  segmentor,
cvb.foundation.CalibrationConfiguration  config,
Optional[cvb.Rect aoi 
)

Calculates intrinsic calibration parameters from the given range map image of an AQS12 calibration piece and creates a new calibration object.

Parameters

image_plane : cvb.ImagePlane Plane of range map image.

segmentor : cvb.foundation.AQS12RangeMapSegmentor AQS12 segmentor object for range maps.

config : cvb.foundation.CalibrationConfiguration Calibration configuration object.

aoi : Optional[cvb.Rect] Area of interest (default entire plane).

Returns

Tuple[cvb.LaserPlaneHomographyCalibrator3D, List[cvb.Point3D]] A tuple of cvb.LaserPlaneHomographyCalibrator3D and the difference between the reference points and calculation result as cvb.Point3D list.

◆ create_destination_image()

cvb.Image create_destination_image ( cvb.Size2D  size,
int  mode 
)

Create a destination image for Bayer to RGB conversions.

Bayer to RGB conversions are also implemented as in-place operations, however the destination image needs to have a suitable width and height to be eligible. The destination width and height depend on the size of the input image as well as the conversion method.

Parameters

size : cvb.Size2D Size of the input image to convert for.

mode : int Conversion mode to be used (see cvb.foundation.RGBConversion).

Returns

cvb.Image bayer_to_rgb destination image.

◆ create_image_histograms()

List[cvb.foundation.Histogram] create_image_histograms ( cvb.Image  image,
Optional[Union[cvb.Area2D, cvb.Rect]]  aoi,
float   density = 1.0 
)

Creates a histogram for each plane of the aoi in the given image.

Using the cvb.Rect as an overlay (aoi) uses the CoordinateSystemType.PixelCoordinates. Using the cvb.Area2D as an overlay (aoi) uses the CoordinateSystemType.ImageCoordinates.

Parameters

image : cvb.Image Image to create histograms for.

aoi : Optional[Union[cvb.Area2D, cvb.Rect]] Area of interest (default entire image) in CoordinateSystemType.PixelCoordinates (aoi as cvb.Rect) or in CoordinateSystemType.ImageCoordinates (aoi as cvb.Area2D).

density : float Percentage of pixels to process where 0 is 0% and 1.0 is 100%.

Returns

List[cvb.foundation.Histogram] List containing the histograms for each image plane.

◆ create_jaehne_image()

cvb.Image create_jaehne_image ( cvb.Size2D  size,
int  num_planes,
int  data_type 
)

Create a filter test image as suggested by Professor Jaehne, suitable for investigating the isotropy characteristics of a filter.

Parameters

size : cvb.Size2D Size of the image to be generated.

num_planes : int Number of planes the image should have.

data_type : int Data type the image should have (see cvb.foundation.TestImageDataType).

Returns

cvb.Image The test image.

◆ create_line_scan_calibration()

cvb.foundation.LineScanCalibrator create_line_scan_calibration ( cvb.Point2D  calibration_point_1,
cvb.Point2D  calibration_point_2,
float  reference_distance_calibration_points,
cvb.foundation.EdgeDetectionResult  edge_detection_result,
float  reference_width_stripes,
cvb.foundation.LineScanCalibrationConfiguration  configuration 
)

Calibrates line-scan cameras.

The transformation result includes a 3rd order polynomial for the line calibration and a factor to correct the movement direction. Note, that x and y do not depend on each other. All mixed coefficients are zero.

For the calibration of the movement direction an image containing two calibration dots is needed. The pixel coordinates of the dots calibration_point_1 and calibration_point_2 are calculated by the function calculate_two_points_for_calibration_of_movement.

This function needs these coordinates and the reference distance between the dots reference_distance_calibration_points.

For the line-scan calibration an image of a pattern with alternating black and white stripes has to be acquired. Also, the width of the stripes reference_width_stripes has to be given as reference.

Parameters

calibration_point_1 : cvb.Point2D First calibration point (left or top).

calibration_point_2 : cvb.Point2D Second calibration point (right or bottom).

reference_distance_calibration_points : float Reference distance between the two calibration points (same units as reference_width_stripes).

edge_detection_result : cvb.foundation.EdgeDetectionResult Result returned by cvb.foundation.detect_edges_of_stripe_target.

reference_width_stripes : float Reference width of stripes in calibration pattern(same units as reference_distance_calibration_points).

configuration : cvb.foundation.LineScanCalibrationConfiguration Configuration of line-scan calibration.

Returns

cvb.foundation.LineScanCalibrator A line-scan calibrator including a transformation and its quality.

◆ create_plane_histogram()

cvb.foundation.Histogram create_plane_histogram ( cvb.ImagePlane  plane,
Optional[Union[cvb.Area2D, cvb.Rect]]  aoi,
float   density = 1.0 
)

Creates a histogram for the aoi in the given plane.

Using the cvb.Rect as an overlay (aoi) uses the CoordinateSystemType.PixelCoordinates. Using the cvb.Area2D as an overlay (aoi) uses the CoordinateSystemType.ImageCoordinates.

Parameters

plane : cvb.ImagePlane Image plane to create histogram for.

aoi : Optional[Union[cvb.Area2D, cvb.Rect]] Area of interest (default entire plane) in CoordinateSystemType.PixelCoordinates (aoi as cvb.Rect) or in CoordinateSystemType.ImageCoordinates (aoi as cvb.Area2D).

density : float Percentage of pixels to process where 0 is 0% and 1.0 is 100%.

Returns

cvb.foundation.Histogram Histogram for the given plane.

◆ create_printable_calibration_pattern()

cvb.Image create_printable_calibration_pattern ( int  style,
int  contrast,
int  paper_size,
int  orientation,
int  num_columns,
int  num_rows,
float  horizontal_border,
float  vertical_border,
int  dpi 
)

Create a user-definable calibration pattern suitable for printing on a sheet of paper.

The calibration pattern will consist of a regularly spaced matrix of dots, the size of which will be determined by the input parameters. The size of the pattern image will be suitable for printing it on an piece of paper defined by the paper_size parameter. The calibration pattern will consist of a regular rectangular grid of dots. The distance between the dots in x- and y-direction will be 2.5 times the diameter of the dots. If an asymmetric pattern was selected, the bigger dots will have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).The horizontal and vertical border values should match the setting that is going to be used for printing the resulting image. Must not be negative. The meaning of horizontal/vertical refers to the paper size definition and is independent of orientation setting. It usually makes sense to set the dpi parameter to the printer's physical dot density or half or quarter of that. Minimum value is 150.

Parameters

style : int Dot style to use (see cvb.foundation.CalibrationPatternStyle).

contrast : int Selects whether to use white on black or black on white dots (see cvb.foundation.CalibrationPatternContrast).

paper_size : int Size of the paper on which to print the calibration pattern later on (cvb.foundation.CalibrationPatternFormat).

orientation : int Choose orientation; only relevant for cvb.foundation.CalibrationPatternStyle.AsymmetricDots (see cvb.foundation.CalibrationPatternOrientation).

num_columns : int Number of dot columns in the image.

num_rows : int Number of dot rows in the image.

horizontal_border : float Horizontal borders to be applied (in inches).

vertical_border : float Vertical borders to be applied (in inches).

dpi : int Dot density to be used (in dots per inch).

Returns

cvb.Image Calibration pattern image.

◆ create_ramp_image()

cvb.Image create_ramp_image ( cvb.Size2D  size,
int  num_planes,
int  data_type,
int  axis,
float   offset = 0.0,
float   slope = 1.0 
)

Create a gray ramp test image.

Parameters

size : cvb.Size2D Size of the image to be generated.

num_planes : int Number of planes the image should have.

data_type : int Data type the image should have (see cvb.foundation.TestImageDataType).

axis : int Axis along which the ramp should run (see cvb.foundation.Axis).

offset : float Offset the ramp should have, 0.0 by default.

slope : float Slope the ramp should have, 1.0 by default.

Returns

cvb.Image The test image.

◆ detect_edges_of_stripe_target()

cvb.foundation.EdgeDetectionResult detect_edges_of_stripe_target ( cvb.Image  image_stripes,
cvb.Area2D  aoi,
int  num_stripes,
int  scan_direction,
float  threshold 
)

This function detects edges from a calibration pattern with alternating black and white stripes.

The output of this function is used by function create_line_scan_calibration calculating the line-scan calibration. For the detection of the transition between the stripes, the CVB function cvb.foundation.find_all_edges is used. For further information see the documentation of the CVB edge tool.

Parameters

image_stripes : cvb.Image Calibration pattern with alternating black and white stripes.

aoi : cvb.Area2D Area of interest in the given image.

num_stripes : int Number of stripes in the calibration pattern.

scan_direction : int Scan direction of the camera (see cvb.foundation.ScanDirection).

threshold : float Threshold for edge detection in the given image (pixel data type dependent. See also cvb.foundation.find_all_edges)

Returns

cvb.foundation.EdgeDetectionResult Result of the edge detection.

◆ dilate()

cvb.Image dilate ( cvb.Image  image,
int  mask_type,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

Perform a dilation operation with a selectable filter mask.

Parameters

image : cvb.Image Image to perform the operation on.

mask_type : int Type of morphological mask to be used (see cvb.foundation.MorphologyMask).

mask_size : cvb.Size2D Size of the morphological mask.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ dilate_custom()

cvb.Image dilate_custom ( cvb.Image  image,
cvb.Image  mask,
Optional[cvb.Point2D mask_offset 
)

The custom filter mask effective is a CVB image of up to 256x256 pixels where irrelevant pixels have been set to black and pixels that are part of the filter mask have been set to white (255).

Parameters

image : cvb.Image Image to perform the operation on.

mask : cvb.Image Custom filter mask to use.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ distance_transform()

cvb.Image distance_transform ( cvb.ImagePlane  plane,
int  mask_size,
int  norm 
)

This function calculates (and writes into the output image) the distance to the closest pixel in the source image with the value zero for all nonzero pixels in the input image.

Distance is calculated approximatively using a set of principal distances, that is governed by the mask_size parameter and the distance norm.

Parameters

plane : cvb.ImagePlane Image plane on which to calculate.

mask_size : int Mask size to use for the approximator, either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.

norm : int Distance calculation norm to be used (see cvb.foundation.DistanceNorm).

Returns

cvb.Image The transformed image.

◆ divide_constant()

cvb.Image divide_constant ( cvb.Image  image,
Union[float, List[float]]  values 
)

Divide pixel values from the input image by constant values.

Parameters

image : cvb.Image Input image.

values : Union[float, List[float]] Values to be divided by (list with one value per plane in image or single value to be subtracted from each plane).

Returns

cvb.Image The result image.

◆ divide_image()

cvb.Image divide_image ( cvb.Image  image1,
cvb.Image  image2,
int  upshift 
)

Divide the pixel values of image1 by the pixel values of image 2 to obtain the output image and shift them up by upshift bits to preserve information.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

upshift : int Number of bits to shift the division result up.

Returns

cvb.Image The result image.

◆ downshift()

cvb.Image downshift ( cvb.Image  image,
Union[int, List[int]]  values 
)

Bit-wise shift the input image with a constant value or values.

Parameters

image : cvb.Image Input image.

values : Union[int, List[int]] Values to shift with (list with one value per plane in image or single value to shift each plane with).

Returns

cvb.Image The result image.

◆ dynamic_threshold()

cvb.Image dynamic_threshold ( cvb.Image  image,
int  window_size,
int  threshold,
int   norm = cvb.foundation.DynamicThresholdNorm.Mean 
)

This function performs dynamic thresholding on the input image.

Dynamic thresholding works by calculating the average gray value over a mask with given size (centered around the pixel in question) for each input pixel. If the difference between this average and the pixel, that is currently being looked at, is above the specified threshold, then the corresponding pixel in the output image is set to white, otherwise it is black. This function is particularly useful, when dealing with images, that have a non-uniform illumination.

Parameters

image : cvb.Image Image to be thresholded.

window_size : int Window size to calculate the dynamic threshold. Bigger window sizes will lead to higher processing times.

threshold : int Threshold offset to use.

norm : int Either cvb.foundation.DynamicThresholdNorm.Mean (default) or cvb.foundation.DynamicThresholdNorm.MinMax.

Returns

cvb.Image The thresholded image.

◆ ellipse_regression()

cvb.Ellipse ellipse_regression ( List[cvb.Point2D points)

Create an ellipse, that fits best into a collection of points.

Parameters

points : List[cvb.Point2D] Points to fit ellipse in.

Returns

cvb.Ellipse Ellipse object.

◆ erode()

cvb.Image erode ( cvb.Image  image,
int  mask_type,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

Perform an erosion operation with a selectable filter mask.

Parameters

image : cvb.Image Image on which the operation is to be executed.

mask_type : int Type of morphological mask to be used (see cvb.foundation.MorphologyMask).

mask_size : cvb.Size2D Size of the morphological mask.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ erode_custom()

cvb.Image erode_custom ( cvb.Image  image,
cvb.Image  mask,
Optional[cvb.Point2D mask_offset 
)

Perform an erosion operation with a custom filter mask.

The custom filter mask effective is a CVB image of up to 256x256 pixels, where irrelevant pixels have been set to black and pixels that are part of the filter mask have been set to white (255).

Parameters

image : cvb.Image Image to perform the operation on.

mask : cvb.Image Custom filter mask to use.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ extract_calibration_lists()

Tuple[List[cvb.Point2D], List[cvb.Point2D]] extract_calibration_lists ( cvb.ImagePlane  plane,
int  style,
int  contrast,
int  grid_spacing,
int  min_contrast,
float  max_ratio,
Optional[cvb.Area2D aoi 
)

Automatically extracts the pixel lists required for creating a NonLinearTransformation object.

The output tuple contains following 2 lists of cvb.Point2D:

  1. Original pixels - point list to contain the locations of the calibration dots in the input image in pixel coordinates.
  2. Transformed pixels - pixel list to contain the appropriate locations of the calibration dots in the target image of the calibration.

Note that a more convenient alternative is to call the method cvb.foundation.NonLinearTransformationNonLinearTransformation.from_calibration_pattern(). It will do the list extraction and the generation of the transformation object in a single function call.

The image plane given to this method needs to contain a calibration pattern as generated by the function cvb.foundation.create_calibration_pattern(): A regularly spaced matrix of dots, the distance between the dots in x- and y-direction should be 2.5 times the diameter of the dots, if an asymmetric pattern was used, the bigger dots should have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).

Note that, although the area of interest is given as a cvb.Area2D here (and in the processing of the cvb.Area2D the image's coordinate system will be respected), the actual output of this method uses CoordinateSystemType.PixelCoordinates! This seemingly inconsistent mix in this case is in fact useful, because a cvb.Area2D will better capture the actual location of a calibration pattern, especially if the image has been rotated, than a Rect style area of interest. But the calibration functions usually assume that the pixel lists are given in pixel coordinates.

To avoid misunderstandings and complications in the interpretation of the image content, it is recommended to use a default coordinate system on the input image.

The minimum contrast (min_contrast) value to be set depends on the quality of the image taken from the pattern, but in a typical situation this contrast should not drop below 64 gray values, otherwise it might become difficult to extract the calibration points.

The maximum ratio (max_ratio) value will be used to identify outliers when looking for calibration dots. It should be set high enough to allow for the area variations to be expected due to perspective distortions and small enough to eliminate the candidates that are either too big or too small to be valid calibration pattern dots. Typically, values of about 3.0 to 5.0 are big enough - even if there is notable perspective distortion visible in the images. If an asymmetric calibration pattern has been selected, the ratio used for calculation will be adapted accordingly.

Parameters

plane : cvb.ImagePlane Image plane to work on.

style : int Calibration pattern style visible in the image (see cvb.foundation.CalibrationPatternStyle).

contrast : int Selects whether the image shows white on black or black on white dots (see cvb.foundation.CalibrationPatternContrast).

grid_spacing : int Spacing of the calibration dot grid in the target image. Defines the distance of the points, that will end up in the transformed pixels.

min_contrast : int Minimum gray value contrast between the object and the background of the calibration target pattern.

max_ratio : float Maximum ratio between the biggest and the smallest calibration dot.

aoi : Optional[cvb.Area2D] Area of interest in which to look for the calibration pattern's dots (default entire image).

Returns

Tuple[List[cvb.Point2D], List[cvb.Point2D]] Tuple of 2 lists of points containing the original and transformed pixel locations.

◆ filter_histogram()

List[float] filter_histogram ( List[Union[int, float]]  histogram,
List[Union[int, float]]  kernel 
)

Filter a histogram array with the given kernel.

At the beginning and end of the histogram, the histogram uses constant extension.

Parameters

histogram : List[Union[int, float]] Histogram to be filtered.

kernel : List[Union[int, float]] Kernel to be used.

Returns

List[float] Filter result.

◆ find_all_edges()

List[cvb.foundation.EdgeResult] find_all_edges ( cvb.ImagePlane  plane,
int  mode,
int  type,
float  threshold,
Optional[cvb.Area2D aoi,
float   density = 1.0 
)

Find all edges inside the aoi.

Parameters

plane : cvb.ImagePlane Plane in which to search.

mode : int Search mode to use (see cvb.foundation.EdgeSearchMode).

type : int Type of edge to be searched for (see cvb.foundation.EdgeType).

threshold : float Threshold to apply.

aoi : Optional[cvb.Area2D] Area to scan (default entire image).

density : float Density at which to scan the aoi where 1.0 (default value) means scanning all pixels.

Returns

List[cvb.foundation.EdgeResult] Found edges.

◆ find_best_edge()

Optional[cvb.foundation.EdgeResult] find_best_edge ( cvb.ImagePlane  plane,
int  type,
Optional[cvb.Area2D aoi,
float   density = 1.0 
)

Use the 2nd derivative method to find the edge with the highest intensity in the area of interest.

Parameters

plane : cvb.ImagePlane Plane to scan.

type : int Type of edge to be searched for (see cvb.foundation.EdgeType).

aoi : Optional[cvb.Area2D] Area to scan (default entire image).

density : float Density at which to scan the aoi where 1.0 (default value) means scanning all pixels.

Returns

Optional[cvb.foundation.EdgeResult] The best result (or None if nothing was found for example because the area is outside the image).

◆ find_first_edge()

Optional[cvb.foundation.EdgeResult] find_first_edge ( cvb.ImagePlane  plane,
int  mode,
int  type,
float  threshold,
Optional[cvb.Area2D aoi,
float   density = 1.0 
)

Find the first edge (as specified) in the aoi.

Parameters

plane : cvb.ImagePlane Plane to search in.

mode : int Search mode (cvb.foundation.EdgeSearchMode).

type : int Type of edge to be searched for (cvb.foundation.EdgeType).

threshold : float Edge threshold to apply.

aoi : Optional[cvb.Area2D] Area to scan (default entire image).

density : float Density at which to scan the aoi where 1.0 (default value) means scanning all pixels.

Returns

Optional[cvb.foundation.EdgeResult] Found edge (or None if no edge was found).

◆ find_histogram_peaks()

List[int] find_histogram_peaks ( List[int]  histogram,
int  blur_size,
int  min_diff 
)

Find peaks in the histogram identified by the supplied criteria.

Parameters

histogram : List[int] Histogram to analyze.

blur_size : int Averaging window size (must be >= 1).

min_diff : int Minimum grey value difference between two peaks.

Returns

List[int] Peak positions in the histogram.

◆ find_matches()

List[cvb.LocalMaximum] find_matches ( cvb.ImagePlane  image_plane,
cvb.ImagePlane  template_plane,
float  threshold,
int  locality,
Optional[cvb.Rect aoi,
Optional[int]  sub_pix_mode,
Optional[int]  sub_pix_radius 
)

Use the correlation coefficient calculation method to find locations in the input image plane that match the given template.

If the matches fall within the locality distance (measured using the L1 norm), the one with the lower correlation coefficient will be removed from the result list.

Parameters

image_plane : cvb.ImagePlane Image plane in which to look for matches.

template_plane : cvb.ImagePlane Template to match.

threshold : float Minimum correlation coefficient to look for (valid values range from 0 to 1).

locality : int Minimum distance between two valid matches (measured using the L1 norm).

aoi : Optional[cvb.Rect] Region of interest in which to look for matches (default entire image).

sub_pix_mode : Optional[int] Mode to be used for determining sub pixel accuracy cvb.SubPixelMode.ParabolicFast by default (see cvb.SubPixelMode).

sub_pix_radius : Optional[int] Neighborhood to take account in the sub pixel calculation, cvb.Neighborhood.Use3x3 by default (see cvb.Neighborhood).

Returns

List[cvb.LocalMaximum] List of the local maxima that have been found.

◆ gauss()

cvb.Image gauss ( cvb.Image  image,
int  size 
)

This function applies a low high pass Gaussian filter to an image.

Parameters

image : cvb.Image Image to be filtered.

size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.

Returns

cvb.Image The filtered image.

◆ gaussian_pyramid_down()

cvb.Image gaussian_pyramid_down ( cvb.Image  image)

This function down samples an image in the sense of a Gaussian pyramid.

It applies a Gaussian FixedFilterSize.Kernel5x5 to the image, then down samples the image by omitting every odd row and column, producing an output image whose size is halved in each dimension.

Parameters

image : cvb.Image Image to be down sampled.

Returns

cvb.Image Down-sampled image.

◆ gaussian_pyramid_up()

cvb.Image gaussian_pyramid_up ( cvb.Image  image)

This function up samples an image in the sense of a Gaussian pyramid.

It inserts odd columns and rows filled with 0, then applies a Gaussian FixedFilterSize.Kernel5x5 multiplied by 4 to the image.

Parameters

image : cvb.Image Image to be up sampled.

Returns

cvb.Image Up-sampled image.

◆ get_white_balance()

cvb.WhiteBalanceFactors get_white_balance ( cvb.Image  image,
int  pattern,
Optional[cvb.Area2D aoi 
)

Determine a suitable white balance from a monochrome image with a Bayer pattern.

Parameters

image : cvb.Image Monochrome image with Bayer pattern.

pattern : int Pattern in the top left corner of the sensor with which the image was acquired (see cvb.foundation.BayerPattern).

aoi : Optional[cvb.Area2D] Area in which to determine the white balance factors.

Returns

cvb.WhiteBalanceFactors White balance factors.

◆ high_pass()

cvb.Image high_pass ( cvb.Image  image,
int  size 
)

This function applies a square high pass filter to an image.

Parameters

image : cvb.Image Image to be filtered.

size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.

Returns

cvb.Image The filtered image.

◆ init_aoi()

None init_aoi ( cvb.Image  image,
cvb.Rect  aoi,
Union[float, List[float]]  values 
)

Initialize the planes of AOI (area of interest) in this image.

Parameters

image : cvb.Image Image to be initialized.

aoi : cvb.Rect Area of interest to initialize.

values : Union[float, List[float]] Values to which the various planes are to be initialized (list with one value per plane in the image or single value to be added to each plane).

◆ init_image()

None init_image ( cvb.Image  image,
Union[float, List[float]]  values 
)

Initialize the planes of this image.

Parameters

image : cvb.Image Image to be initialized.

values : Union[float, List[float]] Values to which the various planes are to be initialized (list with one value per plane in the image or single value to be added to each plane).

◆ intersect_with_line()

List[cvb.Point2D] intersect_with_line ( List[cvb.Point2D curve,
cvb.Line2D  line 
)

Intersects a 2D curve with a line.

The line is defined by the Hessian normal form:

Normal * x = d, with | Normal | = 1 and d > 0.

Note

The points have to be ordered by time, i.e. two consecutive points must adjoin another on the curve.

The curve is finite. It starts and ends at the first and last point respectively.

Attention

The number of intersection points will be calculated with this function and will be lower than the points defined by curve.

Parameters

curve : List[cvb.Point2D] Curve to be intersected.

line : cvb.Line2D Line to intersect with.

Returns

List[cvb.Point2D] Calculated intersection points.

◆ laplace()

cvb.Image laplace ( cvb.Image  image,
int  size 
)

This function applies a square high pass Laplace filter to an image.

Parameters

image : cvb.Image Image to be filtered.

size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.

Returns

cvb.Image The filtered image.

◆ line_regression()

cvb.Line2D line_regression ( List[cvb.Point2D points)

Create a line, that fits best into a collection of points.

Parameters

points : List[cvb.Point2D] Points to fit line in.

Returns

cvb.Line2D Line2D object.

◆ local_eigen_values_and_vectors()

Tuple[cvb.Image, cvb.Image, cvb.Image, cvb.Image, cvb.Image, cvb.Image] local_eigen_values_and_vectors ( int  derivator_size,
int  blur_size 
)

Calculate the local eigenvalues and eigenvectors of the Hesse matrix applied to the pixels of the input image.

The output tuple contains following 6 images:

  1. First eigenvalue for each pixel.
  2. Second eigenvalue for each pixel.
  3. X-component of the first eigenvector.
  4. Y-component of the first eigenvector.
  5. X-component of the second eigenvector.
  6. Y-component of the second eigenvector.

Parameters

derivator_size : int Size of the derivation operator (EdgeFilter.Sobel, either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

blur_size : int Size of the blurring operator (EdgeFilter.Sobel, either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

Returns

Tuple[cvb.Image, cvb.Image, cvb.Image, cvb.Image, cvb.Image, cvb.Image] Tuple of 6 images containing the per-pixel eigenvalues and eigenvectors (l1, l2, sev1x, sev1y, sev2x, sev2y).

◆ local_min_eigen_values()

cvb.Image local_min_eigen_values ( cvb.ImagePlane  plane,
int  derivator_size,
int  blur_size 
)

Calculate the minimum local eigenvalues of the Hesse matrix applied to the pixels of the input image.

This approach helps identify locations inside the image that contain curved edges.

Parameters

plane : cvb.ImagePlane Image plane to work on.

derivator_size : int Size of the derivation operator (EdgeFilter.Sobel, either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

blur_size : int Size of the blurring operator (EdgeFilter.Sobel, either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

Returns

cvb.Image Image with the minimal local eigenvalues.

◆ low_pass()

cvb.Image low_pass ( cvb.Image  image,
int  size 
)

This function applies a square low pass filter to an image.

Parameters

image : cvb.Image Image to be filtered.

size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.

Returns

cvb.Image The filtered image.

◆ matrix_transform()

cvb.Image matrix_transform ( cvb.Image  image,
cvb.Matrix2D  matrix,
int   interpolation = cvb.foundation.Interpolation.Linear 
)

Use a matrix to transform an image.

Parameters

image : cvb.Image Image to transform.

matrix : cvb.Matrix2D Matrix with which the image is to be transformed.

interpolation : int Interpolation to use, cvb.foundation.Interpolation.Linear by default. Supported values are cvb.foundation.Interpolation.NearestNeighbor, cvb.foundation.Interpolation.Linear and cvb.foundation.Interpolation.Cubic.

Returns

cvb.Image The transformed image.

◆ merge_two_curves()

List[cvb.Point2D] merge_two_curves ( List[cvb.Point2D curve_lhs,
List[cvb.Point2D curve_rhs,
int  mode 
)

Merges two curves into one curve with interpolation.

Takes two curves and merges them into one combined curve. If they overlap, interpolation is done when switching between the two curves while the points are interleaved. The order in which the points are interleaved is defined by the closest neighbour for each point from curve_rhs to curve_lhs. This method works with curves in 2D.

If sorting is executed, then the pair of curves ␇ curve_lhs and ␇ curve_rhs are are sorted from left to right. This means, the algorithm checks which starting point from the two staring points is the best starting point for the merged curve. To make this decision the distance from each possible starting point to the other given curve is calculated and the point with the highest distance is taken as the overall starting point for the new generated merged curve. This method does work well for regular curves (not self intercepting curves). It can be switched off to save computation time if the caller is sure about the correct order.

Note

The points on the curve are evaluated in the order in which they are listed. We assume an ordered point set (not ordered by axis, but ordered according to the curve).

Parameters

curve_lhs : List[cvb.Point2D] Left hand side curve. This curve is assumed starting point if sorting is executed.

curve_rhs : List[cvb.Point2D] Right hand side curve.

mode : int Specifies which start point should be used for the new curve.

Returns

List[cvb.Point2D] Merged curve.

◆ mirror()

cvb.Image mirror ( cvb.Image  image,
int  axis 
)

Mirror the input image.

Parameters

image : cvb.Image Image to mirror.

axis : int Axis(es) around which it is to be flipped (see vb.foundation.Axis).

Returns

cvb.Image The mirrored image.

◆ multiply_constant()

cvb.Image multiply_constant ( cvb.Image  image,
Union[float, List[float]]  values,
int  pixel_overflow 
)

Multiply constant values to the pixel values of the input image.

If the parameter overflow is set to PixelOverflow.Scale, the resulting pixel values are divided to fit the dynamic range of the image (truncated otherwise).

Parameters

image : cvb.Image Input image.

values : Union[float, List[float]] Values to be multiplied (list with one value per plane in image or single value to be multiplied to each plane).

pixel_overflow : int Defines how arithmetic overflow is handled (see cvb.foundation.PixelOverflow).

Returns

cvb.Image The result image.

◆ multiply_image()

cvb.Image multiply_image ( cvb.Image  image1,
cvb.Image  image2,
int  pixel_overflow 
)

Multiply the pixel values of both input images to obtain the output image.

If the parameter overflow is set to PixelOverflow.Scale, the resulting pixel values are divided to fit the dynamic range of the image (truncated otherwise). If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

pixel_overflow : int Defines how arithmetic overflow is handled (see cvb.foundation.PixelOverflow).

Returns

cvb.Image The result image.

◆ negate()

cvb.Image negate ( cvb.Image  image)

Performs a bit-wise NOT operation on the pixels of the input image to create the output image.

Parameters

image : cvb.Image Input image.

Returns

cvb.Image The result image.

◆ norm_l1()

float norm_l1 ( cvb.ImagePlane  plane,
int  normalize,
Optional[cvb.Rect aoi 
)

Calculate and return the L1 norm (sum of absolute values) over all the pixels inside the plane.

Parameters

plane : cvb.ImagePlane Plane to calculate the norm on.

normalize : int Normalize results to [0...1] or not (see cvb.foundation.ValueNormalization).

aoi : Optional[cvb.Rect] Area to calculate the norm in.

Returns

float The calculated norm.

◆ norm_l2()

float norm_l2 ( cvb.ImagePlane  plane,
int  normalize,
Optional[cvb.Rect aoi 
)

Calculate and return the L2 norm (euclidean norm) over the pixels inside the plane.

Parameters

plane : cvb.ImagePlane Plane to calculate the norm on.

normalize : int Normalize results to [0...1] or not (see cvb.foundation.ValueNormalization).

aoi : Optional[cvb.Rect] Area to calculate the norm in.

Returns

float The calculated norm.

◆ norm_linf()

float norm_linf ( cvb.ImagePlane  plane,
int  normalize,
Optional[cvb.Rect aoi 
)

Calculate and return the L infinity norm (maximum norm) over the pixels inside the plane.

Parameters

plane : cvb.ImagePlane Plane to calculate the norm on.

normalize : int Normalize results to [0...1] or not (see cvb.foundation.ValueNormalization).

aoi : Optional[cvb.Rect] Area to calculate the norm in.

Returns

float The calculated norm.

◆ open()

cvb.Image open ( cvb.Image  image,
int  mask_type,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset 
)

Perform an open operation with a selectable filter mask.

Parameters

image : cvb.Image Image to perform the operation on.

mask_type : int Type of morphological mask to be used (see cvb.foundation.MorphologyMask).

mask_size : cvb.Size2D Size of the morphological mask.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ open_custom()

cvb.Image open_custom ( cvb.Image  image,
cvb.Image  mask,
Optional[cvb.Point2D mask_offset 
)

Perform an open operation with a custom filter mask.

The custom filter mask effective is a CVB image of up to 256x256 pixels where irrelevant pixels have been set to black and pixels that are part of the filter mask have been set to white (255).

Parameters

image : cvb.Image Image to perform the operation on.

mask : cvb.Image Custom filter mask to use.

mask_offset : Optional[cvb.Point2D] Offset of the mask reference point relative to the top left pixel of the mask; must lie within the defined mask_size.If missing, the mask_offset is automatically set to the center of the mask rectangle.

Returns

cvb.Image The filtered image.

◆ or_constant()

cvb.Image or_constant ( cvb.Image  image,
Union[int, List[int]]  values 
)

Bit-wise OR operation on the input image with a constant value or values.

Parameters

image : cvb.Image Input image.

values : Union[int, List[int]] Values to be OR'ed (list with one value per plane in image or single value to be OR'ed to each plane).

Returns

cvb.Image The result image.

◆ or_image()

cvb.Image or_image ( cvb.Image  image1,
cvb.Image  image2 
)

Performs a bit-wise OR operation between the pixels of the two input images.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

Returns

cvb.Image The result image.

◆ perspective()

cvb.Image perspective ( cvb.Image  image,
cvb.foundation.PerspectiveTransformation  coeffs,
cvb.Size2D  target_size,
int   interpolation = cvb.foundation.Interpolation.Linear 
)

Apply the perspective transformation coefficients to the image.

Parameters

image : cvb.Image Image to transform.

coeffs : cvb.foundation.PerspectiveTransformation Perspective transformation coefficients.

target_size : cvb.Size2D Size of the destination image.

interpolation : int Interpolation to use, cvb.foundation.Interpolation.Linear by default. Supported values are cvb.foundation.Interpolation.NearestNeighbor, cvb.foundation.Interpolation.Linear and cvb.foundation.Interpolation.Cubic.

Returns

cvb.Image The transformed image.

◆ prewitt()

cvb.Image prewitt ( cvb.Image  image,
int  orientation 
)

Applies a Prewitt edge filter to the input image.

Note that the Prewitt filter zeros out negative edges - if you want to use a filter that preserves the negative edges, please use sobel() or scharr() instead.

Parameters

image : cvb.Image Image to filter.

orientation : int Orientation of the filter (see cvb.foundation.FilterOrientation).

Returns

cvb.Image The filtered image.

◆ range_threshold()

cvb.Image range_threshold ( cvb.ImagePlane  plane,
cvb.NumberRange  range,
Optional[cvb.Rect aoi 
)

A range based binarization algorithm to the given input.

The binarization algorithm is implemented in the blob analyzer.

Please note, that despite the fact, that it is possible to specify an area of interest, the binarized data will always be located in the top left corner of the image.

Parameters

plane : cvb.ImagePlane Image plane to binarize.

range : cvb.NumberRange The gray value range for binarization.

aoi : Optional[cvb.Rect] Area of interest to binarize (default: entire plane).

Returns

cvb.Image Resulting binarized image.

◆ range_threshold_to_dst()

None range_threshold_to_dst ( cvb.ImagePlane  plane,
cvb.NumberRange  range,
cvb.Image  image_dst,
Optional[cvb.Rect aoi 
)

A range based binarization algorithm to the given input.

The binarization algorithm is implemented in the blob analyzer.

Please note, that despite the fact, that it is possible to specify an area of interest, the binarized data will always be located in the top left corner of the image.

This destination image must have one plane only with 8 bits per pixel and be compatible with the input aoi (area of interest) in terms of size.

Parameters

plane : cvb.ImagePlane Image plane to binarize.

range : cvb.NumberRange The gray value range for binarization.

image_dst : cvb.Image Destination image to receive the binarization result.

aoi : Optional[cvb.Rect] Area of interest to binarize (default entire plane).

◆ resample_curve()

List[cvb.Point2D] resample_curve ( List[cvb.Point2D curve,
int  resampled_curve_length 
)

Resamples a 2-dimensional curve via linear interpolation assuming that the "speed" of the time mapping is constant.

Parameters

curve : List[cvb.Point2D] Curve to be resampled.

resampled_curve_length : int Length of the resulting curve.

Returns

List[cvb.Point2D] Resampled curve.

◆ resize()

cvb.Image resize ( cvb.Image  image,
cvb.Size2D  target_size,
int   interpolation = cvb.foundation.Interpolation.Linear 
)

Resize the input image.

Parameters

image : cvb.Image Image to resize.

target_size : cvb.Size2D Size to go with it.

interpolation : int Interpolation to use, cvb.foundation.Interpolation.Linear by default. Supported values are cvb.foundation.Interpolation.NearestNeighbor, cvb.foundation.Interpolation.Linear and cvb.foundation.Interpolation.Cubic.

Returns

cvb.Image The resized image.

◆ rgb_to_bayer()

cvb.Image rgb_to_bayer ( cvb.Image  image,
int  pattern 
)

Convert an RGB image to a monochrome image with Bayer pattern.

Parameters

image : cvb.Image The image to be converted.

pattern : int Pattern in the top left corner of the sensor with which image was acquired (see cvb.foundation.BayerPattern).

Returns

cvb.Image Converted image.

◆ roberts()

cvb.Image roberts ( cvb.Image  image,
int  direction 
)

Apply a Roberts edge detector to the input image.

Result values of the Roberts filter, that are less than zero will be zeroed out.

Parameters

image : cvb.Image Image to be filtered.

direction : int Filter direction (see cvb.foundation.RobertsDirection).

Returns

cvb.Image The filtered image.

◆ rotate()

cvb.Image rotate ( cvb.Image  image,
cvb.Angle  angle,
int   interpolation = cvb.foundation.Interpolation.Linear 
)

Rotate the input image by the given angle.

Parameters

image : cvb.Image Image to rotate.

angle : cvb.Angle Angle by which it is to be rotated.

interpolation : int Interpolation to use, cvb.foundation.Interpolation.Linear by default. Supported values are cvb.foundation.Interpolation.NearestNeighbor, cvb.foundation.Interpolation.Linear and cvb.foundation.Interpolation.Cubic.

Returns

cvb.Image The rotated image.

◆ scale_to_16bpp_signed()

cvb.Image scale_to_16bpp_signed ( cvb.Image  image)

Convert the input image to an image with 16 bits per pixel signed data.

When scaling, the value range from the source image is adapted to that of the target image as good as possible.

Parameters

image : cvb.Image Image to be scaled.

Returns

cvb.Image The scaled image.

◆ scale_to_16bpp_unsigned()

cvb.Image scale_to_16bpp_unsigned ( cvb.Image  image)

Convert the input image to an image with 16 bits per pixel unsigned data.

When scaling, the value range from the source image is adapted to that of the target image as good as possible.

Parameters

image : cvb.Image Image to be scaled.

Returns

cvb.Image The scaled image.

◆ scale_to_32bpp_float()

cvb.Image scale_to_32bpp_float ( cvb.Image  image,
float  min_val,
float  max_val 
)

Convert the input image to an image with 32 bits per pixel float data.

When scaling, the value range from the source image is adapted to that of the target image as good as possible.

Parameters

image : cvb.Image Image to be scaled.

min_val : float Minimum value to occur in the output image.

max_val : float Maximum value to occur in the output image.

Returns

cvb.Image The scaled image.

◆ scale_to_32bpp_signed()

cvb.Image scale_to_32bpp_signed ( cvb.Image  image)

Convert the input image to an image with 32 bits per pixel signed data.

When scaling, the value range from the source image is adapted to that of the target image as good as possible.

Parameters

image : cvb.Image Image to be scaled.

Returns

cvb.Image The scaled image.

◆ scale_to_8bpp_unsigned()

cvb.Image scale_to_8bpp_unsigned ( cvb.Image  image)

Convert the input image to an image with 8 bits per pixel unsigned data.

When scaling, the value range from the source image is adapted to that of the target image as good as possible.

Parameters

image : cvb.Image Image to be scaled.

Returns

cvb.Image The scaled image.

◆ scharr()

cvb.Image scharr ( cvb.Image  image,
int  orientation 
)

Applies a Scharr edge filter to the input image.

The Scharr filter's output, in case of an 8 bit monochrome input image, will be scaled to the range 0...255, with 128 corresponding to a filter result of zero.

Parameters

image : cvb.Image Image to filter.

orientation : int Orientation of the filter (see cvb.foundation.FilterOrientation).

Returns

cvb.Image The filtered image.

◆ search_blobs()

List[cvb.foundation.BlobResult] search_blobs ( cvb.Image  binarized_image,
Optional[cvb.Rect aoi,
Optional[cvb.foundation.BlobFilter filter 
)

Searches for all blobs in the given binarized image.

Image containing pixels with values 0 or 255. 255 marks an object.

Parameters

binarized_image : cvb.Image Image consisting only of 0 and 255.

aoi : Optional[cvb.Rect] Region in which blobs are to be searched (default the entire image).

filter : Optional[cvb.foundation.BlobFilter] Filter which blobs are to be returned (default no filter).

Returns

List[cvb.foundation.BlobResult] Unordered blob results.

◆ sharpen()

cvb.Image sharpen ( cvb.Image  image)

This function applies a FixedFilterSize.Kernel3x3 sharpen filter to an image.

Parameters

image : cvb.Image Image to be filtered.

Returns

cvb.Image The filtered image.

◆ shear()

cvb.Image shear ( cvb.Image  image,
float  shear_x,
float  shear_y,
int   interpolation = cvb.foundation.Interpolation.Linear 
)

Shear the input image.

Parameters

image : cvb.Image Image to shear.

shear_x : float Shear factor in x-direction.

shear_y : float Shear factor in y-direction.

interpolation : int Interpolation to use, cvb.foundation.Interpolation.Linear by default. Supported values are cvb.foundation.Interpolation.NearestNeighbor, cvb.foundation.Interpolation.Linear and cvb.foundation.Interpolation.Cubic.

Returns

cvb.Image The sheared image.

◆ sobel()

cvb.Image sobel ( cvb.Image  image,
int  orientation,
int  mask_size 
)

Applies a Sobel edge filter to the input image.

The Sobel filter's output, in case of an 8 bit monochrome input image, will be scaled to the range 0...255, with 128 corresponding to a filter result of zero.

Parameters

image : cvb.Image Image to filter.

orientation : int Orientation of the filter (see cvb.foundation.FilterOrientation).

mask_size : int Mask size (FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

Returns

cvb.Image The filtered image.

◆ sobel_2nd()

cvb.Image sobel_2nd ( cvb.Image  image,
int  orientation,
int  mask_size 
)

Applies a 2nd order Sobel edge filter to the input image.

The Sobel filter's output, in case of an 8 bit monochrome input image, will be scaled to the range 0...255, with 128 corresponding to a filter result of zero.

Parameters

image : cvb.Image Image to filter.

orientation : int Orientation of the filter (see cvb.foundation.FilterOrientation).

mask_size : int Mask size (FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

Returns

cvb.Image The filtered image.

◆ sobel_2nd_cross()

cvb.Image sobel_2nd_cross ( cvb.Image  image,
int  mask_size 
)

Applies a 2nd order Sobel cross edge filter to the input image.

The Sobel filter's output, in case of an 8 bit monochrome input image, will be scaled to the range 0...255, with 128 corresponding to a filter result of zero.

Parameters

image : cvb.Image Image to filter.

mask_size : int Mask size (FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).

Returns

cvb.Image The filtered image.

◆ sqrt()

cvb.Image sqrt ( cvb.Image  image,
int  scaling 
)

Calculates the square roots of pixel values of a source image and writes them into the destination image.

If the parameter scaling is cvb.foundation.SqrtPixelScaling.AsIs, the resulting image has pixel values as they come out of the calculation. If the parameter scaling is cvb.foundation.SqrtPixelScaling.Yes, the results will be multiplied to fit the dynamic range of the image, effectively turning this function into a gamma correction with a gamma value of 1/2.

Parameters

image : cvb.Image Input image.

scaling : int Whether or not to scale the result (see cvb.foundation.SqrtPixelScaling).

Returns

cvb.Image The result image.

◆ square()

cvb.Image square ( cvb.Image  image,
int  pixel_overflow 
)

Squares the pixel values of the input image to obtain the output image.

If the parameter overflow is set to PixelOverflow.Scale, the resulting pixel values are divided to fit the dynamic range of the image (truncated otherwise). Scaling effectively turns this function into a gamma correction with a gamma value of 2.

Parameters

image : cvb.Image Input image.

pixel_overflow : int Defines how arithmetic overflow is handled (see cvb.foundation.PixelOverflow).

Returns

cvb.Image The result image.

◆ static_constant_threshold()

cvb.Image static_constant_threshold ( cvb.Image  image,
Union[float, List[float]]  values,
int  comparison 
)

Create an output image, that is the result of static thresholding.

Parameters

image : cvb.Image Image to apply static thresholding to.

values : Union[float, List[float]] Threshold values (list with one value per plane in image or single value to be applied to each plane).

comparison : int Comparison method (see cvb.foundation.StaticThresholding).

Returns

cvb.Image The result image.

◆ static_image_threshold()

cvb.Image static_image_threshold ( cvb.Image  image,
cvb.Image  thresholds,
int  comparison 
)

This function performs thresholding of an input image with pixel-by-pixel thresholds stored in the pixels of a thresholds image.

Both images should be identical in size. However, if they are not, the smallest common rectangle (located at the top left pixel) of both images will be the size of the result image. Both input images should have identical dimensions (either 1 or 3 planes per image) and identical data types.

Parameters

image : cvb.Image Image to be thresholded.

thresholds : cvb.Image Image containing the threshold values for the pixels of the input image.

comparison : int Comparison to apply (see cvb.foundation.StaticThresholding).

Returns

cvb.Image The thresholded image.

◆ static_transparent_threshold()

cvb.Image static_transparent_threshold ( cvb.Image  image,
Union[float, List[float]]  thresholds,
int  comparison,
Optional[Union[float, List[float]]]  values 
)

Create a thresholded image using a transparency approach.

In the result image every pixel, that violates the comparison to its threshold, will be assigned the value specified in values argument. All others will be assigned the same value, they had in the input image. If the values argument is missing, the thresholds list will be used in its place.

Parameters

image : cvb.Image Input image.

thresholds : Union[float, List[float]] Thresholds to apply (list with one value per plane in image or single value to be applied to each plane).

comparison : int Thresholding condition (see cvb.foundation.StaticThresholding).

values : Optional[Union[float, List[float]]] Value to set for pixels, that violate the thresholding condition (list with one value per plane in image or single value to be applied to each plane - but same type as thresholds argument).

Returns

cvb.Image Thresholded image.

◆ sub_image()

cvb.Image sub_image ( cvb.Image  image,
cvb.Area2D  aoi,
int  interpolation 
)

Extract the content of an AOI (area of interest) into a new image.

Parameters

image : cvb.Image Image to work from.

aoi : cvb.Area2D Area to be extracted.

interpolation : int Interpolation to be used, Interpolation.Linear by default. Supported values are Interpolation.NearestNeighbor, Interpolation.Linear and Interpolation.Cubic.

Returns

cvb.Image New image of the subregion.

◆ subtract_constant()

cvb.Image subtract_constant ( cvb.Image  image,
Union[float, List[float]]  values 
)

Subtract constant offsets from the pixel values of the input image.

Negative results are saturated at data types's min value.

Parameters

image : cvb.Image Input image.

values : Union[float, List[float]] Values to be subtracted (list with one value per plane in image or single value to be subtracted from each plane).

Returns

cvb.Image The result image.

◆ subtract_constant_abs()

cvb.Image subtract_constant_abs ( cvb.Image  image,
Union[float, List[float]]  values 
)

Subtract constant offsets from the pixel values of the input image.

The stored results are the absolute value of the difference of both values.

Parameters

image : cvb.Image Input image.

values : Union[float, List[float]] Values to be subtracted (list with one value per plane in image or single value to be subtracted from each plane).

Returns

cvb.Image The result image.

◆ subtract_image()

cvb.Image subtract_image ( cvb.Image  image1,
cvb.Image  image2 
)

Subtract the pixel values of image 2 from image 1 to obtain the output image.

Negative results are saturated at data types's min value. If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

Returns

cvb.Image The result image.

◆ subtract_image_abs()

cvb.Image subtract_image_abs ( cvb.Image  image1,
cvb.Image  image2 
)

Subtract the pixel values of image 2 from image 1 to obtain the output image.

The stored results are the absolute value of the difference of both pixels. If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

Returns

cvb.Image The result image.

◆ sum_histogram_between()

int sum_histogram_between ( List[int]  histogram,
int  lower_limit,
int  upper_limit 
)

Count the number of pixels that lie between two limits in the histogram.

Parameters

histogram : List[int] Histogram to calculate the sum on.

lower_limit : int Lower limit to count from.

upper_limit : int Upper limit to count to (including).

Returns

int Number of pixels with a gray value between lowerLimit and upperLimit.

◆ swap_channels()

cvb.Image swap_channels ( cvb.Image  image,
List[int]  new_arrangement 
)

Create a new image by rearranging the planes of the input image.

Parameters

image : cvb.Image Input image.

new_arrangement : List[int] List (3 items) that defines the new plane arrangement. For example for an RGB image, the array [2,1,0] would cause the image planes to be rearranged to BGR plane order.

Returns

cvb.Image New transformed image.

◆ twist_colors()

cvb.Image twist_colors ( cvb.Image  image,
cvb.foundation.ColorTwistMatrix  matrix 
)

Apply the color twist matrix to the input image.

Parameters

image : cvb.Image Image to apply the matrix to.

matrix : cvb.foundation.ColorTwistMatrix Matrix defining the color twist transformation.

Returns

cvb.Image Transformed image.

◆ upshift()

cvb.Image upshift ( cvb.Image  image,
Union[int, List[int]]  values 
)

Bit-wise shift the input image with a constant value or values.

Parameters

image : cvb.Image Input image.

values : Union[int, List[int]] Values to shift with (list with one value per plane in image or single value to shift each plane with).

Returns

cvb.Image The result image.

◆ wang_quality()

float wang_quality ( cvb.ImagePlane  plane1,
cvb.ImagePlane  plane2 
)

Calculate the Wang quality for two images.

Parameters

plane1 : cvb.ImagePlane Image plane 1 on which to calculate.

plane2 : cvb.ImagePlane Image plane 2 on which to calculate.

Returns

float The quality index (ranging from -1 to 1).

◆ wiener()

cvb.Image wiener ( cvb.Image  image,
cvb.Size2D  mask_size,
Optional[cvb.Point2D mask_offset,
Optional[float]  noise_threshold 
)

This function performs adaptive filtering of an image degraded by constant power additive noise.

For each pixel of the input image, the function determines the local image mean and variance in the rectangular neighborhood (mask) defined by mask_size and mask_offset. The deviation from the local average is then diminished according to the local variance and the noise threshold parameters. The noise threshold parameter may be zero, in which case the function tries to determine itself what local noise threshold to apply. This normally yields the best results.

Parameters

image : cvb.Image Image to be filtered.

mask_size : cvb.Size2D Filter mask to be used.

mask_offset : Optional[cvb.Point2D] Mask center pixel location. If missing, the mask offset is automatically set to the center of the mask rectangle.

noise_threshold : Optional[float] Noise suppression threshold. Valid input ranges from 0 to 1, with 0 causing the function to determine the threshold automatically.

Returns

cvb.Image The filtered image.

◆ write_projection()

None write_projection ( cvb.ImagePlane  plane,
cvb.Area2D  aoi,
float   density = 1.0 
)

Write the projection that Edge is using internally as the basis for its calculations into an image plane (might be useful for debugging).

Parameters

plane : cvb.ImagePlane Plane to write the projection to.

aoi : cvb.Area2D Area of interest to project.

density : float Density at which to scan the aoi where 1.0 (default value) means scanning all pixels.

◆ xor_constant()

cvb.Image xor_constant ( cvb.Image  image,
Union[int, List[int]]  values 
)

Bit-wise XOR operation on the input image with a constant value or values.

Parameters

image : cvb.Image Input image.

values : Union[int, List[int]] Values to be XOR'ed (list with one value per plane in image or single value to be XOR'ed to each plane).

Returns

cvb.Image The result image.

◆ xor_image()

cvb.Image xor_image ( cvb.Image  image1,
cvb.Image  image2 
)

Performs a bit-wise XOR operation between the pixels of the two input images.

If the sizes of the two input images differ, the result image will contain the biggest rectangle common to both input images.

Parameters

image1 : cvb.Image Input image 1.

image2 : cvb.Image Input image 2.

Returns

cvb.Image The result image.