diff --git a/test/performance_tests/opencl/performance_test_helper_opencl.cpp b/test/performance_tests/opencl/performance_test_helper_opencl.cpp index 8627ce6b8..1545e9eed 100644 --- a/test/performance_tests/opencl/performance_test_helper_opencl.cpp +++ b/test/performance_tests/opencl/performance_test_helper_opencl.cpp @@ -7,7 +7,7 @@ namespace Performance_Test { PenguinV_Image::Image uniformImage( uint32_t width, uint32_t height ) { - return uniformImage( width, height, randomValue( 256 ) ); + return uniformImage( width, height, randomValue( 255 ) ); } PenguinV_Image::Image uniformImage( uint32_t width, uint32_t height, uint8_t value ) diff --git a/test/performance_tests/performance_test_blob_detection.cpp b/test/performance_tests/performance_test_blob_detection.cpp index 3d8d71d23..7e1a391e6 100644 --- a/test/performance_tests/performance_test_blob_detection.cpp +++ b/test/performance_tests/performance_test_blob_detection.cpp @@ -8,7 +8,7 @@ namespace { Performance_Test::TimerContainer timer; - PenguinV_Image::Image image = Performance_Test::uniformImage( Performance_Test::randomValue( 1, 256 ), size, size ); + PenguinV_Image::Image image = Performance_Test::uniformImage( Performance_Test::randomValue( 1, 255 ), size, size ); for( uint32_t i = 0; i < Performance_Test::runCount(); ++i ) { timer.start(); diff --git a/test/performance_tests/performance_test_filtering.cpp b/test/performance_tests/performance_test_filtering.cpp index b42522857..22cce3490 100644 --- a/test/performance_tests/performance_test_filtering.cpp +++ b/test/performance_tests/performance_test_filtering.cpp @@ -25,7 +25,7 @@ namespace { Performance_Test::TimerContainer timer; - PenguinV_Image::Image input = Performance_Test::uniformImage( Performance_Test::randomValue( 1, 256 ), size, size ); + PenguinV_Image::Image input = Performance_Test::uniformImage( Performance_Test::randomValue( 1, 255 ), size, size ); PenguinV_Image::Image output( input.width(), input.height() ); for( uint32_t i = 0; i < Performance_Test::runCount(); ++i ) { diff --git a/test/performance_tests/performance_test_image_function.cpp b/test/performance_tests/performance_test_image_function.cpp index c3ff926ba..dc653efd0 100644 --- a/test/performance_tests/performance_test_image_function.cpp +++ b/test/performance_tests/performance_test_image_function.cpp @@ -133,7 +133,7 @@ namespace Function_Template std::pair < double, double > template_Fill( FillForm1 Fill, const std::string & namespaceName, uint32_t size ) { PenguinV_Image::Image image = Performance_Test::uniformImage( size, size ); - uint8_t value = Performance_Test::randomValue( 256 ); + uint8_t value = Performance_Test::randomValue( 255 ); TEST_FUNCTION_LOOP( Fill( image, value ), namespaceName ) } @@ -239,7 +239,7 @@ namespace Function_Template std::pair < double, double > template_Threshold( ThresholdForm2 Threshold, const std::string & namespaceName, uint32_t size ) { std::vector < PenguinV_Image::Image > image = Performance_Test::uniformImages( 2, size, size ); - uint8_t threshold = Performance_Test::randomValue( 256 ); + uint8_t threshold = Performance_Test::randomValue( 255 ); TEST_FUNCTION_LOOP( Threshold( image[0], image[1], threshold ), namespaceName ) } @@ -247,8 +247,8 @@ namespace Function_Template std::pair < double, double > template_ThresholdDouble( ThresholdDoubleForm2 Threshold, const std::string & namespaceName, uint32_t size ) { std::vector < PenguinV_Image::Image > image = Performance_Test::uniformImages( 2, size, size ); - uint8_t minThreshold = Performance_Test::randomValue( 256 ); - uint8_t maxThreshold = Performance_Test::randomValue( minThreshold, 256 ); + uint8_t minThreshold = Performance_Test::randomValue( 255 ); + uint8_t maxThreshold = Performance_Test::randomValue( minThreshold, 255 ); TEST_FUNCTION_LOOP( Threshold( image[0], image[1], minThreshold, maxThreshold ), namespaceName ) } diff --git a/test/test_helper.cpp b/test/test_helper.cpp index f87fe6261..7381ba163 100644 --- a/test/test_helper.cpp +++ b/test/test_helper.cpp @@ -34,7 +34,7 @@ namespace const uint8_t * outXEnd = outX + width; for( ; outX != outXEnd; ++outX ) - (*outX) = Test_Helper::randomValue( 256 ); + ( *outX ) = Test_Helper::randomValue( 255 ); } } @@ -45,7 +45,7 @@ namespace Test_Helper { PenguinV_Image::Image uniformImage( uint32_t width, uint32_t height, const PenguinV_Image::Image & reference ) { - return uniformImage( randomValue( 256 ), width, height, reference ); + return uniformImage( randomValue( 255 ), width, height, reference ); } PenguinV_Image::Image uniformImage( uint8_t value, uint32_t width, uint32_t height, const PenguinV_Image::Image & reference ) @@ -60,7 +60,7 @@ namespace Test_Helper PenguinV_Image::Image uniformRGBImage( const PenguinV_Image::Image & reference ) { - return uniformRGBImage( randomValue( 256 ), reference ); + return uniformRGBImage( randomValue( 255 ), reference ); } PenguinV_Image::Image uniformRGBImage( uint8_t value, const PenguinV_Image::Image & reference ) @@ -70,7 +70,7 @@ namespace Test_Helper PenguinV_Image::Image uniformRGBImage( uint32_t width, uint32_t height ) { - return uniformRGBImage( width, height, randomValue( 256 ) ); + return uniformRGBImage( width, height, randomValue( 255 ) ); } PenguinV_Image::Image uniformRGBImage( uint32_t width, uint32_t height, uint8_t value ) @@ -80,7 +80,7 @@ namespace Test_Helper PenguinV_Image::Image uniformRGBAImage( uint32_t width, uint32_t height ) { - return uniformRGBAImage( width, height, randomValue( 256 ) ); + return uniformRGBAImage( width, height, randomValue( 255 ) ); } PenguinV_Image::Image uniformRGBAImage( uint32_t width, uint32_t height, uint8_t value ) @@ -90,7 +90,7 @@ namespace Test_Helper PenguinV_Image::Image uniformRGBAImage( const PenguinV_Image::Image & reference ) { - return uniformRGBAImage( randomValue( 256 ), reference ); + return uniformRGBAImage( randomValue( 255 ), reference ); } PenguinV_Image::Image uniformRGBAImage( uint8_t value, const PenguinV_Image::Image & reference ) @@ -125,7 +125,7 @@ namespace Test_Helper std::vector intesity( images ); for( size_t i = 0u; i < intesity.size(); ++i ) - intesity[i] = randomValue( 256 ); + intesity[i] = randomValue( 255 ); return uniformImages( intesity, reference ); } diff --git a/test/test_helper.h b/test/test_helper.h index cd9d89114..438bd7768 100644 --- a/test/test_helper.h +++ b/test/test_helper.h @@ -37,7 +37,7 @@ namespace Test_Helper if( maximum == 0 ) return 0; else - return static_cast(static_cast(rand()) % maximum); + return static_cast( static_cast( rand() ) % ( maximum + 1 ) ); } template @@ -47,7 +47,7 @@ namespace Test_Helper return 0; } else { - data value = static_cast(static_cast(rand()) % maximum); + data value = static_cast( static_cast( rand() ) % ( maximum + 1 ) ); if( value < minimum ) value = minimum; diff --git a/test/unit_tests/cuda/unit_test_image_function_cuda.cpp b/test/unit_tests/cuda/unit_test_image_function_cuda.cpp index e18859cbf..128951adc 100644 --- a/test/unit_tests/cuda/unit_test_image_function_cuda.cpp +++ b/test/unit_tests/cuda/unit_test_image_function_cuda.cpp @@ -207,8 +207,8 @@ namespace image_function_cuda const std::vector < uint8_t > intensity = intensityArray( 2 ); PenguinV_Image::Image input = uniformImage( intensity[0], 0, 0, reference ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = input.width() % 2; const uint32_t yCorrection = input.height() % 2; @@ -249,8 +249,8 @@ namespace image_function_cuda const uint8_t intensityFill = intensityValue(); std::vector < PenguinV_Image::Image > input = uniformImages( intensity, reference ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = input[0].width() % 2; const uint32_t yCorrection = input[0].height() % 2; @@ -291,8 +291,8 @@ namespace image_function_cuda uint32_t roiX, roiY, roiWidth, roiHeight; generateRoi( input, roiX, roiY, roiWidth, roiHeight ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = roiWidth % 2; const uint32_t yCorrection = roiHeight % 2; @@ -337,8 +337,8 @@ namespace image_function_cuda uint32_t roiWidth, roiHeight; generateRoi( image, roiX, roiY, roiWidth, roiHeight ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = roiWidth % 2; const uint32_t yCorrection = roiHeight % 2; @@ -617,8 +617,8 @@ namespace image_function_cuda std::vector Y( X.size() ); for ( size_t j = 0; j < X.size(); ++j ) { - X[j] = randomValue( 0, image.width() ); - Y[j] = randomValue( 0, image.height() ); + X[j] = randomValue( 0, image.width() - 1 ); + Y[j] = randomValue( 0, image.height() - 1 ); } Image_Function_Cuda::SetPixel( image, X, Y, intensity[1] ); diff --git a/test/unit_tests/unit_test_blob_detection.cpp b/test/unit_tests/unit_test_blob_detection.cpp index 52a58c2e6..a85d27195 100644 --- a/test/unit_tests/unit_test_blob_detection.cpp +++ b/test/unit_tests/unit_test_blob_detection.cpp @@ -14,7 +14,7 @@ namespace blob_detection uint32_t roiWidth, roiHeight; Unit_Test::generateRoi( image, roiX, roiY, roiWidth, roiHeight ); - Unit_Test::fillImage( image, roiX, roiY, roiWidth, roiHeight, Unit_Test::randomValue( 1, 256 ) ); + Unit_Test::fillImage( image, roiX, roiY, roiWidth, roiHeight, Unit_Test::randomValue( 1, 255 ) ); Blob_Detection::BlobDetection detection; detection.find( image ); diff --git a/test/unit_tests/unit_test_edge_detection.cpp b/test/unit_tests/unit_test_edge_detection.cpp index 4a29d3dd2..cdbbc91c2 100644 --- a/test/unit_tests/unit_test_edge_detection.cpp +++ b/test/unit_tests/unit_test_edge_detection.cpp @@ -21,7 +21,7 @@ namespace edge_detection if ( !isValidLeftEdge && !isValidRightEdge ) continue; - Unit_Test::fillImage( image, roiX, roiY, roiWidth, roiHeight, Unit_Test::randomValue( 64, 256 ) ); + Unit_Test::fillImage( image, roiX, roiY, roiWidth, roiHeight, Unit_Test::randomValue( 64, 255 ) ); EdgeDetectionBase<_Type> edgeDetection; edgeDetection.find( image, EdgeParameter( EdgeParameter::LEFT_TO_RIGHT) ); @@ -63,7 +63,7 @@ namespace edge_detection if ( !isValidTopEdge && !isValidBottomEdge ) continue; - Unit_Test::fillImage( image, roiX, roiY, roiWidth, roiHeight, Unit_Test::randomValue( 64, 256 ) ); + Unit_Test::fillImage( image, roiX, roiY, roiWidth, roiHeight, Unit_Test::randomValue( 64, 255 ) ); EdgeDetectionBase<_Type> edgeDetection; edgeDetection.find( image, EdgeParameter( EdgeParameter::TOP_TO_BOTTOM) ); diff --git a/test/unit_tests/unit_test_fft.cpp b/test/unit_tests/unit_test_fft.cpp index 245ab205c..216688eb2 100644 --- a/test/unit_tests/unit_test_fft.cpp +++ b/test/unit_tests/unit_test_fft.cpp @@ -7,7 +7,7 @@ namespace fft bool RandomImageFFT() { for ( uint32_t i = 0u; i < 32u; ++i ) { // a special case for FFT because it take a lot of time for execution - const uint32_t dimension = (2u << Unit_Test::randomValue( 11 )); + const uint32_t dimension = ( 2u << Unit_Test::randomValue( 10 ) ); const PenguinV_Image::Image input = Unit_Test::randomImage( dimension, dimension ); diff --git a/test/unit_tests/unit_test_helper.cpp b/test/unit_tests/unit_test_helper.cpp index 2f74ad204..1ea23016c 100644 --- a/test/unit_tests/unit_test_helper.cpp +++ b/test/unit_tests/unit_test_helper.cpp @@ -259,8 +259,8 @@ namespace Unit_Test maximumHeight = im->second; } - width = randomValue( 1, maximumWidth + 1 ); - height = randomValue( 1, maximumHeight + 1 ); + width = randomValue( 1, maximumWidth ); + height = randomValue( 1, maximumHeight ); x.resize( imageSize.size() ); y.resize( imageSize.size() ); diff --git a/test/unit_tests/unit_test_helper.h b/test/unit_tests/unit_test_helper.h index cca455dd9..24fa016bd 100644 --- a/test/unit_tests/unit_test_helper.h +++ b/test/unit_tests/unit_test_helper.h @@ -75,8 +75,8 @@ namespace Unit_Test template void generateRoi( const PenguinV_Image::ImageTemplate<_Type> & image, uint32_t & x, uint32_t & y, uint32_t & width, uint32_t & height ) { - width = randomValue( 1, image.width() + 1 ); - height = randomValue( 1, image.height() + 1 ); + width = randomValue( 1, image.width() ); + height = randomValue( 1, image.height() ); x = randomValue( image.width() - width ); y = randomValue( image.height() - height ); diff --git a/test/unit_tests/unit_test_image_buffer.cpp b/test/unit_tests/unit_test_image_buffer.cpp index b2454e317..254ae7def 100644 --- a/test/unit_tests/unit_test_image_buffer.cpp +++ b/test/unit_tests/unit_test_image_buffer.cpp @@ -15,7 +15,7 @@ namespace template_image for( uint32_t i = 0; i < Unit_Test::runCount(); ++i ) { const uint32_t width = Unit_Test::randomValue( 2048 ); const uint32_t height = Unit_Test::randomValue( 2048 ); - const uint8_t colorCount = Unit_Test::randomValue( 1, 4 ); + const uint8_t colorCount = Unit_Test::randomValue( 1, 3 ); const uint8_t alignment = Unit_Test::randomValue( 1, 32 ); if( !Unit_Test::equalSize( PenguinV_Image::ImageTemplate < uint8_t >( width, height, colorCount, alignment ), width, height, @@ -32,7 +32,7 @@ namespace template_image PenguinV_Image::ImageTemplate < uint8_t > image; uint8_t fakeArray[1]; - uint8_t fakeValue = Unit_Test::randomValue( 2 ); + uint8_t fakeValue = Unit_Test::randomValue( 1 ); if( fakeValue == 1 ) fakeValue = 0; @@ -51,11 +51,11 @@ namespace template_image for( uint32_t i = 0; i < Unit_Test::runCount(); ++i ) { const uint32_t width = Unit_Test::randomValue( 1024 ); const uint32_t height = Unit_Test::randomValue( 1024 ); - const uint8_t colorCount = Unit_Test::randomValue( 1, 4 ); + const uint8_t colorCount = Unit_Test::randomValue( 1, 3 ); const uint8_t alignment = Unit_Test::randomValue( 1, 32 ); PenguinV_Image::ImageTemplate < _Type > image( width, height, colorCount, alignment ); - image.fill( static_cast<_Type>( Unit_Test::randomValue( 256u ) ) ); + image.fill( static_cast<_Type>( Unit_Test::randomValue( 255u ) ) ); const PenguinV_Image::ImageTemplate < _Type > image_copy( image ); @@ -72,11 +72,11 @@ namespace template_image for( uint32_t i = 0; i < Unit_Test::runCount(); ++i ) { const uint32_t width = Unit_Test::randomValue( 1024 ); const uint32_t height = Unit_Test::randomValue( 1024 ); - const uint8_t colorCount = Unit_Test::randomValue( 1, 4 ); + const uint8_t colorCount = Unit_Test::randomValue( 1, 3 ); const uint8_t alignment = Unit_Test::randomValue( 1, 32 ); PenguinV_Image::ImageTemplate < _Type > image( width, height, colorCount, alignment ); - image.fill( static_cast<_Type>( Unit_Test::randomValue( 256u ) ) ); + image.fill( static_cast<_Type>( Unit_Test::randomValue( 255u ) ) ); PenguinV_Image::ImageTemplate < _Type > image_copy; diff --git a/test/unit_tests/unit_test_image_function.cpp b/test/unit_tests/unit_test_image_function.cpp index 62e2bbb78..6c68b3e64 100644 --- a/test/unit_tests/unit_test_image_function.cpp +++ b/test/unit_tests/unit_test_image_function.cpp @@ -652,7 +652,7 @@ namespace Function_Template PenguinV_Image::Image input = uniformRGBImage( intensity[0] ); fillImage( input, 0, 0, input.width(), input.height(), intensity ); - const uint8_t channelId = randomValue( 3 ); + const uint8_t channelId = randomValue( 2 ); const PenguinV_Image::Image output = ExtractChannel( input, channelId ); @@ -665,7 +665,7 @@ namespace Function_Template PenguinV_Image::Image input = uniformRGBImage( intensity[0] ); fillImage( input, 0, 0, input.width(), input.height(), intensity ); - const uint8_t channelId = randomValue( 3 ); + const uint8_t channelId = randomValue( 2 ); PenguinV_Image::Image output = uniformImage( input.width(), input.height() ); ExtractChannel( input, output, channelId ); @@ -679,7 +679,7 @@ namespace Function_Template PenguinV_Image::Image input = uniformRGBImage( intensity[0] ); fillImage( input, 0, 0, input.width(), input.height(), intensity ); - const uint8_t channelId = randomValue( 3 ); + const uint8_t channelId = randomValue( 2 ); uint32_t roiX, roiY; uint32_t roiWidth, roiHeight; @@ -696,7 +696,7 @@ namespace Function_Template PenguinV_Image::Image input = uniformRGBImage( intensity[0] ); fillImage( input, 0, 0, input.width(), input.height(), intensity ); - const uint8_t channelId = randomValue( 3 ); + const uint8_t channelId = randomValue( 2 ); PenguinV_Image::Image output = uniformImage(); std::vector < std::pair > size( 2 ); @@ -740,8 +740,8 @@ namespace Function_Template const std::vector < uint8_t > intensity = intensityArray( 2 ); PenguinV_Image::Image input = uniformImage( intensity[0] ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = input.width() % 2; const uint32_t yCorrection = input.height() % 2; @@ -781,8 +781,8 @@ namespace Function_Template const uint8_t intensityFill = intensityValue(); std::vector < PenguinV_Image::Image > input = uniformImages( intensity ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = input[0].width() % 2; const uint32_t yCorrection = input[0].height() % 2; @@ -822,8 +822,8 @@ namespace Function_Template uint32_t roiX, roiY, roiWidth, roiHeight; generateRoi( input, roiX, roiY, roiWidth, roiHeight ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = roiWidth % 2; const uint32_t yCorrection = roiHeight % 2; @@ -867,8 +867,8 @@ namespace Function_Template uint32_t roiWidth, roiHeight; generateRoi( image, roiX, roiY, roiWidth, roiHeight ); - const bool horizontalFlip = (randomValue( 0, 2 ) == 0); - const bool verticalFlip = (randomValue( 0, 2 ) == 0); + const bool horizontalFlip = ( randomValue( 0, 1 ) == 0 ); + const bool verticalFlip = ( randomValue( 0, 1 ) == 0 ); const uint32_t xCorrection = roiWidth % 2; const uint32_t yCorrection = roiHeight % 2; @@ -1571,7 +1571,7 @@ namespace Function_Template const uint8_t intensity = intensityValue(); const PenguinV_Image::Image image = uniformImage( intensity ); - const bool horizontal = (randomValue(2) == 0); + const bool horizontal = ( randomValue( 1 ) == 0 ); std::vector < uint32_t > projection = ProjectionProfile( image, horizontal ); @@ -1586,7 +1586,7 @@ namespace Function_Template const uint8_t intensity = intensityValue(); const PenguinV_Image::Image image = uniformImage( intensity ); - const bool horizontal = (randomValue(2) == 0); + const bool horizontal = ( randomValue( 1 ) == 0 ); std::vector < uint32_t > projection; ProjectionProfile( image, horizontal, projection ); @@ -1605,7 +1605,7 @@ namespace Function_Template uint32_t roiX, roiY, roiWidth, roiHeight; generateRoi( image, roiX, roiY, roiWidth, roiHeight ); - const bool horizontal = (randomValue(2) == 0); + const bool horizontal = ( randomValue( 1 ) == 0 ); std::vector < uint32_t > projection = ProjectionProfile( image, roiX, roiY, roiWidth, roiHeight, horizontal ); @@ -1623,7 +1623,7 @@ namespace Function_Template uint32_t roiX, roiY, roiWidth, roiHeight; generateRoi( image, roiX, roiY, roiWidth, roiHeight ); - const bool horizontal = (randomValue(2) == 0); + const bool horizontal = ( randomValue( 1 ) == 0 ); std::vector < uint32_t > projection; ProjectionProfile( image, roiX, roiY, roiWidth, roiHeight, horizontal, projection ); @@ -1642,7 +1642,7 @@ namespace Function_Template output.fill( intensity[1] ); - const uint8_t channelId = randomValue( 3 ); + const uint8_t channelId = randomValue( 2 ); ReplaceChannel( input, output, channelId ); @@ -1667,7 +1667,7 @@ namespace Function_Template uint32_t roiWidth, roiHeight; generateRoi( size, roiX, roiY, roiWidth, roiHeight ); - const uint8_t channelId = randomValue( 3 ); + const uint8_t channelId = randomValue( 2 ); ReplaceChannel( input, roiX[0], roiY[0], output, roiX[1], roiY[1], roiWidth, roiHeight, channelId ); @@ -1935,8 +1935,8 @@ namespace Function_Template { const std::vector < uint8_t > intensity = intensityArray( 2 ); PenguinV_Image::Image image = uniformImage( intensity[0] ); - const uint32_t x = randomValue( 0, image.width() ); - const uint32_t y = randomValue( 0, image.height() ); + const uint32_t x = randomValue( 0, image.width() - 1 ); + const uint32_t y = randomValue( 0, image.height() - 1 ); SetPixel( image, x, y, intensity[1] ); @@ -1951,8 +1951,8 @@ namespace Function_Template std::vector< uint32_t > Y( X.size() ); for (size_t j = 0; j < X.size(); j++) { - X[j] = randomValue( 0, image.width() ); - Y[j] = randomValue( 0, image.height() ); + X[j] = randomValue( 0, image.width() - 1 ); + Y[j] = randomValue( 0, image.height() - 1 ); } SetPixel( image, X, Y, intensity[1] );