palucdev / CudaOtsu

Otsu's method thresholding and image binarization on GPU in CUDA
MIT License
22 stars 10 forks source link

Improve command line arguments #12

Open WillNilges opened 1 year ago

WillNilges commented 1 year ago

I've found that the Help message is incorrect in its discription of how to lay out the command line arguments. You need to specify threads, blocks, and CPU cores.

my-laptop:CudaOtsu:% ./build/CudaOtsu ~/Pictures/sample_images/good/board.png 1024 2 12 --gpu

Setting OpenMP threads num to 12 threads
        [CPU-OpenMP] Threshold value: 168
CPU-OpenMP binarization taken 4.204969 seconds

        [GPU] Histogram calculated in 12.165824 milliseconds 

        [GPU] Histogram pixels: 14505216 

        [GPU] Threshold calculated in 0.043008 milliseconds 
        [GPU] Threshold value: 168

        [GPU] Binarized in 16.961857 milliseconds 

        [GPU] Total calculation time: 29.170689 milliseconds

If I don't include that 12, then it will run the CPU implementation.