Density Slice

Sets all image values between the lower and upper threshold to one and the rest to zero.

Examples

C++

#include <iplt/image.hh>
#include <iplt/alg/density_slice.hh>

using namespace iplt;

int main() 
{
  ImageHandle img_real = LoadImage("...");
  img_real.ApplyIP( alg::DensitySlice(15,30) );

  return 0;
}

Python

img = LoadImage("...")
ds=alg.DensitySlice(15,30)
img.ApplyIP(ds)

Example images

original image after density slice

Back to Algorithm List

Attachments