Class HoughSpaceLines
- java.lang.Object
-
- science.aist.imaging.core.imageprocessing.houghspace.HoughSpaceLines
-
public class HoughSpaceLines extends Object
This class is used as a result for the houghspace
- Since:
- 1.0
- Author:
- Andreas Pointner, Gerald Zwettler
-
-
Constructor Summary
Constructors Constructor Description HoughSpaceLines(int width, int height, double maxRotation, double minRotation, double rotationSteps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getBestXYradInSector(int xMin, int xMax, int yMin, int yMax)
get the best value in a specific sectordouble[]
getBestXYradInSectorForRotation(int xMin, int xMax, int yMin, int yMax, double rotationMin, double rotationMax)
get the best value in a specific sector in a specific directiondouble
getHoughSpaceValue(int x, int y, int rotationIdx)
get a value from the hough spaceint
getNumOfRotations()
double[]
getXBestXYradInSector(int best, int xMin, int xMax, int yMin, int yMax)
get the x best value in a specific sectorvoid
setHoughSpaceValue(int x, int y, int rotationIdx, double value)
set a value into the hough space<T> ImageWrapper<T>
toImage(int expoScale, @NonNull ImageFactory<T> provider)
extracts the best value for each point and adds it to the java image<T> ImageWrapper<T>
toImage(@NonNull ImageFactory<T> provider)
extracts the best value for each point and adds it to the java image
-
-
-
Constructor Detail
-
HoughSpaceLines
public HoughSpaceLines(int width, int height, double maxRotation, double minRotation, double rotationSteps)
- Parameters:
width
- width of the source imageheight
- height of the source imagemaxRotation
- end getRotation of the linesminRotation
- start getRotation of the linesrotationSteps
- getRotation steps in degrees
-
-
Method Detail
-
setHoughSpaceValue
public void setHoughSpaceValue(int x, int y, int rotationIdx, double value)
set a value into the hough space- Parameters:
x
- x-coordinatey
- y-coordinaterotationIdx
- getRotation indexvalue
- value
-
getHoughSpaceValue
public double getHoughSpaceValue(int x, int y, int rotationIdx)
get a value from the hough space- Parameters:
x
- x-coordinatey
- y-coordinaterotationIdx
- getRotation index- Returns:
- return value
-
getBestXYradInSector
public double[] getBestXYradInSector(int xMin, int xMax, int yMin, int yMax)
get the best value in a specific sector- Parameters:
xMin
- start search x-coordinatexMax
- end search x-coordinateyMin
- start search y-coordinateyMax
- end search y-coordinate- Returns:
- returns an array with [0] = x; [1] = y; [2] = getRotation
-
getXBestXYradInSector
public double[] getXBestXYradInSector(int best, int xMin, int xMax, int yMin, int yMax)
get the x best value in a specific sector- Parameters:
best
- which value should be found. e.g. 1 means best value. 2 means second best value. and so onxMin
- start search x-coordinatexMax
- end search x-coordinateyMin
- start search y-coordinateyMax
- end search y-coordinate- Returns:
- returns an array with [0] = x; [1] = y; [2] = getRotation
-
getBestXYradInSectorForRotation
public double[] getBestXYradInSectorForRotation(int xMin, int xMax, int yMin, int yMax, double rotationMin, double rotationMax)
get the best value in a specific sector in a specific direction- Parameters:
xMin
- start search x-coordinatexMax
- end search x-coordinateyMin
- start search y-coordinateyMax
- end search y-coordinaterotationMin
- getRotation in degrees where to startrotationMax
- getRotation in degrees where to end- Returns:
- returns an array with [0] = x; [1] = y; [2] = getRotation
-
getNumOfRotations
public int getNumOfRotations()
- Returns:
- number of getRotation (maxRotation - minRotation) / rotationStep + 0.5
-
toImage
public <T> ImageWrapper<T> toImage(int expoScale, @NonNull @NonNull ImageFactory<T> provider)
extracts the best value for each point and adds it to the java image- Type Parameters:
T
- The result type of the image.- Parameters:
expoScale
- the value how high the exponent should be for scalingprovider
- the provider to create the resulting image- Returns:
- a java image representation of the hough space
-
toImage
public <T> ImageWrapper<T> toImage(@NonNull @NonNull ImageFactory<T> provider)
extracts the best value for each point and adds it to the java image- Type Parameters:
T
- The type of the resulting image- Parameters:
provider
- The image provider used to create the result image.- Returns:
- a java image representation of the hough space
-
-