Package jjil.core

Examples of jjil.core.Error


        // Where -1 indicates matrix inversion of the 2x2 matrix (denoted B) formed from
        // the transposed vectors s12T and s13T.
        // Matrix inversion of a 2x2 matrix is easy.
        double detB = s12.getX() * s13.getY() - s13.getX() * s12.getY();
        if (detB == 0.0d) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            t1.toString(),
                            null,
                            null);
View Full Code Here


     * @param image the input image (output replaces input).
     * @throws jjil.core.Error if the input is not a Gray8Image.
     */
    public void push(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray8Image)) {
            throw new Error(
                    Error.PACKAGE.ALGORITHM,
                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
View Full Code Here

     * @throws jjil.core.Error if the width or height is negative or zero.
     */
    public void setWindow(int cX, int cY, int nWidth, int nHeight)
      throws jjil.core.Error {
      if (nWidth <= 0 || nHeight <= 0) {
            throw new Error(
                Error.PACKAGE.ALGORITHM,
                ErrorCodes.OUTPUT_IMAGE_SIZE_NEGATIVE,
                new Integer(nWidth).toString(),
                new Integer(nHeight).toString(),
                null);
View Full Code Here

     * @throws jjil.core.Error if the input image is not gray,
     * or the trapezoid already specified extends outside its bounds.
     */
    public void push(Image image) throws jjil.core.Error {
        if (!(image instanceof Gray8Image)) {
            throw new Error(
            Error.PACKAGE.ALGORITHM,
            ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
            image.toString(),
            null,
            null);
View Full Code Here

     * @throws jjil.core.Error if the warp is not 2x3 or the warp is not
     * decomposable (warp[0][0] or warp[1][1] is 0).
     */
    public void setWarp(double[][] warp) throws jjil.core.Error {
        if (warp.length != 2 || warp[0].length != 3 || warp[1].length != 3) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_WRONG_SIZE,
                            warp.toString(),
                            null,
                            null);
        }
        double fDivisorY = warp[0][0] * warp[1][1] - warp[0][1] * warp[1][0];
        if (warp[0][0] == 0.0d || warp[1][1] == 0.0d || fDivisorY == 0.0d) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            warp.toString(),
                            null,
                            null);
View Full Code Here

            int cYSteps,
            double cMinSlope,
            double cMaxSlope,
            int cSlopeSteps) throws jjil.core.Error {
        if (cMaxY < cMinY) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_RANGE_NULL_OR_NEGATIVE,
                            new Integer(cMinY).toString(),
                            new Integer(cMaxY).toString(),
                            null);
        }
        this.cMinY = cMinY;
        this.cMaxY = cMaxY;
        if (cMaxSlope < cMinSlope) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_RANGE_NULL_OR_NEGATIVE,
                            new Double(cMinSlope).toString(),
                            new Double(cMaxSlope).toString(),
                            null);
        }
        if (cSlopeSteps <= 0) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            new Integer(cSlopeSteps).toString(),
                            new Integer(1).toString(),
                            new Integer(Integer.MAX_VALUE).toString());
        }
        if (cYSteps <= 0) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            jjil.algorithm.ErrorCodes.PARAMETER_OUT_OF_RANGE,
                            new Integer(cYSteps).toString(),
                            new Integer(1).toString(),
                            new Integer(Integer.MAX_VALUE).toString());
View Full Code Here

        /* fill the Hough accumulator
         */
        for (Enumeration e = points.elements(); e.hasMoreElements();) {
            Object o = e.nextElement();
            if (!(o instanceof Point)) {
                throw new Error(
                                Error.PACKAGE.ALGORITHM,
                                jjil.algorithm.ErrorCodes.OBJECT_NOT_EXPECTED_TYPE,
                                o.toString(),
                                "Point",
                                null);
View Full Code Here

    public void detect(Gray8Image imGray) throws jjil.core.Error {
        this.rc = new RectCollection();
       
        if (imGray.getWidth() < this.hcc.getWidth() ||
            imGray.getHeight() < this.hcc.getHeight()) {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.IMAGE_TOO_SMALL,
                            imGray.toString(),
                            this.hcc.toString(),
                            null);
View Full Code Here

    {
        Gray8Image imGray;
        if (image instanceof Gray8Image) {
            imGray = (Gray8Image) image;
        } else {
            throw new Error(
                            Error.PACKAGE.ALGORITHM,
                            ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                            image.toString(),
                            null,
                            null);
View Full Code Here

     * @throws jjil.core.Error if the input image is not gray.
     */
    public void push(Image image) throws jjil.core.Error
    {
        if (!(image instanceof Gray8Image)) {
            throw new Error(
                      Error.PACKAGE.ALGORITHM,
                      ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                      image.toString(),
                      null,
                      null);
View Full Code Here

TOP

Related Classes of jjil.core.Error

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.