Tabnine Logo
GThresholdImageOps.threshold
Code IndexAdd Tabnine to your IDE (free)

How to use
threshold
method
in
boofcv.alg.filter.binary.GThresholdImageOps

Best Java code snippets using boofcv.alg.filter.binary.GThresholdImageOps.threshold (Showing top 12 results out of 315)

origin: org.boofcv/boofcv-ip

@Override
public void process(T input, GrayU8 output) {
  GThresholdImageOps.threshold(input,output,threshold,down);
}
origin: org.boofcv/boofcv-ip

@Override
public void process(T input, GrayU8 output) {
  double threshold = GThresholdImageOps.computeEntropy(input, minValue, maxValue);
  GThresholdImageOps.threshold(input,output,threshold,down);
}
origin: org.boofcv/boofcv-ip

@Override
public void process(T input, GrayU8 output) {
  double threshold = GThresholdImageOps.computeOtsu(input,minValue,maxValue);
  GThresholdImageOps.threshold(input,output,threshold,down);
}
origin: org.boofcv/recognition

/**
 * Add a new pattern to be detected.  This function takes in a raw gray scale image and thresholds it.
 *
 * @param pattern Gray scale image of the pattern
 * @param threshold Threshold used to convert it into a binary image
 * @param lengthSide Length of a side on the square in world units.
 */
public void addPatternImage(T pattern, double threshold, double lengthSide) {
  GrayU8 binary = new GrayU8(pattern.width,pattern.height);
  GThresholdImageOps.threshold(pattern,binary,threshold,false);
  alg.addPattern(binary, lengthSide);
}
origin: org.boofcv/demonstrations

private synchronized void performWork() {
  if( filter == null )
    return;
  GThresholdImageOps.threshold(imageInput, imageBinary, selectThresh.getThreshold(), selectThresh.isDown());
  filter.process(imageBinary,imageOutput);
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      if (work == null || work.getWidth() != imageInput.width || work.getHeight() != imageInput.height) {
        work = new BufferedImage(imageInput.width, imageInput.height, BufferedImage.TYPE_INT_BGR);
      }
      VisualizeBinaryData.renderBinary(selectedVisualize, false, work);
      gui.setImage(work);
      gui.setPreferredSize(new Dimension(imageInput.width, imageInput.height));
      processedImage = true;
      gui.repaint();
    }
  });
}
origin: org.boofcv/recognition

GThresholdImageOps.threshold(grayNoBorder,binary,threshold,false);
origin: org.boofcv/demonstrations

private synchronized void performWork() {
  if( filter1 == null || filter2 == null )
    return;
  GThresholdImageOps.threshold(imageInput, imageBinary, selectThresh.getThreshold(), selectThresh.isDown());
  filter1.process(imageBinary,imageOutput1);
  filter2.process(imageOutput1,imageOutput2);
  List<Contour> found = BinaryImageOps.contour(imageOutput2, connectRule, imageLabeled);
  if( colors == null || colors.length <= found.size() )
    colors = BinaryImageOps.selectRandomColors(found.size(),rand);
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      if (work == null || work.getWidth() != imageInput.width || work.getHeight() != imageInput.height) {
        work = new BufferedImage(imageInput.width, imageInput.height, BufferedImage.TYPE_INT_BGR);
      }
      renderVisualizeImage();
      gui.setImage(work);
      gui.setPreferredSize(new Dimension(imageInput.width, imageInput.height));
      processedImage = true;
      gui.repaint();
    }
  });
}
origin: org.boofcv/demonstrations

GThresholdImageOps.threshold(edgeIntensity,detected,30,false);
origin: org.boofcv/recognition

    new FDistort(inputGray,scaled).scaleExt().apply();
  GThresholdImageOps.threshold(scaled,binary,255/2.0,false);
} else {
  binary.setTo(inputBinary);
origin: org.boofcv/demonstrations

private void doProcess() {
  if( input == null )
    return;
  final BufferedImage temp;
  if( activeAlg == 0 ) {
    if( previousBlur != barCanny.getBlurRadius() ) {
      previousBlur = barCanny.getBlurRadius();
      canny =  FactoryEdgeDetectors.canny(previousBlur,true, true, imageType, derivType);
    }
    double thresh = barCanny.getThreshold()/100.0;
    canny.process(workImage,(float)thresh*0.1f,(float)thresh,null);
    List<EdgeContour> contours = canny.getContours();
    temp = VisualizeBinaryData.renderContours(contours,null,workImage.width,workImage.height,null);
  } else {
    // create a binary image by thresholding
    GThresholdImageOps.threshold(workImage, binary, barBinary.getThreshold(), barBinary.isDown());
    contour.process(binary,labeled);
    List<Contour> contours = BinaryImageOps.convertContours(contour);
    temp = VisualizeBinaryData.renderContours(contours,null,0xFF1010,
        workImage.width,workImage.height,null);
  }
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      panel.setImage(temp);
      panel.repaint();
    }});
}
origin: org.boofcv/feature

  @Override
  public List<LineSegment2D_F32> detect(T input) {

    derivX.reshape(input.width,input.height);
    derivY.reshape(input.width,input.height);
    edgeIntensity.reshape(input.width,input.height);
    detected.reshape(input.width,input.height);

    gradient.process(input,derivX,derivY);
    GGradientToEdgeFeatures.intensityAbs(derivX, derivY, edgeIntensity);
    GThresholdImageOps.threshold(edgeIntensity, detected, edgeThreshold, false);

    detectorGrid.process(derivX,derivY,detected);

    MatrixOfList<LineSegment2D_F32> grid = detectorGrid.getFoundLines();
    if( connect != null ) {
      connect.process(grid);
    }

    List<LineSegment2D_F32> found = grid.createSingleList();
    LineImageOps.mergeSimilar(found, (float) (Math.PI * 0.03), 5f);

    return found;
  }
}
origin: lessthanoptimal/BoofAndroidDemo

@Override
public void process(GrayU8 input) {
  GThresholdImageOps.threshold(input,binary,threshold, down);
boofcv.alg.filter.binaryGThresholdImageOpsthreshold

Javadoc

Applies a global threshold across the whole image. If 'down' is true, then pixels with values ≤ to 'threshold' are set to 1 and the others set to 0. If 'down' is false, then pixels with values > to 'threshold' are set to 1 and the others set to 0.

Popular methods of GThresholdImageOps

  • computeOtsu
    Computes the variance based Otsu threshold from a histogram directly. The threshold is selected by m
  • computeEntropy
    Computes a threshold which maximizes the entropy between the foreground and background regions. See
  • computeOtsu2
    Computes a modified modified Otsu threshold which maximizes the distance from the distributions mean
  • localGaussian
    Thresholds the image using a locally adaptive threshold that is computed using a local square regio
  • localMean
    Thresholds the image using a locally adaptive threshold that is computed using a local square regio

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JCheckBox (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now