population_sacha/class_RLE_Image.cpp
// Calculate the intersection of two binary images

Calculate the intersection of two binary images
Calculate the intersection of two binary images
pop::Mat2UI8 elementwiseIntersect(pop::Mat2UI8 image1, pop::Mat2UI8 image2)
{
	int size_i (image1.sizeI());
	int size_j (image1.sizeJ());
	pop::Mat2UI8 output_image(size_i, size_j);
	for (int i=0; i<size_i; i++)
		for (int j=0; j<size_j; j++)
			output_image(i,j) = image1(i,j) && image2(i,j);
	return output_image;
}
pop :: Mat2UI8 elementwiseIntersect ( pop :: Mat2UI8 image1 , pop :: Mat2UI8 image2 ) { int size_i ( image1 . sizeI ( ) ) ; int size_j ( image1 . sizeJ ( ) ) ; pop :: Mat2UI8 output_image ( size_i , size_j ) ; for ( int i = 0 ; i < size_i ; i ++ ) for ( int j = 0 ; j < size_j ; j ++ ) output_image ( i , j ) = image1 ( i , j ) && image2 ( i , j ) ; return output_image ; }
Calculate the intersection of two binary images
Calculate the intersection of two binary images