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.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. 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.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. 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.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. 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.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. More... | |
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. More... | |
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. 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.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. 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.Point2D] | intersect_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.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. 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.Point2D] | merge_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.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. 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.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. 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... | |
Common Vision Blox Foundation module for Python.
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).
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).
cvb.Image The result image.
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.
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.
cvb.Image Result image with added noise.
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.
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).
cvb.Image The result image.
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.
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.
cvb.Image Result image with added noise.
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.
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.
cvb.foundation.AlignmentResult2D Alignment result.
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.
image1 : cvb.Image Input image 1.
image2 : cvb.Image Input image 2.
cvb.Image The result image.
cvb.Image apply_8bit_lut | ( | cvb.ImagePlane | plane, |
List[int] | values | ||
) |
Apply a lookup table to an 8 bit per pixel input image plane.
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.
cvb.Image The result image.
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.
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).
cvb.Image The result image.
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.
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).
cvb.Image Newly created image that contains the conversion result.
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.
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).
cvb.Image Newly created image that contains the conversion result.
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.
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).
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.
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).
List[cvb.foundation.BlobResult] Unordered blob results.
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.
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.
cvb.Image The filtered image.
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.
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.
cvb.Image The filtered image.
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.
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.
cvb.Image The filtered image.
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.
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.
cvb.Image The filtered image.
cvb.AffineMatrix3D calculate_affine_transformation | ( | List[cvb.Point3D] | reference_points, |
List[cvb.Point3D] | measured_points | ||
) |
Calculates affine transformation.
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.
cvb.AffineMatrix3D Affine transformation.
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.
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).
Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] The calibration result (a tuple of affine transformation and array with residuals).
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.
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).
curve : List[cvb.Point2D] Curve.
float The enclosed area of the given curve.
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.
polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.
cvb.Image The resulting image with one plane.
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.
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.
curve : List[cvb.Point2D] Curve
points : List[cvb.Point2D] Points
cvb.Matrix2D The closest point of the given curve.
cvb.AffineMatrix3D calculate_rigid_body_transformation | ( | List[cvb.Point3D] | reference_points, |
List[cvb.Point3D] | measured_points | ||
) |
Calculates rigid body transformation.
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.
cvb.AffineMatrix3D The Transformation.
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.
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).
Tuple[cvb.AffineMatrix3D, List[cvb.Point3D]] The calibration result (a tuple of affine transformation and list with residuals).
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.
The points have to be ordered by time, i.e. two consecutive points must adjoin another on the curve.
curve : List[cvb.Point2D] Curve.
points : List[cvb.Point2D] Points.
List[float] List of signed differences,the length is the amount of points.
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.
polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.
cvb.Image The resulting image with one plane.
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.
polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.
cvb.Image The resulting image with one plane.
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.
polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.
cvb.Image The resulting image with one plane.
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.
polarization_image : cvb.Image Input image with extracted polarization data. Usually from convert_to_planes.
cvb.Image The resulting image with 3 planes.
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.
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).
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.
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:
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.
cvb.Image The filtered image.
cvb.Circle circle_regression | ( | List[cvb.Point2D] | points | ) |
Create a circle, that fits best into a collection of points.
points : List[cvb.Point2D] Points to fit circle in.
cvb.Circle Circle object.
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.
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.
cvb.Image The filtered image.
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).
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.
cvb.Image The filtered image.
Apply a color-correct box median filter to an RGB image.
The input image must have an RGB color model.
image : cvb.Image Image to apply the filter to.
mask_type : int Mask size to use (see cvb.foundation.FixedFilterSize).
cvb.Image The filtered image.
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.
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).
cvb.Image The resulting image is a mono or rgb image, depending on the selected color_mode.
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.
image : cvb.Image Image to be converted.
cvb.Image Converted 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.
image : cvb.Image Image to be converted.
cvb.Image Converted 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.
image : cvb.Image Image to be converted.
cvb.Image Converted 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.
image : cvb.Image Image to be converted.
cvb.Image Converted 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.
image : cvb.Image Image to be converted.
cvb.Image Converted 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.
image : cvb.Image Input image.
cvb.Image New converted 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.
image : cvb.Image Input image.
cvb.Image New converted image.
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.
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.
cvb.Image New converted image.
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.
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).
cvb.Image The resulting image with 4 planes.
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.
image : cvb.Image Input image.
guess_to_color_model : int Input color model to use if image's color model is cvb.ColorModel.RGBGuess.
cvb.Image New converted image.
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.
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).
cvb.Image Accumulator image (cvb.DataType.float32_bpp).
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).
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.
cvb.Image Calibration pattern image.
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.
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).
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.
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.
size : cvb.Size2D Size of the input image to convert for.
mode : int Conversion mode to be used (see cvb.foundation.RGBConversion).
cvb.Image bayer_to_rgb destination image.
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.
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%.
List[cvb.foundation.Histogram] List containing the histograms for each image plane.
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.
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).
cvb.Image The test image.
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.
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.
cvb.foundation.LineScanCalibrator A line-scan calibrator including a transformation and its quality.
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.
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%.
cvb.foundation.Histogram Histogram for the given plane.
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.
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).
cvb.Image Calibration pattern 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.
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.
cvb.Image The test image.
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.
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)
cvb.foundation.EdgeDetectionResult Result of the edge detection.
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.
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.
cvb.Image The filtered image.
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).
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.
cvb.Image The filtered image.
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.
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).
cvb.Image The transformed image.
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.
image1 : cvb.Image Input image 1.
image2 : cvb.Image Input image 2.
upshift : int Number of bits to shift the division result up.
cvb.Image The result image.
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.
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.
cvb.Image The thresholded image.
cvb.Ellipse ellipse_regression | ( | List[cvb.Point2D] | points | ) |
Create an ellipse, that fits best into a collection of points.
points : List[cvb.Point2D] Points to fit ellipse in.
cvb.Ellipse Ellipse object.
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.
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.
cvb.Image The filtered image.
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).
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.
cvb.Image The filtered image.
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:
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.
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).
Tuple[List[cvb.Point2D], List[cvb.Point2D]] Tuple of 2 lists of points containing the original and transformed pixel locations.
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.
histogram : List[Union[int, float]] Histogram to be filtered.
kernel : List[Union[int, float]] Kernel to be used.
List[float] Filter result.
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.
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.
List[cvb.foundation.EdgeResult] Found edges.
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.
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.
Optional[cvb.foundation.EdgeResult] The best result (or None if nothing was found for example because the area is outside the image).
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.
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.
Optional[cvb.foundation.EdgeResult] Found edge (or None if no edge was found).
List[int] find_histogram_peaks | ( | List[int] | histogram, |
int | blur_size, | ||
int | min_diff | ||
) |
Find peaks in the histogram identified by the supplied criteria.
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.
List[int] Peak positions in the histogram.
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.
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).
List[cvb.LocalMaximum] List of the local maxima that have been found.
This function applies a low high pass Gaussian filter to an image.
image : cvb.Image Image to be filtered.
size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.
cvb.Image The filtered 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.
image : cvb.Image Image to be down sampled.
cvb.Image Down-sampled 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.
image : cvb.Image Image to be up sampled.
cvb.Image Up-sampled image.
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.
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.
cvb.WhiteBalanceFactors White balance factors.
This function applies a square high pass filter to an image.
image : cvb.Image Image to be filtered.
size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.
cvb.Image The filtered image.
Initialize the planes of AOI (area of interest) in this image.
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).
None init_image | ( | cvb.Image | image, |
Union[float, List[float]] | values | ||
) |
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.
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.
The number of intersection points will be calculated with this function and will be lower than the points defined by curve.
curve : List[cvb.Point2D] Curve to be intersected.
line : cvb.Line2D Line to intersect with.
List[cvb.Point2D] Calculated intersection points.
This function applies a square high pass Laplace filter to an image.
image : cvb.Image Image to be filtered.
size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.
cvb.Image The filtered image.
cvb.Line2D line_regression | ( | List[cvb.Point2D] | points | ) |
Create a line, that fits best into a collection of points.
points : List[cvb.Point2D] Points to fit line in.
cvb.Line2D Line2D object.
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:
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).
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).
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.
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).
This function applies a square low pass filter to an image.
image : cvb.Image Image to be filtered.
size : int Either FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5.
cvb.Image The filtered image.
cvb.Image matrix_transform | ( | cvb.Image | image, |
cvb.Matrix2D | matrix, | ||
int | interpolation = cvb.foundation.Interpolation.Linear |
||
) |
Use a matrix to transform an image.
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.
cvb.Image The transformed image.
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.
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).
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.
List[cvb.Point2D] Merged curve.
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).
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).
cvb.Image The result image.
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.
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).
cvb.Image The result image.
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.
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.
float The calculated norm.
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.
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.
float The calculated norm.
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.
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.
float The calculated norm.
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.
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.
cvb.Image The filtered image.
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).
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.
cvb.Image The filtered image.
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.
image1 : cvb.Image Input image 1.
image2 : cvb.Image Input image 2.
cvb.Image The result image.
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.
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.
cvb.Image The transformed image.
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.
image : cvb.Image Image to filter.
orientation : int Orientation of the filter (see cvb.foundation.FilterOrientation).
cvb.Image The filtered image.
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.
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).
cvb.Image Resulting binarized image.
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.
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).
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.
curve : List[cvb.Point2D] Curve to be resampled.
resampled_curve_length : int Length of the resulting curve.
List[cvb.Point2D] Resampled curve.
cvb.Image resize | ( | cvb.Image | image, |
cvb.Size2D | target_size, | ||
int | interpolation = cvb.foundation.Interpolation.Linear |
||
) |
Resize the input image.
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.
cvb.Image The resized image.
Convert an RGB image to a monochrome image with Bayer pattern.
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).
cvb.Image Converted image.
Apply a Roberts edge detector to the input image.
Result values of the Roberts filter, that are less than zero will be zeroed out.
image : cvb.Image Image to be filtered.
direction : int Filter direction (see cvb.foundation.RobertsDirection).
cvb.Image The filtered image.
cvb.Image rotate | ( | cvb.Image | image, |
cvb.Angle | angle, | ||
int | interpolation = cvb.foundation.Interpolation.Linear |
||
) |
Rotate the input image by the given angle.
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.
cvb.Image The rotated image.
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.
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.
cvb.Image The scaled image.
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.
image : cvb.Image Image to filter.
orientation : int Orientation of the filter (see cvb.foundation.FilterOrientation).
cvb.Image The filtered image.
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.
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).
List[cvb.foundation.BlobResult] Unordered blob results.
This function applies a FixedFilterSize.Kernel3x3 sharpen filter to an image.
image : cvb.Image Image to be filtered.
cvb.Image The filtered image.
cvb.Image shear | ( | cvb.Image | image, |
float | shear_x, | ||
float | shear_y, | ||
int | interpolation = cvb.foundation.Interpolation.Linear |
||
) |
Shear the input image.
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.
cvb.Image The sheared image.
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.
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).
cvb.Image The filtered image.
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.
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).
cvb.Image The filtered image.
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.
image : cvb.Image Image to filter.
mask_size : int Mask size (FixedFilterSize.Kernel3x3 or FixedFilterSize.Kernel5x5).
cvb.Image The filtered image.
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.
image : cvb.Image Input image.
scaling : int Whether or not to scale the result (see cvb.foundation.SqrtPixelScaling).
cvb.Image The result image.
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.
image : cvb.Image Input image.
pixel_overflow : int Defines how arithmetic overflow is handled (see cvb.foundation.PixelOverflow).
cvb.Image The result image.
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.
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).
cvb.Image The result image.
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.
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).
cvb.Image The thresholded image.
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.
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).
cvb.Image Thresholded 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.
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.
cvb.Image New image of the subregion.
Subtract constant offsets from the pixel values of the input image.
Negative results are saturated at data types's min value.
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).
cvb.Image The result image.
Subtract constant offsets from the pixel values of the input image.
The stored results are the absolute value of the difference of both values.
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).
cvb.Image The result image.
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.
image1 : cvb.Image Input image 1.
image2 : cvb.Image Input image 2.
cvb.Image The result image.
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.
image1 : cvb.Image Input image 1.
image2 : cvb.Image Input image 2.
cvb.Image The result image.
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.
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).
int Number of pixels with a gray value between lowerLimit and upperLimit.
Create a new image by rearranging the planes of the input image.
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.
cvb.Image New transformed image.
cvb.Image twist_colors | ( | cvb.Image | image, |
cvb.foundation.ColorTwistMatrix | matrix | ||
) |
Apply the color twist matrix to the input image.
image : cvb.Image Image to apply the matrix to.
matrix : cvb.foundation.ColorTwistMatrix Matrix defining the color twist transformation.
cvb.Image Transformed image.
float wang_quality | ( | cvb.ImagePlane | plane1, |
cvb.ImagePlane | plane2 | ||
) |
Calculate the Wang quality for two images.
plane1 : cvb.ImagePlane Image plane 1 on which to calculate.
plane2 : cvb.ImagePlane Image plane 2 on which to calculate.
float The quality index (ranging from -1 to 1).
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.
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.
cvb.Image The filtered image.
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).
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.
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.
image1 : cvb.Image Input image 1.
image2 : cvb.Image Input image 2.
cvb.Image The result image.