Optimized Belief Propagation (CPU and GPU)
beliefprop Namespace Reference

Namespace for enums, constants, structures, and functions specific to belief propagation processing. More...

Classes

struct  BpStereoSet
 Structure with stereo set name, disparity count, and scale factor for output disparity map. More...
 
struct  DisparityMapEvaluationParams
 Struct to store parameters for evaluation of disparity map from stereo processing. More...
 
struct  BpLevelProperties
 POD struct to store bp level data. Struct can be passed to global CUDAs kernel so needs to take restrictions of what's allowed for passing data from the host to a CUDA kernel into account. More...
 
struct  BpSettings
 Structure to store the belief propagation settings including the number of levels and iterations. More...
 
struct  BpRunOutput
 Structure with output disparity map, runtime, and other evaluation data. More...
 
struct  BpOnDevice
 Structure with pointers to objects containing functions for smoothing images, processing bp, and memory management on target device using specified acceleration. More...
 

Typedefs

template<RunData_ptr T>
using CheckerboardMessages = std::array< std::array< T, kNumMessageArrays >, kNumCheckerboardParts >
 Define alias for array with message costs for each bp processing checkerboard.
Each checkerboard messages element corresponds to an array of message values and message values must be pointers to a bp data type. More...
 
template<RunData_ptr T>
using DataCostsCheckerboards = std::array< T, kNumCheckerboardParts >
 Define alias for two-element array with data costs for each bp processing checkerboard.
Belief propagation data costs must be pointers to a bp data type. More...
 

Enumerations

enum class  ImageType { kPgmImage , kPpmImage }
 
enum class  Runtime_Type {
  kInitSettingsMalloc , kLevel0DataCosts , kLevel1DataCosts , kLevel2DataCosts ,
  kLevel3DataCosts , kLevel4DataCosts , kLevel5DataCosts , kLevel6DataCosts ,
  kLevel7DataCosts , kLevel8DataCosts , kLevel9DataCosts , kDataCostsHigherLevel ,
  kInitMessages , kInitMessagesKernel , kBpIters , kCopyData ,
  kCopyDataKernel , kCopyDataMemManagement , kOutputDisparity , kFinalFree ,
  kTotalTimed , kSmoothing , kLevel0Bp , kLevel1Bp ,
  kLevel2Bp , kLevel3Bp , kLevel4Bp , kLevel5Bp ,
  kLevel6Bp , kLevel7Bp , kLevel8Bp , kLevel9Bp ,
  kLevel0Copy , kLevel1Copy , kLevel2Copy , kLevel3Copy ,
  kLevel4Copy , kLevel5Copy , kLevel6Copy , kLevel7Copy ,
  kLevel8Copy , kLevel9Copy , kTotalBp , kTotalNoTransfer ,
  kTotalWithTransfer
}
 Enum for each runtime segment in belief propagation implementation shown in timing outputs. More...
 
enum class  CheckerboardPart : unsigned int { kCheckerboardPart0 , kCheckerboardPart1 }
 Define the two checkerboard "parts" that the image is divided into. More...
 
enum class  MessageArrays : unsigned int { kMessagesUCheckerboard , kMessagesDCheckerboard , kMessagesLCheckerboard , kMessagesRCheckerboard }
 
enum class  MessageComp { kUMessage , kDMessage , kLMessage , kRMessage }
 
enum class  BpKernel : unsigned int {
  kBlurImages , kDataCostsAtLevel , kInitMessageVals , kBpAtLevel ,
  kCopyAtLevel , kOutputDisp
}
 Enum corresponding to each kernel in belief propagation that can be run in parallel. More...
 

Functions

unsigned int NumBpStereoRuns (unsigned int disparity_vals)
 Get number of stereo runs when evaluating implementation Perform less stereo runs if greater number of disparity values since implementation takes longer in those case, so there is likely less variance between runs and therefore less need to have as many runs. More...
 
RunData RunSettings ()
 Retrieve run settings as a RunData object for output. More...
 
template<RunData_t T>
bool MemoryAlignedAtDataStart (unsigned int x_val_data_start, unsigned int simd_data_size, unsigned int data_bytes_align_width, unsigned int padded_width_data)
 Inline function to check if data is aligned at x_val_data_start for SIMD loads/stores that require alignment. More...
 
template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void DtStereo (T f[DISP_VALS])
 function retrieve the minimum value at each 1-d disparity value in O(n) time using Felzenszwalb's method (see "Efficient Belief Propagation for Early Vision") More...
 
template<RunData_t T>
ARCHITECTURE_ADDITION void DtStereo (T *f, unsigned int bp_settings_disp_vals)
 
template<RunData_t T>
ARCHITECTURE_ADDITION void DtStereo (T *f, unsigned int bp_settings_disp_vals, unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level)
 
template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void MsgStereo (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const U messages_neighbor_1[DISP_VALS], const U messages_neighbor_2[DISP_VALS], const U messages_neighbor_3[DISP_VALS], const U data_costs[DISP_VALS], T *dst_message_array, U disc_k_bp, bool data_aligned)
 
template<RunData_t T, RunData_t U>
ARCHITECTURE_ADDITION void MsgStereo (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const U *messages_neighbor_1, const U *messages_neighbor_2, const U *messages_neighbor_3, const U *data_costs, T *dst_message_array, U disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals)
 
template<RunData_t T, RunData_t U, beliefprop::MessageComp M>
ARCHITECTURE_ADDITION void SetInitDstProcessing (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const T *prev_u_message_array, const T *prev_d_message_array, const T *prev_l_message_array, const T *prev_r_message_array, const T *data_message_array, T *dst_message_array, U disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, U *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data, unsigned int current_disparity, unsigned int proc_array_idx)
 
template<RunData_t T, RunData_t U, beliefprop::MessageComp M>
ARCHITECTURE_ADDITION void MsgStereo (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const T *prev_u_message_array, const T *prev_d_message_array, const T *prev_l_message_array, const T *prev_r_message_array, const T *data_message_array, T *dst_message_array, U disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, U *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void InitializeBottomLevelDataPixel (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const float *image_1_pixels_device, const float *image_2_pixels_device, T *data_cost_stereo_checkerboard_0, T *data_cost_stereo_checkerboard_1, float lambda_bp, float data_k_bp, unsigned int bp_settings_disp_vals)
 Initialize the "data cost" for each possible disparity between the two full-sized input images ("bottom" of the image pyramid). Image data is stored in the image_1_pixels_device and image_2_pixels_device arrays. More...
 
template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void InitializeCurrentLevelDataPixel (unsigned int x_val, unsigned int y_val, beliefprop::CheckerboardPart checkerboard_part, const beliefprop::BpLevelProperties &current_bp_level, const beliefprop::BpLevelProperties &prev_bp_level, const T *data_cost_checkerboard_0, const T *data_cost_checkerboard_1, T *data_cost_current_level, unsigned int offset_num, unsigned int bp_settings_disp_vals)
 Initialize the data costs at the "next" level up in the pyramid given that the data at the lower has been set. More...
 
template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void InitializeMessageValsToDefaultKernelPixel (unsigned int x_val_in_checkerboard, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, T *message_u_checkerboard_0, T *message_d_checkerboard_0, T *message_l_checkerboard_0, T *message_r_checkerboard_0, T *message_u_checkerboard_1, T *message_d_checkerboard_1, T *message_l_checkerboard_1, T *message_r_checkerboard_1, unsigned int bp_settings_disp_vals)
 Initialize the message values at each pixel of the current level to the default value. More...
 
template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void RunBPIterationUpdateMsgVals (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const U prev_u_message[DISP_VALS], const U prev_d_message[DISP_VALS], const U prev_l_message[DISP_VALS], const U prev_r_message[DISP_VALS], const U data_message[DISP_VALS], T *current_u_message, T *current_d_message, T *current_l_message, T *current_r_message, const U disc_k_bp, bool data_aligned)
 Kernel function to run the current iteration of belief propagation where the input messages and data costs come in as array and the output message values are stored in array. More...
 
template<RunData_t T, RunData_t U>
ARCHITECTURE_ADDITION void RunBPIterationUpdateMsgVals (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const U *prev_u_message, const U *prev_d_message, const U *prev_l_message, const U *prev_r_message, const U *data_message, T *current_u_message, T *current_d_message, T *current_l_message, T *current_r_message, const U disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals)
 
template<RunData_t T, RunData_t U>
ARCHITECTURE_ADDITION void RunBPIterationUpdateMsgVals (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const T *prev_u_message_array, const T *prev_d_message_array, const T *prev_l_message_array, const T *prev_r_message_array, const T *data_message_array, T *current_u_message, T *current_d_message, T *current_l_message, T *current_r_message, const U disc_k_bp, bool data_aligned, unsigned int bp_settings_disp_vals, U *dst_processing, unsigned int checkerboard_adjustment, unsigned int offset_data)
 
template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void RunBPIterationUsingCheckerboardUpdatesKernel (unsigned int x_val, unsigned int y_val, beliefprop::CheckerboardPart checkerboard_to_update, const beliefprop::BpLevelProperties &current_bp_level, const T *data_cost_checkerboard_0, const T *data_cost_checkerboard_1, T *message_u_checkerboard_0, T *message_d_checkerboard_0, T *message_l_checkerboard_0, T *message_r_checkerboard_0, T *message_u_checkerboard_1, T *message_d_checkerboard_1, T *message_l_checkerboard_1, T *message_r_checkerboard_1, float disc_k_bp, unsigned int offset_data, bool data_aligned, unsigned int bp_settings_disp_vals)
 Kernel function to run the current iteration of belief propagation in parallel using the checkerboard update method where half the pixels in the "checkerboard" scheme retrieve messages from each 4-connected neighbor and then update their message based on the retrieved messages and the data cost. More...
 
template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void RunBPIterationUsingCheckerboardUpdatesKernel (unsigned int x_val, unsigned int y_val, beliefprop::CheckerboardPart checkerboard_to_update, const beliefprop::BpLevelProperties &current_bp_level, const T *data_cost_checkerboard_0, const T *data_cost_checkerboard_1, T *message_u_checkerboard_0, T *message_d_checkerboard_0, T *message_l_checkerboard_0, T *message_r_checkerboard_0, T *message_u_checkerboard_1, T *message_d_checkerboard_1, T *message_l_checkerboard_1, T *message_r_checkerboard_1, float disc_k_bp, unsigned int offset_data, bool data_aligned, unsigned int bp_settings_disp_vals, void *dst_processing)
 
template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void CopyMsgDataToNextLevelPixel (unsigned int x_val, unsigned int y_val, beliefprop::CheckerboardPart checkerboard_part, const beliefprop::BpLevelProperties &current_bp_level, const beliefprop::BpLevelProperties &next_bp_level, const T *message_u_prev_checkerboard_0, const T *message_d_prev_checkerboard_0, const T *message_l_prev_checkerboard_0, const T *message_r_prev_checkerboard_0, const T *message_u_prev_checkerboard_1, const T *message_d_prev_checkerboard_1, const T *message_l_prev_checkerboard_1, const T *message_r_prev_checkerboard_1, T *message_u_checkerboard_0, T *message_d_checkerboard_0, T *message_l_checkerboard_0, T *message_r_checkerboard_0, T *message_u_checkerboard_1, T *message_d_checkerboard_1, T *message_l_checkerboard_1, T *message_r_checkerboard_1, unsigned int bp_settings_disp_vals)
 Kernel to copy the computed BP message values at the current level to the corresponding locations at the "next" level down the kernel works from the point of view of the pixel at the prev level that is being copied to four different places. More...
 
template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void RetrieveOutputDisparityPixel (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const T *data_cost_checkerboard_0, const T *data_cost_checkerboard_1, const T *message_u_checkerboard_0, const T *message_d_checkerboard_0, const T *message_l_checkerboard_0, const T *message_r_checkerboard_0, const T *message_u_checkerboard_1, const T *message_d_checkerboard_1, const T *message_l_checkerboard_1, const T *message_r_checkerboard_1, float *disparity_between_images_device, unsigned int bp_settings_disp_vals)
 
template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void PrintDataAndMessageValsAtPointKernel (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const T *data_cost_checkerboard_0, const T *data_cost_checkerboard_1, const T *message_u_checkerboard_0, const T *message_d_checkerboard_0, const T *message_l_checkerboard_0, const T *message_r_checkerboard_0, const T *message_u_checkerboard_1, const T *message_d_checkerboard_1, const T *message_l_checkerboard_1, const T *message_r_checkerboard_1, unsigned int bp_settings_disp_vals=0)
 
template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void PrintDataAndMessageValsToPointKernel (unsigned int x_val, unsigned int y_val, const beliefprop::BpLevelProperties &current_bp_level, const T *data_cost_checkerboard_0, const T *data_cost_checkerboard_1, const T *message_u_checkerboard_0, const T *message_d_checkerboard_0, const T *message_l_checkerboard_0, const T *message_r_checkerboard_0, const T *message_u_checkerboard_1, const T *message_d_checkerboard_1, const T *message_l_checkerboard_1, const T *message_r_checkerboard_1, unsigned int bp_settings_disp_vals=0)
 
ARCHITECTURE_ADDITION bool WithinImageBounds (unsigned int x_val, unsigned int y_val, unsigned int width, unsigned int height)
 Checks if the current point is within the image bounds Assumed that input x/y vals are above zero since their unsigned int so no need for >= 0 check. More...
 
ARCHITECTURE_ADDITION unsigned int RetrieveIndexInDataAndMessage (unsigned int x_val, unsigned int y_val, unsigned int width, unsigned int height, unsigned int current_disparity, unsigned int total_num_disp_vals, unsigned int offset_data=0u)
 Retrieve the current 1-D index value of the given point at the given disparity in the data cost and message data. More...
 
template<BpImData_t T>
ARCHITECTURE_ADDITION void FilterImageAcrossProcessPixel (unsigned int x_val, unsigned int y_val, const T *image_to_filter, float *filtered_image, unsigned int width_images, unsigned int height_images, const float *image_filter, unsigned int size_filter)
 kernel to apply a horizontal filter on each pixel of the image in parallel the input image is stored as unsigned ints in the texture the output filtered image is returned as an array of floats More...
 
template<BpImData_t T>
ARCHITECTURE_ADDITION void FilterImageVerticalProcessPixel (unsigned int x_val, unsigned int y_val, const T *image_to_filter, float *filtered_image, unsigned int width_images, unsigned int height_images, const float *image_filter, unsigned int size_filter)
 kernel to apply a vertical filter on each pixel of the image in parallel the input image is stored as unsigned ints in the texture uint_image_pixelsTexture the output filtered image is returned as an array of floats More...
 

Variables

constexpr std::string_view kRefImageName = "refImage"
 
constexpr std::string_view kTestImageName = "testImage"
 
constexpr std::string_view kInImagePossExtensions [] = {"pgm", "ppm"}
 
constexpr std::string_view kGroundTruthDispFile = "groundTruthDisparity.pgm"
 
constexpr std::string_view kOutDispImageNameBase = "computedDisparity"
 
constexpr std::string_view kBeliefPropDirectoryName = "BeliefProp"
 
constexpr std::string_view kStereoSetsDirectoryName = "BpStereoSets"
 
constexpr std::string_view kBaselineRunDataPath
 
constexpr std::string_view kBaselineRunDesc {"AMD Rome (48 Cores)"}
 
constexpr bool kUseWeightedRGBToGrayscaleConversion {true}
 
constexpr std::string_view kPGMExt {"pgm"}
 
constexpr std::string_view kPPMExt {"ppm"}
 
constexpr std::string_view kBpOptimizeCPUDesc {"Optimized CPU"}
 
constexpr std::string_view kNumParallelCPUThreadsHeader {"Number of parallel CPU threads in run"}
 
constexpr std::string_view kCPUVectorizationHeader {"Vectorization"}
 
constexpr std::string_view kImageWidthHeader {"Image Width"}
 
constexpr std::string_view kImageHeightHeader {"Image Height"}
 
constexpr std::string_view kStereoSetHeader {"Stereo Set"}
 
constexpr std::string_view kNumEvalRuns {"Number of evaluation runs"}
 Header for number of evaluation runs (can differ across stereo sets) More...
 
constexpr std::array< BpStereoSet, 8 > kStereoSetsToProcess
 Declare stereo sets to process with name, num disparity values, and scale factor currently conesFullSize is not used. More...
 
const std::vector< std::pair< std::string, std::vector< InputSignature > > > kEvalDataSubsets
 Define subsets for evaluating run results on specified inputs
The first three stereo sets are labeled as "smallest 3 stereo sets"
The last three stereo sets (excluding "conesFullSized") are labeled as "largest 3 stereo sets". More...
 
constexpr std::array< std::array< std::string_view, 3 >, 10 > kLevelDCostBpTimeCTimeNames
 Constant consisting of arrays of string views for headers corresponding to timing of computation of data costs, bp runtime, and copy data runtime of each level. More...
 
const std::unordered_map< Runtime_Type, std::string_view > kTimingNames
 Mapping of runtime segment enum to header describing timing of the segment. More...
 
constexpr std::string_view kAvgRMSErrorHeader {"Average RMS error"}
 Constant string view for header of average RMS error in evaluation. More...
 
constexpr std::array< float, 4 > kDisparityDiffThresholds
 Difference thresholds in output disparity for a computed disparity at a pixel to be considered a "bad pixel" when compared to the ground truth in the evaluation. More...
 
constexpr float kMaxDiffCap
 Max difference in disparity for evaluation where disparity difference for each pixel is capped to minimize influence of outliers in the average difference across all pixels. More...
 
constexpr unsigned int kNumCheckerboardParts {2}
 Number of checkerboard parts for processing. More...
 
constexpr unsigned int kNumMessageArrays {4}
 Number of message arrays in each checkerboard part. More...
 
constexpr unsigned int kNumKernels {6}
 
template<typename T >
const T kHighValBp {std::numeric_limits<T>::max()}
 High value for type to use if initializing to "high" value. More...
 
constexpr float kHighValBpKernel {32000.0f}
 High value as used in kernel currently hard-coded to be below maximum short value of 32767. More...
 
constexpr bool kUseOptMemManagement {true}
 
constexpr bool kOptimizedIndexingSetting {true}
 
constexpr bool kAllocateFreeBpMemoryOutsideRuns {true}
 
constexpr std::string_view kMemAllocOptHeader {"Memory allocation of all BP data run at or before start of run"}
 
constexpr std::string_view kMemoryCoalescedBpDataHeader {"BP data arranged for memory coalescence"}
 
constexpr std::string_view kAllocateFreeMemOutsideRunsHeader {"Memory for BP allocated/freed outside of runs"}
 
constexpr std::string_view kNumDispValsHeader {"Num Possible Disparity Values"}
 
constexpr std::string_view kNumBpLevelsHeader {"Num BP Levels",}
 
constexpr std::string_view kNumBpItersHeader {"Num BP Iterations"}
 
constexpr std::string_view kDiscCostCapHeader {"DISC_K_BP"}
 
constexpr std::string_view kDataCostCapHeader {"DataKBp"}
 
constexpr std::string_view kBpSettingsLambdaHeader {"LambdaBp"}
 
constexpr std::string_view kBpSettingsSigmaHeader {"SigmaBp"}
 
constexpr unsigned int kDefaultLevelsBp {5}
 Default values for BP settings. Number of scales/levels in the pyramid to run BP. More...
 
constexpr unsigned int kDefaultItersBp {7}
 Default number of BP iterations at each scale/level. More...
 
constexpr float kDefaultSigmaBp {0.0}
 Default sigma value for smoothing input images. More...
 
constexpr float kDefaultLambdaBp {0.1}
 Default weighing of data cost. More...
 
constexpr float kDefaultDataKBp {15.0}
 Default truncation of data cost. More...
 
constexpr std::string_view kBlurImagesPDimsHeader {"Blur Images Parallel Dimensions"}
 
constexpr std::string_view kInitMValsPDimsHeader {"Init Message Values Parallel Dimensions"}
 
constexpr std::string_view kDataCostsPDimsHeader {"Data Costs Parallel Dimensions"}
 
constexpr std::string_view kBpItersPDimsHeader {"BP Thread Parallel Dimensions"}
 
constexpr std::string_view kCopyToNextLevelPDimsHeader {"Copy Thread Parallel Dimensions"}
 
constexpr std::string_view kCompOutputDispPDimsHeader {"Get Output Disparity Parallel Dimensions"}
 
constexpr std::string_view kLevelText {"Level"}
 

Detailed Description

Namespace for enums, constants, structures, and functions specific to belief propagation processing.

Typedef Documentation

◆ CheckerboardMessages

template<RunData_ptr T>
using beliefprop::CheckerboardMessages = typedef std::array<std::array<T, kNumMessageArrays>, kNumCheckerboardParts>

Define alias for array with message costs for each bp processing checkerboard.
Each checkerboard messages element corresponds to an array of message values and message values must be pointers to a bp data type.

Template Parameters
T

Definition at line 61 of file BpConstsEnumsAliases.h.

◆ DataCostsCheckerboards

template<RunData_ptr T>
using beliefprop::DataCostsCheckerboards = typedef std::array<T, kNumCheckerboardParts>

Define alias for two-element array with data costs for each bp processing checkerboard.
Belief propagation data costs must be pointers to a bp data type.

Template Parameters
T

Definition at line 72 of file BpConstsEnumsAliases.h.

Enumeration Type Documentation

◆ BpKernel

enum beliefprop::BpKernel : unsigned int
strong

Enum corresponding to each kernel in belief propagation that can be run in parallel.

Enumerator
kBlurImages 
kDataCostsAtLevel 
kInitMessageVals 
kBpAtLevel 
kCopyAtLevel 
kOutputDisp 

Definition at line 77 of file BpConstsEnumsAliases.h.

◆ CheckerboardPart

enum beliefprop::CheckerboardPart : unsigned int
strong

Define the two checkerboard "parts" that the image is divided into.

Enumerator
kCheckerboardPart0 
kCheckerboardPart1 

Definition at line 41 of file BpConstsEnumsAliases.h.

◆ ImageType

enum beliefprop::ImageType
strong
Enumerator
kPgmImage 
kPpmImage 

Definition at line 43 of file BpImage.h.

◆ MessageArrays

enum beliefprop::MessageArrays : unsigned int
strong
Enumerator
kMessagesUCheckerboard 
kMessagesDCheckerboard 
kMessagesLCheckerboard 
kMessagesRCheckerboard 

Definition at line 42 of file BpConstsEnumsAliases.h.

◆ MessageComp

Enumerator
kUMessage 
kDMessage 
kLMessage 
kRMessage 

Definition at line 44 of file BpConstsEnumsAliases.h.

◆ Runtime_Type

Enum for each runtime segment in belief propagation implementation shown in timing outputs.

Enumerator
kInitSettingsMalloc 
kLevel0DataCosts 
kLevel1DataCosts 
kLevel2DataCosts 
kLevel3DataCosts 
kLevel4DataCosts 
kLevel5DataCosts 
kLevel6DataCosts 
kLevel7DataCosts 
kLevel8DataCosts 
kLevel9DataCosts 
kDataCostsHigherLevel 
kInitMessages 
kInitMessagesKernel 
kBpIters 
kCopyData 
kCopyDataKernel 
kCopyDataMemManagement 
kOutputDisparity 
kFinalFree 
kTotalTimed 
kSmoothing 
kLevel0Bp 
kLevel1Bp 
kLevel2Bp 
kLevel3Bp 
kLevel4Bp 
kLevel5Bp 
kLevel6Bp 
kLevel7Bp 
kLevel8Bp 
kLevel9Bp 
kLevel0Copy 
kLevel1Copy 
kLevel2Copy 
kLevel3Copy 
kLevel4Copy 
kLevel5Copy 
kLevel6Copy 
kLevel7Copy 
kLevel8Copy 
kLevel9Copy 
kTotalBp 
kTotalNoTransfer 
kTotalWithTransfer 

Definition at line 54 of file DetailedTimingBpConsts.h.

Function Documentation

◆ CopyMsgDataToNextLevelPixel()

template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::CopyMsgDataToNextLevelPixel ( unsigned int  x_val,
unsigned int  y_val,
beliefprop::CheckerboardPart  checkerboard_part,
const beliefprop::BpLevelProperties current_bp_level,
const beliefprop::BpLevelProperties next_bp_level,
const T *  message_u_prev_checkerboard_0,
const T *  message_d_prev_checkerboard_0,
const T *  message_l_prev_checkerboard_0,
const T *  message_r_prev_checkerboard_0,
const T *  message_u_prev_checkerboard_1,
const T *  message_d_prev_checkerboard_1,
const T *  message_l_prev_checkerboard_1,
const T *  message_r_prev_checkerboard_1,
T *  message_u_checkerboard_0,
T *  message_d_checkerboard_0,
T *  message_l_checkerboard_0,
T *  message_r_checkerboard_0,
T *  message_u_checkerboard_1,
T *  message_d_checkerboard_1,
T *  message_l_checkerboard_1,
T *  message_r_checkerboard_1,
unsigned int  bp_settings_disp_vals 
)
inline

Kernel to copy the computed BP message values at the current level to the corresponding locations at the "next" level down the kernel works from the point of view of the pixel at the prev level that is being copied to four different places.

Template Parameters
T
DISP_VALS
Parameters
x_val
y_val
checkerboard_part
current_bp_level
next_bp_level
message_u_prev_checkerboard_0
message_d_prev_checkerboard_0
message_l_prev_checkerboard_0
message_r_prev_checkerboard_0
message_u_prev_checkerboard_1
message_d_prev_checkerboard_1
message_l_prev_checkerboard_1
message_r_prev_checkerboard_1
message_u_checkerboard_0
message_d_checkerboard_0
message_l_checkerboard_0
message_r_checkerboard_0
message_u_checkerboard_1
message_d_checkerboard_1
message_l_checkerboard_1
message_r_checkerboard_1
bp_settings_disp_vals

Definition at line 1135 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ DtStereo() [1/3]

template<RunData_t T>
ARCHITECTURE_ADDITION void beliefprop::DtStereo ( T *  f,
unsigned int  bp_settings_disp_vals 
)
inline

Definition at line 71 of file SharedBpProcessingFuncts.h.

◆ DtStereo() [2/3]

template<RunData_t T>
ARCHITECTURE_ADDITION void beliefprop::DtStereo ( T *  f,
unsigned int  bp_settings_disp_vals,
unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level 
)
inline

Definition at line 90 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ DtStereo() [3/3]

template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::DtStereo ( f[DISP_VALS])
inline

function retrieve the minimum value at each 1-d disparity value in O(n) time using Felzenszwalb's method (see "Efficient Belief Propagation for Early Vision")

Template Parameters
T
DISP_VALS
Parameters
f

Definition at line 52 of file SharedBpProcessingFuncts.h.

◆ FilterImageAcrossProcessPixel()

template<BpImData_t T>
ARCHITECTURE_ADDITION void beliefprop::FilterImageAcrossProcessPixel ( unsigned int  x_val,
unsigned int  y_val,
const T *  image_to_filter,
float *  filtered_image,
unsigned int  width_images,
unsigned int  height_images,
const float *  image_filter,
unsigned int  size_filter 
)
inline

kernel to apply a horizontal filter on each pixel of the image in parallel the input image is stored as unsigned ints in the texture the output filtered image is returned as an array of floats

Template Parameters
T
Parameters
x_val
y_val
image_to_filter
filtered_image
width_images
height_images
image_filter
size_filter

Definition at line 55 of file SharedSmoothImageFuncts.h.

Here is the call graph for this function:

◆ FilterImageVerticalProcessPixel()

template<BpImData_t T>
ARCHITECTURE_ADDITION void beliefprop::FilterImageVerticalProcessPixel ( unsigned int  x_val,
unsigned int  y_val,
const T *  image_to_filter,
float *  filtered_image,
unsigned int  width_images,
unsigned int  height_images,
const float *  image_filter,
unsigned int  size_filter 
)
inline

kernel to apply a vertical filter on each pixel of the image in parallel the input image is stored as unsigned ints in the texture uint_image_pixelsTexture the output filtered image is returned as an array of floats

Template Parameters
T
Parameters
x_val
y_val
image_to_filter
filtered_image
width_images
height_images
image_filter
size_filter

Definition at line 89 of file SharedSmoothImageFuncts.h.

Here is the call graph for this function:

◆ InitializeBottomLevelDataPixel()

template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::InitializeBottomLevelDataPixel ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const float *  image_1_pixels_device,
const float *  image_2_pixels_device,
T *  data_cost_stereo_checkerboard_0,
T *  data_cost_stereo_checkerboard_1,
float  lambda_bp,
float  data_k_bp,
unsigned int  bp_settings_disp_vals 
)
inline

Initialize the "data cost" for each possible disparity between the two full-sized input images ("bottom" of the image pyramid). Image data is stored in the image_1_pixels_device and image_2_pixels_device arrays.

Template Parameters
T
DISP_VALS
Parameters
x_val
y_val
current_bp_level
image_1_pixels_device
image_2_pixels_device
data_cost_stereo_checkerboard_0
data_cost_stereo_checkerboard_1
lambda_bp
data_k_bp
bp_settings_disp_vals

Definition at line 433 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ InitializeCurrentLevelDataPixel()

template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::InitializeCurrentLevelDataPixel ( unsigned int  x_val,
unsigned int  y_val,
beliefprop::CheckerboardPart  checkerboard_part,
const beliefprop::BpLevelProperties current_bp_level,
const beliefprop::BpLevelProperties prev_bp_level,
const T *  data_cost_checkerboard_0,
const T *  data_cost_checkerboard_1,
T *  data_cost_current_level,
unsigned int  offset_num,
unsigned int  bp_settings_disp_vals 
)
inline

Initialize the data costs at the "next" level up in the pyramid given that the data at the lower has been set.

Template Parameters
T
U
DISP_VALS
Parameters
x_val
y_val
checkerboard_part
current_bp_level
prev_bp_level
data_cost_checkerboard_0
data_cost_checkerboard_1
data_cost_current_level
offset_num
bp_settings_disp_vals

Definition at line 564 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ InitializeMessageValsToDefaultKernelPixel()

template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::InitializeMessageValsToDefaultKernelPixel ( unsigned int  x_val_in_checkerboard,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
T *  message_u_checkerboard_0,
T *  message_d_checkerboard_0,
T *  message_l_checkerboard_0,
T *  message_r_checkerboard_0,
T *  message_u_checkerboard_1,
T *  message_d_checkerboard_1,
T *  message_l_checkerboard_1,
T *  message_r_checkerboard_1,
unsigned int  bp_settings_disp_vals 
)
inline

Initialize the message values at each pixel of the current level to the default value.

Template Parameters
T
DISP_VALS
Parameters
x_val_in_checkerboard
y_val
current_bp_level
message_u_checkerboard_0
message_d_checkerboard_0
message_l_checkerboard_0
message_r_checkerboard_0
message_u_checkerboard_1
message_d_checkerboard_1
message_l_checkerboard_1
message_r_checkerboard_1
bp_settings_disp_vals

Definition at line 653 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ MemoryAlignedAtDataStart()

template<RunData_t T>
bool beliefprop::MemoryAlignedAtDataStart ( unsigned int  x_val_data_start,
unsigned int  simd_data_size,
unsigned int  data_bytes_align_width,
unsigned int  padded_width_data 
)
inline

Inline function to check if data is aligned at x_val_data_start for SIMD loads/stores that require alignment.

Parameters
x_val_data_start
simd_data_size
data_bytes_align_width
padded_width_data
Returns
true if memory aligned at start, false if not

Definition at line 152 of file BpRunUtils.h.

◆ MsgStereo() [1/3]

template<RunData_t T, RunData_t U, beliefprop::MessageComp M>
ARCHITECTURE_ADDITION void beliefprop::MsgStereo ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const T *  prev_u_message_array,
const T *  prev_d_message_array,
const T *  prev_l_message_array,
const T *  prev_r_message_array,
const T *  data_message_array,
T *  dst_message_array,
disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
U *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 335 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ MsgStereo() [2/3]

template<RunData_t T, RunData_t U>
ARCHITECTURE_ADDITION void beliefprop::MsgStereo ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const U *  messages_neighbor_1,
const U *  messages_neighbor_2,
const U *  messages_neighbor_3,
const U *  data_costs,
T *  dst_message_array,
disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals 
)
inline

Definition at line 191 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ MsgStereo() [3/3]

template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::MsgStereo ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const U  messages_neighbor_1[DISP_VALS],
const U  messages_neighbor_2[DISP_VALS],
const U  messages_neighbor_3[DISP_VALS],
const U  data_costs[DISP_VALS],
T *  dst_message_array,
disc_k_bp,
bool  data_aligned 
)
inline

Definition at line 133 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ NumBpStereoRuns()

unsigned int beliefprop::NumBpStereoRuns ( unsigned int  disparity_vals)
inline

Get number of stereo runs when evaluating implementation Perform less stereo runs if greater number of disparity values since implementation takes longer in those case, so there is likely less variance between runs and therefore less need to have as many runs.

Parameters
disparity_vals
Returns
Number of Runs to use in benchmarking implementation on stereo set

Definition at line 91 of file BpRunUtils.h.

Here is the caller graph for this function:

◆ PrintDataAndMessageValsAtPointKernel()

template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::PrintDataAndMessageValsAtPointKernel ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const T *  data_cost_checkerboard_0,
const T *  data_cost_checkerboard_1,
const T *  message_u_checkerboard_0,
const T *  message_d_checkerboard_0,
const T *  message_l_checkerboard_0,
const T *  message_r_checkerboard_0,
const T *  message_u_checkerboard_1,
const T *  message_d_checkerboard_1,
const T *  message_l_checkerboard_1,
const T *  message_r_checkerboard_1,
unsigned int  bp_settings_disp_vals = 0 
)
inline

Definition at line 1527 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ PrintDataAndMessageValsToPointKernel()

template<RunData_t T, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::PrintDataAndMessageValsToPointKernel ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const T *  data_cost_checkerboard_0,
const T *  data_cost_checkerboard_1,
const T *  message_u_checkerboard_0,
const T *  message_d_checkerboard_0,
const T *  message_l_checkerboard_0,
const T *  message_r_checkerboard_0,
const T *  message_u_checkerboard_1,
const T *  message_d_checkerboard_1,
const T *  message_l_checkerboard_1,
const T *  message_r_checkerboard_1,
unsigned int  bp_settings_disp_vals = 0 
)
inline

Definition at line 1593 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ RetrieveIndexInDataAndMessage()

ARCHITECTURE_ADDITION unsigned int beliefprop::RetrieveIndexInDataAndMessage ( unsigned int  x_val,
unsigned int  y_val,
unsigned int  width,
unsigned int  height,
unsigned int  current_disparity,
unsigned int  total_num_disp_vals,
unsigned int  offset_data = 0u 
)
inline

Retrieve the current 1-D index value of the given point at the given disparity in the data cost and message data.

Parameters
x_val
y_val
width
height
current_disparity
total_num_disp_vals
offset_data

Definition at line 72 of file SharedBpUtilFuncts.h.

Here is the caller graph for this function:

◆ RetrieveOutputDisparityPixel()

template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::RetrieveOutputDisparityPixel ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const T *  data_cost_checkerboard_0,
const T *  data_cost_checkerboard_1,
const T *  message_u_checkerboard_0,
const T *  message_d_checkerboard_0,
const T *  message_l_checkerboard_0,
const T *  message_r_checkerboard_0,
const T *  message_u_checkerboard_1,
const T *  message_d_checkerboard_1,
const T *  message_l_checkerboard_1,
const T *  message_r_checkerboard_1,
float *  disparity_between_images_device,
unsigned int  bp_settings_disp_vals 
)
inline

Definition at line 1287 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ RunBPIterationUpdateMsgVals() [1/3]

template<RunData_t T, RunData_t U>
ARCHITECTURE_ADDITION void beliefprop::RunBPIterationUpdateMsgVals ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const T *  prev_u_message_array,
const T *  prev_d_message_array,
const T *  prev_l_message_array,
const T *  prev_r_message_array,
const T *  data_message_array,
T *  current_u_message,
T *  current_d_message,
T *  current_l_message,
T *  current_r_message,
const U  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
U *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data 
)
inline

Definition at line 828 of file SharedBpProcessingFuncts.h.

◆ RunBPIterationUpdateMsgVals() [2/3]

template<RunData_t T, RunData_t U>
ARCHITECTURE_ADDITION void beliefprop::RunBPIterationUpdateMsgVals ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const U *  prev_u_message,
const U *  prev_d_message,
const U *  prev_l_message,
const U *  prev_r_message,
const U *  data_message,
T *  current_u_message,
T *  current_d_message,
T *  current_l_message,
T *  current_r_message,
const U  disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals 
)
inline

Definition at line 800 of file SharedBpProcessingFuncts.h.

◆ RunBPIterationUpdateMsgVals() [3/3]

template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::RunBPIterationUpdateMsgVals ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const U  prev_u_message[DISP_VALS],
const U  prev_d_message[DISP_VALS],
const U  prev_l_message[DISP_VALS],
const U  prev_r_message[DISP_VALS],
const U  data_message[DISP_VALS],
T *  current_u_message,
T *  current_d_message,
T *  current_l_message,
T *  current_r_message,
const U  disc_k_bp,
bool  data_aligned 
)
inline

Kernel function to run the current iteration of belief propagation where the input messages and data costs come in as array and the output message values are stored in array.

Template Parameters
T
U
DISP_VALS
Parameters
x_val
y_val
current_bp_level
prev_u_message
prev_d_message
prev_l_message
prev_r_message
data_message
current_u_message
current_d_message
current_l_message
current_r_message
disc_k_bp
data_aligned

Definition at line 772 of file SharedBpProcessingFuncts.h.

◆ RunBPIterationUsingCheckerboardUpdatesKernel() [1/2]

template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::RunBPIterationUsingCheckerboardUpdatesKernel ( unsigned int  x_val,
unsigned int  y_val,
beliefprop::CheckerboardPart  checkerboard_to_update,
const beliefprop::BpLevelProperties current_bp_level,
const T *  data_cost_checkerboard_0,
const T *  data_cost_checkerboard_1,
T *  message_u_checkerboard_0,
T *  message_d_checkerboard_0,
T *  message_l_checkerboard_0,
T *  message_r_checkerboard_0,
T *  message_u_checkerboard_1,
T *  message_d_checkerboard_1,
T *  message_l_checkerboard_1,
T *  message_r_checkerboard_1,
float  disc_k_bp,
unsigned int  offset_data,
bool  data_aligned,
unsigned int  bp_settings_disp_vals 
)
inline

Kernel function to run the current iteration of belief propagation in parallel using the checkerboard update method where half the pixels in the "checkerboard" scheme retrieve messages from each 4-connected neighbor and then update their message based on the retrieved messages and the data cost.

Template Parameters
T
U
DISP_VALS
Parameters
x_val
y_val
checkerboard_to_update
current_bp_level
data_cost_checkerboard_0
data_cost_checkerboard_1
message_u_checkerboard_0
message_d_checkerboard_0
message_l_checkerboard_0
message_r_checkerboard_0
message_u_checkerboard_1
message_d_checkerboard_1
message_l_checkerboard_1
message_r_checkerboard_1
disc_k_bp
offset_data
data_aligned
bp_settings_disp_vals

Definition at line 890 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ RunBPIterationUsingCheckerboardUpdatesKernel() [2/2]

template<RunData_t T, RunData_t U, unsigned int DISP_VALS>
ARCHITECTURE_ADDITION void beliefprop::RunBPIterationUsingCheckerboardUpdatesKernel ( unsigned int  x_val,
unsigned int  y_val,
beliefprop::CheckerboardPart  checkerboard_to_update,
const beliefprop::BpLevelProperties current_bp_level,
const T *  data_cost_checkerboard_0,
const T *  data_cost_checkerboard_1,
T *  message_u_checkerboard_0,
T *  message_d_checkerboard_0,
T *  message_l_checkerboard_0,
T *  message_r_checkerboard_0,
T *  message_u_checkerboard_1,
T *  message_d_checkerboard_1,
T *  message_l_checkerboard_1,
T *  message_r_checkerboard_1,
float  disc_k_bp,
unsigned int  offset_data,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
void *  dst_processing 
)
inline

Definition at line 1059 of file SharedBpProcessingFuncts.h.

◆ RunSettings()

RunData beliefprop::RunSettings ( )
inline

Retrieve run settings as a RunData object for output.

Returns
RunData object containing run settings

Definition at line 127 of file BpRunUtils.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInitDstProcessing()

template<RunData_t T, RunData_t U, beliefprop::MessageComp M>
ARCHITECTURE_ADDITION void beliefprop::SetInitDstProcessing ( unsigned int  x_val,
unsigned int  y_val,
const beliefprop::BpLevelProperties current_bp_level,
const T *  prev_u_message_array,
const T *  prev_d_message_array,
const T *  prev_l_message_array,
const T *  prev_r_message_array,
const T *  data_message_array,
T *  dst_message_array,
disc_k_bp,
bool  data_aligned,
unsigned int  bp_settings_disp_vals,
U *  dst_processing,
unsigned int  checkerboard_adjustment,
unsigned int  offset_data,
unsigned int  current_disparity,
unsigned int  proc_array_idx 
)
inline

Definition at line 252 of file SharedBpProcessingFuncts.h.

Here is the call graph for this function:

◆ WithinImageBounds()

ARCHITECTURE_ADDITION bool beliefprop::WithinImageBounds ( unsigned int  x_val,
unsigned int  y_val,
unsigned int  width,
unsigned int  height 
)
inline

Checks if the current point is within the image bounds Assumed that input x/y vals are above zero since their unsigned int so no need for >= 0 check.

Parameters
x_val
y_val
width
height

Definition at line 52 of file SharedBpUtilFuncts.h.

Here is the caller graph for this function:

Variable Documentation

◆ kAllocateFreeBpMemoryOutsideRuns

constexpr bool beliefprop::kAllocateFreeBpMemoryOutsideRuns {true}
constexpr

Definition at line 115 of file BpRunUtils.h.

◆ kAllocateFreeMemOutsideRunsHeader

constexpr std::string_view beliefprop::kAllocateFreeMemOutsideRunsHeader {"Memory for BP allocated/freed outside of runs"}
constexpr

Definition at line 120 of file BpRunUtils.h.

◆ kAvgRMSErrorHeader

constexpr std::string_view beliefprop::kAvgRMSErrorHeader {"Average RMS error"}
constexpr

Constant string view for header of average RMS error in evaluation.

Definition at line 40 of file DisparityMapEvaluation.h.

◆ kBaselineRunDataPath

constexpr std::string_view beliefprop::kBaselineRunDataPath
constexpr
Initial value:
{
"../../BeliefProp/ImpResults/RunResults/AMDRome48Cores_RunResults.csv"}

Definition at line 44 of file BpFileHandlingConsts.h.

◆ kBaselineRunDesc

constexpr std::string_view beliefprop::kBaselineRunDesc {"AMD Rome (48 Cores)"}
constexpr

Definition at line 46 of file BpFileHandlingConsts.h.

◆ kBeliefPropDirectoryName

constexpr std::string_view beliefprop::kBeliefPropDirectoryName = "BeliefProp"
constexpr

Definition at line 42 of file BpFileHandlingConsts.h.

◆ kBlurImagesPDimsHeader

constexpr std::string_view beliefprop::kBlurImagesPDimsHeader {"Blur Images Parallel Dimensions"}
constexpr

Definition at line 44 of file ParallelParamsBp.h.

◆ kBpItersPDimsHeader

constexpr std::string_view beliefprop::kBpItersPDimsHeader {"BP Thread Parallel Dimensions"}
constexpr

Definition at line 47 of file ParallelParamsBp.h.

◆ kBpOptimizeCPUDesc

constexpr std::string_view beliefprop::kBpOptimizeCPUDesc {"Optimized CPU"}
constexpr

Definition at line 43 of file RunBpOnStereoSetOptimizedCPU.h.

◆ kBpSettingsLambdaHeader

constexpr std::string_view beliefprop::kBpSettingsLambdaHeader {"LambdaBp"}
constexpr

Definition at line 63 of file BpSettings.h.

◆ kBpSettingsSigmaHeader

constexpr std::string_view beliefprop::kBpSettingsSigmaHeader {"SigmaBp"}
constexpr

Definition at line 64 of file BpSettings.h.

◆ kCompOutputDispPDimsHeader

constexpr std::string_view beliefprop::kCompOutputDispPDimsHeader {"Get Output Disparity Parallel Dimensions"}
constexpr

Definition at line 49 of file ParallelParamsBp.h.

◆ kCopyToNextLevelPDimsHeader

constexpr std::string_view beliefprop::kCopyToNextLevelPDimsHeader {"Copy Thread Parallel Dimensions"}
constexpr

Definition at line 48 of file ParallelParamsBp.h.

◆ kCPUVectorizationHeader

constexpr std::string_view beliefprop::kCPUVectorizationHeader {"Vectorization"}
constexpr

Definition at line 45 of file RunBpOnStereoSetOptimizedCPU.h.

◆ kDataCostCapHeader

constexpr std::string_view beliefprop::kDataCostCapHeader {"DataKBp"}
constexpr

Definition at line 62 of file BpSettings.h.

◆ kDataCostsPDimsHeader

constexpr std::string_view beliefprop::kDataCostsPDimsHeader {"Data Costs Parallel Dimensions"}
constexpr

Definition at line 46 of file ParallelParamsBp.h.

◆ kDefaultDataKBp

constexpr float beliefprop::kDefaultDataKBp {15.0}
constexpr

Default truncation of data cost.

Definition at line 80 of file BpSettings.h.

◆ kDefaultItersBp

constexpr unsigned int beliefprop::kDefaultItersBp {7}
constexpr

Default number of BP iterations at each scale/level.

Definition at line 71 of file BpSettings.h.

◆ kDefaultLambdaBp

constexpr float beliefprop::kDefaultLambdaBp {0.1}
constexpr

Default weighing of data cost.

Definition at line 77 of file BpSettings.h.

◆ kDefaultLevelsBp

constexpr unsigned int beliefprop::kDefaultLevelsBp {5}
constexpr

Default values for BP settings. Number of scales/levels in the pyramid to run BP.

Definition at line 68 of file BpSettings.h.

◆ kDefaultSigmaBp

constexpr float beliefprop::kDefaultSigmaBp {0.0}
constexpr

Default sigma value for smoothing input images.

Definition at line 74 of file BpSettings.h.

◆ kDiscCostCapHeader

constexpr std::string_view beliefprop::kDiscCostCapHeader {"DISC_K_BP"}
constexpr

Definition at line 61 of file BpSettings.h.

◆ kDisparityDiffThresholds

constexpr std::array<float, 4> beliefprop::kDisparityDiffThresholds
constexpr
Initial value:
{
0.001, 2.01, 5.01, 10.01}

Difference thresholds in output disparity for a computed disparity at a pixel to be considered a "bad pixel" when compared to the ground truth in the evaluation.

Definition at line 45 of file DisparityMapEvaluation.h.

◆ kEvalDataSubsets

const std::vector<std::pair<std::string, std::vector<InputSignature> > > beliefprop::kEvalDataSubsets
Initial value:
{
{"smallest 3 stereo sets",
{InputSignature({}, 0, {}), InputSignature({}, 1, {}), InputSignature({}, 2, {})}},
{"largest 3 stereo sets",
{InputSignature({}, 4, {}), InputSignature({}, 5, {}), InputSignature({}, 6, {})}},
{"smallest 3 stereo sets (disparity count templated only)",
{InputSignature({}, 0, true), InputSignature({}, 1, true), InputSignature({}, 2, true)}},
{"largest 3 stereo sets (disparity count templated only)",
{InputSignature({}, 4, true), InputSignature({}, 5, true), InputSignature({}, 6, true)}},
{"smallest 3 stereo sets (disparity count not templated only)",
{InputSignature({}, 0, false), InputSignature({}, 1, false), InputSignature({}, 2, false)}},
{"largest 3 stereo sets (disparity count not templated only)",
{InputSignature({}, 4, false), InputSignature({}, 5, false), InputSignature({}, 6, false)}},
{"runs w/ disparity count templated",
{InputSignature({}, {}, true)}},
{"runs w/ disparity count not templated",
{InputSignature({}, {}, false)}}}
Class defines input signature for evaluation run that contains evaluation set number,...

Define subsets for evaluating run results on specified inputs
The first three stereo sets are labeled as "smallest 3 stereo sets"
The last three stereo sets (excluding "conesFullSized") are labeled as "largest 3 stereo sets".

Definition at line 74 of file BpEvaluationStereoSets.h.

◆ kGroundTruthDispFile

constexpr std::string_view beliefprop::kGroundTruthDispFile = "groundTruthDisparity.pgm"
constexpr

Definition at line 40 of file BpFileHandlingConsts.h.

◆ kHighValBp

template<typename T >
const T beliefprop::kHighValBp {std::numeric_limits<T>::max()}

High value for type to use if initializing to "high" value.

Definition at line 47 of file BpRunUtils.h.

◆ kHighValBpKernel

constexpr float beliefprop::kHighValBpKernel {32000.0f}
constexpr

High value as used in kernel currently hard-coded to be below maximum short value of 32767.

Definition at line 51 of file BpRunUtils.h.

◆ kImageHeightHeader

constexpr std::string_view beliefprop::kImageHeightHeader {"Image Height"}
constexpr

Definition at line 41 of file BpEvaluationStereoSets.h.

◆ kImageWidthHeader

constexpr std::string_view beliefprop::kImageWidthHeader {"Image Width"}
constexpr

Definition at line 40 of file BpEvaluationStereoSets.h.

◆ kInImagePossExtensions

constexpr std::string_view beliefprop::kInImagePossExtensions[] = {"pgm", "ppm"}
constexpr

Definition at line 39 of file BpFileHandlingConsts.h.

◆ kInitMValsPDimsHeader

constexpr std::string_view beliefprop::kInitMValsPDimsHeader {"Init Message Values Parallel Dimensions"}
constexpr

Definition at line 45 of file ParallelParamsBp.h.

◆ kLevelDCostBpTimeCTimeNames

constexpr std::array<std::array<std::string_view, 3>, 10> beliefprop::kLevelDCostBpTimeCTimeNames
constexpr
Initial value:
{
std::array<std::string_view, 3>{"Level 0 Data Costs", "Level 0 BP Runtime", "Level 0 Copy Runtime"},
std::array<std::string_view, 3>{"Level 1 Data Costs", "Level 1 BP Runtime", "Level 1 Copy Runtime"},
std::array<std::string_view, 3>{"Level 2 Data Costs", "Level 2 BP Runtime", "Level 2 Copy Runtime"},
std::array<std::string_view, 3>{"Level 3 Data Costs", "Level 3 BP Runtime", "Level 3 Copy Runtime"},
std::array<std::string_view, 3>{"Level 4 Data Costs", "Level 4 BP Runtime", "Level 4 Copy Runtime"},
std::array<std::string_view, 3>{"Level 5 Data Costs", "Level 5 BP Runtime", "Level 5 Copy Runtime"},
std::array<std::string_view, 3>{"Level 6 Data Costs", "Level 6 BP Runtime", "Level 6 Copy Runtime"},
std::array<std::string_view, 3>{"Level 7 Data Costs", "Level 7 BP Runtime", "Level 7 Copy Runtime"},
std::array<std::string_view, 3>{"Level 8 Data Costs", "Level 8 BP Runtime", "Level 8 Copy Runtime"},
std::array<std::string_view, 3>{"Level 9 Data Costs", "Level 9 BP Runtime", "Level 9 Copy Runtime"}
}

Constant consisting of arrays of string views for headers corresponding to timing of computation of data costs, bp runtime, and copy data runtime of each level.

Definition at line 39 of file DetailedTimingBpConsts.h.

◆ kLevelText

constexpr std::string_view beliefprop::kLevelText {"Level"}
constexpr

Definition at line 50 of file ParallelParamsBp.h.

◆ kMaxDiffCap

constexpr float beliefprop::kMaxDiffCap
constexpr
Initial value:
{
constexpr std::array< float, 4 > kDisparityDiffThresholds
Difference thresholds in output disparity for a computed disparity at a pixel to be considered a "bad...

Max difference in disparity for evaluation where disparity difference for each pixel is capped to minimize influence of outliers in the average difference across all pixels.

Definition at line 51 of file DisparityMapEvaluation.h.

◆ kMemAllocOptHeader

constexpr std::string_view beliefprop::kMemAllocOptHeader {"Memory allocation of all BP data run at or before start of run"}
constexpr

Definition at line 118 of file BpRunUtils.h.

◆ kMemoryCoalescedBpDataHeader

constexpr std::string_view beliefprop::kMemoryCoalescedBpDataHeader {"BP data arranged for memory coalescence"}
constexpr

Definition at line 119 of file BpRunUtils.h.

◆ kNumBpItersHeader

constexpr std::string_view beliefprop::kNumBpItersHeader {"Num BP Iterations"}
constexpr

Definition at line 60 of file BpSettings.h.

◆ kNumBpLevelsHeader

constexpr std::string_view beliefprop::kNumBpLevelsHeader {"Num BP Levels",}
constexpr

Definition at line 59 of file BpSettings.h.

◆ kNumCheckerboardParts

constexpr unsigned int beliefprop::kNumCheckerboardParts {2}
constexpr

Number of checkerboard parts for processing.

Definition at line 47 of file BpConstsEnumsAliases.h.

◆ kNumDispValsHeader

constexpr std::string_view beliefprop::kNumDispValsHeader {"Num Possible Disparity Values"}
constexpr

Definition at line 58 of file BpSettings.h.

◆ kNumEvalRuns

constexpr std::string_view beliefprop::kNumEvalRuns {"Number of evaluation runs"}
constexpr

Header for number of evaluation runs (can differ across stereo sets)

Definition at line 46 of file BpEvaluationStereoSets.h.

◆ kNumKernels

constexpr unsigned int beliefprop::kNumKernels {6}
constexpr

Definition at line 74 of file BpConstsEnumsAliases.h.

◆ kNumMessageArrays

constexpr unsigned int beliefprop::kNumMessageArrays {4}
constexpr

Number of message arrays in each checkerboard part.

Definition at line 50 of file BpConstsEnumsAliases.h.

◆ kNumParallelCPUThreadsHeader

constexpr std::string_view beliefprop::kNumParallelCPUThreadsHeader {"Number of parallel CPU threads in run"}
constexpr

Definition at line 44 of file RunBpOnStereoSetOptimizedCPU.h.

◆ kOptimizedIndexingSetting

constexpr bool beliefprop::kOptimizedIndexingSetting {true}
constexpr

Definition at line 114 of file BpRunUtils.h.

◆ kOutDispImageNameBase

constexpr std::string_view beliefprop::kOutDispImageNameBase = "computedDisparity"
constexpr

Definition at line 41 of file BpFileHandlingConsts.h.

◆ kPGMExt

constexpr std::string_view beliefprop::kPGMExt {"pgm"}
constexpr

Definition at line 45 of file BpImage.h.

◆ kPPMExt

constexpr std::string_view beliefprop::kPPMExt {"ppm"}
constexpr

Definition at line 46 of file BpImage.h.

◆ kRefImageName

constexpr std::string_view beliefprop::kRefImageName = "refImage"
constexpr

Definition at line 37 of file BpFileHandlingConsts.h.

◆ kStereoSetHeader

constexpr std::string_view beliefprop::kStereoSetHeader {"Stereo Set"}
constexpr

Definition at line 42 of file BpEvaluationStereoSets.h.

◆ kStereoSetsDirectoryName

constexpr std::string_view beliefprop::kStereoSetsDirectoryName = "BpStereoSets"
constexpr

Definition at line 43 of file BpFileHandlingConsts.h.

◆ kStereoSetsToProcess

constexpr std::array<BpStereoSet, 8> beliefprop::kStereoSetsToProcess
constexpr
Initial value:
{
BpStereoSet{"tsukubaSetHalfSize", 8, 32},
BpStereoSet{"tsukubaSet", 16, 16},
BpStereoSet{"venus", 21, 8},
BpStereoSet{"barn1", 32, 8},
BpStereoSet{"conesQuarterSize", 64, 4},
BpStereoSet{"conesHalfSize", 128, 2},
BpStereoSet{"conesFullSizeCropped", 256, 1},
BpStereoSet{"conesFullSize", 256, 1}
}

Declare stereo sets to process with name, num disparity values, and scale factor currently conesFullSize is not used.

Definition at line 60 of file BpEvaluationStereoSets.h.

◆ kTestImageName

constexpr std::string_view beliefprop::kTestImageName = "testImage"
constexpr

Definition at line 38 of file BpFileHandlingConsts.h.

◆ kTimingNames

const std::unordered_map<Runtime_Type, std::string_view> beliefprop::kTimingNames

Mapping of runtime segment enum to header describing timing of the segment.

Definition at line 67 of file DetailedTimingBpConsts.h.

◆ kUseOptMemManagement

constexpr bool beliefprop::kUseOptMemManagement {true}
constexpr

Definition at line 113 of file BpRunUtils.h.

◆ kUseWeightedRGBToGrayscaleConversion

constexpr bool beliefprop::kUseWeightedRGBToGrayscaleConversion {true}
constexpr

Definition at line 44 of file BpImage.h.