类 ImageUtil
- java.lang.Object
-
- cc.chungkwong.mathocr.offline.preprocessor.ImageUtil
-
public class ImageUtil extends Object
- 作者:
- Chan Chung Kwong
-
-
构造器概要
构造器 构造器 说明 ImageUtil()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static intaverageX(long[][] intImg, int width, int height, int i, int j, int dl, int dr)Compute the average x coordinate of nonzero pixelsstatic intaverageY(long[][] intImg, int width, int height, int i, int j, int dl, int dr)Compute the average y coordinate of nonzero pixelsstatic long[][]getIntegralImage(byte[] pixels, int width, int height)Create a integral imagestatic long[][]getSquaredIntegralImage(byte[] pixels, int width, int height)Create a squared integral imagestatic longwindowValue(long[][] intImg, int width, int height, int i, int j, int dl, int dr)Compute the sum of pixels in a window
-
-
-
方法详细资料
-
getIntegralImage
public static final long[][] getIntegralImage(byte[] pixels, int width, int height)Create a integral image- 参数:
pixels- the input grayscale picturewidth- the width of the pictureheight- the height of the picture- 返回:
- integral image
-
getSquaredIntegralImage
public static final long[][] getSquaredIntegralImage(byte[] pixels, int width, int height)Create a squared integral image- 参数:
pixels- the input grayscale picturewidth- the width of the pictureheight- the height of the picture- 返回:
- squared integral image
-
windowValue
public static final long windowValue(long[][] intImg, int width, int height, int i, int j, int dl, int dr)Compute the sum of pixels in a window- 参数:
intImg- the integral imagewidth- the width of the pictureheight- the height of the picturei- the x coordinatej- the y coordinatedl- left offsetdr- right offset- 返回:
- the sum
-
averageX
public static final int averageX(long[][] intImg, int width, int height, int i, int j, int dl, int dr)Compute the average x coordinate of nonzero pixels- 参数:
intImg- the integral imagewidth- the width of the pictureheight- the height of the picturei- the x coordinatej- the y coordinatedl- left offsetdr- right offset- 返回:
- the sum
-
averageY
public static final int averageY(long[][] intImg, int width, int height, int i, int j, int dl, int dr)Compute the average y coordinate of nonzero pixels- 参数:
intImg- the integral imagewidth- the width of the pictureheight- the height of the picturei- the x coordinatej- the y coordinatedl- left offsetdr- right offset- 返回:
- the sum
-
-