diff --git a/benchmarks/ImageProcessing/BuddyRotate2DBenchmark.cpp b/benchmarks/ImageProcessing/BuddyRotate2DBenchmark.cpp index 7e2c7fc2..b2247410 100644 --- a/benchmarks/ImageProcessing/BuddyRotate2DBenchmark.cpp +++ b/benchmarks/ImageProcessing/BuddyRotate2DBenchmark.cpp @@ -36,11 +36,8 @@ float BuddyRotate2DAngle; // Define sizes of input. intptr_t sizesInputBuddyRotate2D[2]; -// Declare Angle option supported. -enum AngleOption { ANGLE_DEGREE, ANGLE_RADIAN }; - // Define Angle option selected. -AngleOption AngleType; +dip::ANGLE_TYPE AngleType; void initializeBuddyRotate2D(char **argv) { inputImageBuddyRotate2D = imread(argv[1], IMREAD_GRAYSCALE); @@ -49,9 +46,9 @@ void initializeBuddyRotate2D(char **argv) { sizesInputBuddyRotate2D[1] = inputImageBuddyRotate2D.cols; if (static_cast(argv[2]) == "DEGREE") { - AngleType = ANGLE_DEGREE; + AngleType = dip::ANGLE_TYPE::DEGREE; } else { - AngleType = ANGLE_RADIAN; + AngleType = dip::ANGLE_TYPE::RADIAN; } std::string argAngle = argv[3]; @@ -62,7 +59,7 @@ void initializeBuddyRotate2D(char **argv) { } } -static void Buddy_Rotate2D_ANGLE_DEGREE(benchmark::State &state) { +static void Buddy_Rotate2D_DEGREE(benchmark::State &state) { // Define the MemRef descriptor for input. Img inputBuddyRotate2D(inputImageBuddyRotate2D); @@ -90,8 +87,8 @@ static void Buddy_Rotate2D_ANGLE_RADIAN(benchmark::State &state) { // Register benchmarking function. void registerBenchmarkBuddyRotate2D() { - if (AngleType == ANGLE_DEGREE) { - BENCHMARK(Buddy_Rotate2D_ANGLE_DEGREE) + if (AngleType == dip::ANGLE_TYPE::DEGREE) { + BENCHMARK(Buddy_Rotate2D_DEGREE) ->Arg(1) ->Unit(benchmark::kMillisecond); } else { @@ -106,8 +103,8 @@ void generateResultBuddyRotate2D() { // Define the MemRef descriptor for input. Img input(inputImageBuddyRotate2D); MemRef output(sizesInputBuddyRotate2D); - // Run the resize 2D operation. - if (AngleType == ANGLE_DEGREE) { + // Run the rotate 2D operation. + if (AngleType == dip::ANGLE_TYPE::DEGREE) { // Call the MLIR Rotate2D function. output = dip::Rotate2D(&input, BuddyRotate2DAngle, dip::ANGLE_TYPE::DEGREE); @@ -117,7 +114,7 @@ void generateResultBuddyRotate2D() { dip::ANGLE_TYPE::RADIAN); } - // Define a cv::Mat with the output of the resize operation. + // Define a cv::Mat with the output of the rotate operation. Mat outputImage(output.getSizes()[0], output.getSizes()[1], CV_32FC1, output.getData()); diff --git a/benchmarks/ImageProcessing/OpenCVRotate2DBenchmark.cpp b/benchmarks/ImageProcessing/OpenCVRotate2DBenchmark.cpp index e04f9038..38d74e74 100644 --- a/benchmarks/ImageProcessing/OpenCVRotate2DBenchmark.cpp +++ b/benchmarks/ImageProcessing/OpenCVRotate2DBenchmark.cpp @@ -96,7 +96,7 @@ void registerBenchmarkOpenCVRotate2D() { // Generate result image. void generateResultOpenCVRotate2D() { - // Run the resize 2D operation. + // Run the rotate 2D operation. if (OpenCVAngleType == ANGLE_DEGREE && OpenCVRunRotate == true) { cv::rotate(inputImageOpenCVRotate2D, outputImageOpenCVRotate2D, OpenCVRotate2DAngle);