Threshold

Sets all image values below the threshold to zero and above the threshold to one.

Examples

C++

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

using namespace iplt;

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

  return 0;
}

Python

img = LoadImage("...")
ta=alg.Threshold(15)
img.ApplyIP(ta)

Example images

original image image after thresholding

Back to Algorithm List

Attachments