population_sacha/Small_functions.cpp
// Set 0 pixels to 255, and all others to 0

Set 0 pixels to 255, and all others to 0
Set 0 pixels to 255 and all others to 0
pop::Mat2UI8 invertBinaryImage(pop::Mat2UI8 image)
{
	int size_i(image.sizeI());
	int size_j(image.sizeJ());
	for (int i=0; i<size_i; i++)
		for (int j=0; j<size_j; j++)
			image(i,j)=image(i,j)>0 ? int_black_pixel_color : int_white_pixel_color;
	return image;
}
pop :: Mat2UI8 invertBinaryImage ( pop :: Mat2UI8 image ) { int size_i ( image . sizeI ( ) ) ; int size_j ( image . sizeJ ( ) ) ; for ( int i = 0 ; i < size_i ; i ++ ) for ( int j = 0 ; j < size_j ; j ++ ) image ( i , j ) = image ( i , j ) > 0 ? int_black_pixel_color : int_white_pixel_color ; return image ; }
Set 0 pixels to 255, and all others to 0
Set 0 pixels to 255 and all others to 0