Class SeamFinderMultiTest

    • Field Detail

      • EPSILON

        private static final double EPSILON
        Error tolerance for the minimum-cost seam.
        See Also:
        Constant Field Values
      • FILES

        private static final String[] FILES
        The image files (.png) and corresponding expected seam costs (.txt) in the BASE_PATH.
    • Constructor Detail

      • SeamFinderMultiTest

        SeamFinderMultiTest()
    • Method Detail

      • printFail

        private static void printFail​(double expectedEnergy,
                                      String seam,
                                      double seamEnergy,
                                      boolean isVertical)
        Prints information about a failed SeamFinder test case.
        Parameters:
        expectedEnergy - the expected energy for a minimum-cost seam.
        seam - the values of the seam computed by the testing algorithm.
        seamEnergy - the actual energy of the seam computed by the testing algorithm.
        isVertical - true if the seam is vertical.
      • getSeamEnergy

        private static double getSeamEnergy​(Picture picture,
                                            List<Integer> seam,
                                            boolean isVertical)
        Returns the energy of the given seam in the picture.
        Parameters:
        picture - the input picture.
        seam - the computed seam.
        isVertical - true if the seam is vertical.
        Returns:
        the energy of the given seam in the picture.
      • getExpectedSeamEnergy

        private static double getExpectedSeamEnergy​(String fileName,
                                                    boolean isVertical)
                                             throws FileNotFoundException
        Returns the expected energy for a minimum-cost seam in the picture corresponding to the file name.
        Parameters:
        fileName - the base file name of the picture.
        isVertical - true if the seam is vertical.
        Returns:
        the expected energy for a minimum-cost seam in the picture corresponding to the file name.
        Throws:
        FileNotFoundException - if the expected seam cost file for the given orientation is missing.