Class ImageLineIntegral
- java.lang.Object
-
- boofcv.alg.interpolate.ImageLineIntegral
-
public class ImageLineIntegral extends java.lang.ObjectComputes the line integral of a line segment across the image. A line is laid over the image and the fraction of the line which is over a pixel is multiplied by the pixel's value. This is done for each pixel it overlaps.
Two different functions are provided below for handling pixels lines which are either contained entirely inside the image or may contain elements which extend outside the image. If a pixel extends outside the image then
ImageBorderis used to handle the pixels outside the image. If the border is not specified then it will likely crash.Inside image definition:
0 &le x < width
0 &le y < height
-
-
Constructor Summary
Constructors Constructor and Description ImageLineIntegral()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecompute(double x0, double y0, double x1, double y1)Computes the line segment's line integral across the inside of the image.doublegetLength()Returns the line segment's lengthbooleanisInside(double x, double y)Return true if the coordinate is inside the image or false if not.
0 ≤ x ≤ width
0 ≤ y ≤ heightvoidsetImage(GImageGray image)Specify input image.
-
-
-
Method Detail
-
setImage
public void setImage(GImageGray image)
Specify input image.- Parameters:
image- image
-
compute
public double compute(double x0, double y0, double x1, double y1)Computes the line segment's line integral across the inside of the image. Where the inside is defined as 0 ≤ x ≤ width and 0 ≤ y ≤ height.- Parameters:
x0- end point of line segment. x-coordinatey0- end point of line segment. y-coordinatex1- end point of line segment. x-coordinatey1- end point of line segment. y-coordinate- Returns:
- line integral
-
isInside
public boolean isInside(double x, double y)Return true if the coordinate is inside the image or false if not.
0 ≤ x ≤ width
0 ≤ y ≤ heightNote: while the image is defined up to width and height, including coordinates up to that point contribute nothing towards the line integral since they are infinitesimally small.
- Parameters:
x- x-coordinate in pixel coordinatesy- y-coordinate in pixel coordinates- Returns:
- true if inside or false if outside
-
getLength
public double getLength()
Returns the line segment's length- Returns:
- length
-
-
DataMelt 3.0 © DataMelt by jWork.ORG