boofcv.alg.misc.ImageBandMath Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boofcv-ip Show documentation
Show all versions of boofcv-ip Show documentation
BoofCV is an open source Java library for real-time computer vision and robotics applications.
The newest version!
/*
* Copyright (c) 2021, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boofcv.alg.misc;
import boofcv.alg.misc.impl.ImplImageBandMath;
import boofcv.alg.misc.impl.ImplImageBandMath_MT;
import boofcv.concurrency.BoofConcurrency;
import boofcv.struct.image.*;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Generated;
/**
* DO NOT MODIFY: Generated by boofcv.alg.misc.GenerateImageBandMath.
*
* Collection of functions that project Bands of Planar images onto
* a single image. Can be used to perform projections such as
* minimum, maximum, average, median, standard Deviation.
*
* @author Nico Stuurman
* @author Peter Abeles
*/
@Generated("boofcv.alg.misc.GenerateImageBandMath")
@SuppressWarnings("Duplicates")
public class ImageBandMath {
public static > void checkInput( Planar input, int startBand, int lastBand ) {
if (startBand < 0 || lastBand < 0) {
throw new IllegalArgumentException("startBand or lastBand is less than zero");
}
if (startBand > lastBand) {
throw new IllegalArgumentException("startBand should <= lastBand");
}
if (lastBand >= input.getNumBands()) {
throw new IllegalArgumentException("lastBand should be less than number of Bands in input");
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayU8 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayU8 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayU8 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayU8 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayU8 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayU8 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayU8 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayU8 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayU8 output, @Nullable GrayU8 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayU8 output, @Nullable GrayU8 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayU8(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayS16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayS16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayS16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayS16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayS16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayS16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayS16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayS16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayS16 output, @Nullable GrayS16 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayS16 output, @Nullable GrayS16 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayS16(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayU16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayU16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayU16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayU16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayU16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayU16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayU16 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayU16 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayU16 output, @Nullable GrayU16 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayU16 output, @Nullable GrayU16 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayU16(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayS32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayS32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayS32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayS32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayS32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayS32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayS32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayS32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayS32 output, @Nullable GrayS32 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayS32 output, @Nullable GrayS32 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayS32(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayS64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayS64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayS64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayS64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayS64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayS64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayS64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayS64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayS64 output, @Nullable GrayS64 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayS64 output, @Nullable GrayS64 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayS64(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayF32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayF32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayF32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayF32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayF32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayF32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayF32 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayF32 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayF32 output, @Nullable GrayF32 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayF32 output, @Nullable GrayF32 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayF32(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
/**
* Computes the minimum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
*/
public static void minimum( Planar input, GrayF64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.minimum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the minimum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing minimum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void minimum( Planar input, GrayF64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.minimum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.minimum(input, output, startBand, lastBand);
}
}
/**
* Computes the maximum for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
*/
public static void maximum( Planar input, GrayF64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.maximum(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the maximum for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing maximum pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void maximum( Planar input, GrayF64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.maximum(input, output, startBand, lastBand);
} else {
ImplImageBandMath.maximum(input, output, startBand, lastBand);
}
}
/**
* Computes the average for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
*/
public static void average( Planar input, GrayF64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.average(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the average for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing average pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void average( Planar input, GrayF64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.average(input, output, startBand, lastBand);
} else {
ImplImageBandMath.average(input, output, startBand, lastBand);
}
}
/**
* Computes the median for each pixel across all bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
*/
public static void median( Planar input, GrayF64 output ) {
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, 0, input.getNumBands() - 1);
} else {
ImplImageBandMath.median(input, output, 0, input.getNumBands() - 1);
}
}
/**
* Computes the median for each pixel across selected bands in the {@link Planar} image.
*
* @param input Planar image
* @param output Gray scale image containing median pixel values
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void median( Planar input, GrayF64 output, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.median(input, output, startBand, lastBand);
} else {
ImplImageBandMath.median(input, output, startBand, lastBand);
}
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
*/
public static void stdDev( Planar input, GrayF64 output, @Nullable GrayF64 avg ) {
stdDev(input, output, avg, 0, input.getNumBands() - 1);
}
/**
* Computes the standard deviation for each pixel across all bands in the {@link Planar}
* image.
*
* @param input Planar image - not modified
* @param output Gray scale image containing average pixel values - modified
* @param avg Input Gray scale image containing average image. Can be null
* @param startBand First band to be included in the projection
* @param lastBand Last band to be included in the projection
*/
public static void stdDev( Planar input, GrayF64 output, @Nullable GrayF64 avg, int startBand, int lastBand ) {
checkInput(input, startBand, lastBand);
output.reshape(input.width, input.height);
if (avg == null) {
avg = new GrayF64(input.width, input.height);
average(input, avg, startBand, lastBand);
}
if (BoofConcurrency.USE_CONCURRENT) {
ImplImageBandMath_MT.stdDev(input, output, avg, startBand, lastBand);
} else {
ImplImageBandMath.stdDev(input, output, avg, startBand, lastBand);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy