congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
GrayS8.getWidth
Code IndexAdd Tabnine to your IDE (free)

How to use
getWidth
method
in
boofcv.struct.image.GrayS8

Best Java code snippets using boofcv.struct.image.GrayS8.getWidth (Showing top 6 results out of 315)

origin: org.boofcv/visualize

public static BufferedImage renderOrientation4(GrayS8 direction , GrayF32 intensity , float threshold , BufferedImage out ) {
    out = new BufferedImage(direction.getWidth(),direction.getHeight(),BufferedImage.TYPE_INT_RGB);
    int data[] = raster.getDataStorage();
    int w = direction.getWidth();
    int h = direction.getHeight();
origin: org.boofcv/boofcv-swing

public static BufferedImage renderOrientation4(GrayS8 direction , GrayF32 intensity , float threshold , BufferedImage out ) {
    out = new BufferedImage(direction.getWidth(),direction.getHeight(),BufferedImage.TYPE_INT_RGB);
    int offsetDst = ConvertRaster.getOffset(raster);
    int w = direction.getWidth();
    int h = direction.getHeight();
origin: org.boofcv/boofcv-ip

/**
 * Bounds image pixels to be between these two values
 * 
 * @param img Image
 * @param min minimum value.
 * @param max maximum value.
 */
public static void boundImage(GrayS8 img , int min , int max ) {
  final int h = img.getHeight();
  final int w = img.getWidth();
  byte[] data = img.data;
  for (int y = 0; y < h; y++) {
    int index = img.getStartIndex() + y * img.getStride();
    int indexEnd = index+w;
    // for(int x = 0; x < w; x++ ) {
    for (; index < indexEnd; index++) {
      int value = data[index];
      if( value < min )
        data[index] = (byte)min;
      else if( value > max )
        data[index] = (byte)max;
    }
  }
}
origin: org.boofcv/boofcv-ip

/**
 * <p>
 * Computes the absolute value of the difference between each pixel in the two images.<br>
 * d(x,y) = |img1(x,y) - img2(x,y)|
 * </p>
 * @param imgA Input image. Not modified.
 * @param imgB Input image. Not modified.
 * @param diff Absolute value of difference image. Modified.
 */
public static void diffAbs(GrayS8 imgA , GrayS8 imgB , GrayS8 diff ) {
  InputSanityCheck.checkSameShape(imgA,imgB,diff);
  
  final int h = imgA.getHeight();
  final int w = imgA.getWidth();
  for (int y = 0; y < h; y++) {
    int indexA = imgA.getStartIndex() + y * imgA.getStride();
    int indexB = imgB.getStartIndex() + y * imgB.getStride();
    int indexDiff = diff.getStartIndex() + y * diff.getStride();
    
    int indexEnd = indexA+w;
    // for(int x = 0; x < w; x++ ) {
    for (; indexA < indexEnd; indexA++, indexB++, indexDiff++ ) {
      diff.data[indexDiff] = (byte)Math.abs((imgA.data[indexA] ) - (imgB.data[indexB] ));
    }
  }
}
origin: org.boofcv/boofcv-ip

/**
 * <p>
 * Performs pixel-wise addition<br>
 * output(x,y) = imgA(x,y) + imgB(x,y)
 * </p>
 * @param imgA Input image. Not modified.
 * @param imgB Input image. Not modified.
 * @param output Output image. Modified.
 */
public static void add(GrayS8 imgA , GrayS8 imgB , GrayS16 output ) {
  InputSanityCheck.checkSameShape(imgA,imgB,output);
  
  final int h = imgA.getHeight();
  final int w = imgA.getWidth();
  for (int y = 0; y < h; y++) {
    int indexA = imgA.getStartIndex() + y * imgA.getStride();
    int indexB = imgB.getStartIndex() + y * imgB.getStride();
    int indexOut = output.getStartIndex() + y * output.getStride();
    
    int indexEnd = indexA+w;
    // for(int x = 0; x < w; x++ ) {
    for (; indexA < indexEnd; indexA++, indexB++, indexOut++ ) {
      output.data[indexOut] = (short)((imgA.data[indexA] ) + (imgB.data[indexB] ));
    }
  }
}
origin: org.boofcv/boofcv-ip

/**
 * <p>
 * Performs pixel-wise subtraction.<br>
 * output(x,y) = imgA(x,y) - imgB(x,y)
 * </p>
 * @param imgA Input image. Not modified.
 * @param imgB Input image. Not modified.
 * @param output Output image. Modified.
 */
public static void subtract(GrayS8 imgA , GrayS8 imgB , GrayS16 output ) {
  InputSanityCheck.checkSameShape(imgA,imgB,output);
  
  final int h = imgA.getHeight();
  final int w = imgA.getWidth();
  for (int y = 0; y < h; y++) {
    int indexA = imgA.getStartIndex() + y * imgA.getStride();
    int indexB = imgB.getStartIndex() + y * imgB.getStride();
    int indexOut = output.getStartIndex() + y * output.getStride();
    
    int indexEnd = indexA+w;
    // for(int x = 0; x < w; x++ ) {
    for (; indexA < indexEnd; indexA++, indexB++, indexOut++ ) {
      output.data[indexOut] = (short)((imgA.data[indexA] ) - (imgB.data[indexB] ));
    }
  }
}
boofcv.struct.imageGrayS8getWidth

Popular methods of GrayS8

  • getHeight
  • <init>
    Creates a new gray scale (single band/color) image.
  • get
  • getIndex
  • reshape
  • getStartIndex
  • getStride
  • isSubimage
  • set
  • setTo
  • unsafe_get
  • unsafe_get

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • String (java.lang)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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