001/******************************************************************************* 002 * This software is provided as a supplement to the authors' textbooks on digital 003 * image processing published by Springer-Verlag in various languages and editions. 004 * Permission to use and distribute this software is granted under the BSD 2-Clause 005 * "Simplified" License (see http://opensource.org/licenses/BSD-2-Clause). 006 * Copyright (c) 2006-2023 Wilhelm Burger, Mark J. Burge. All rights reserved. 007 * Visit https://imagingbook.com for additional details. 008 ******************************************************************************/ 009package imagingbook.sampleimages; 010 011import imagingbook.core.resource.ImageResource; 012 013/** 014 * <p> 015 * Enumeration defining a set of {@link ImageResource} objects for selected sample images. 016 * Usage example: 017 * </p> 018 * <pre> 019 * import ij.process.ImageProcessor; 020 * import imagingbook.core.resource.ImageResource; 021 * import imagingbook.sampleimages.GeneralSampleImage; 022 * 023 * ImageResource ir = GeneralTestImage.Clown; 024 * ImageProcessor ip = ir.getImage().getProcessor(); 025 * // process ip ... 026 * </pre> 027 * @see ImageResource 028 * 029 */ 030public enum GeneralSampleImage implements ImageResource { 031 032 /** Original: https://imagej.nih.gov/ij/images/blobs.gif */ 033 Blobs, 034 035 /** Original: https://imagej.nih.gov/ij/images/boats.gif */ 036 Boats, 037 038 /** A simple binary shape image with 0/255 values. */ 039 Cat, 040 041 /** Original: https://imagej.nih.gov/ij/images/clown.png */ 042 Clown, 043 044 /** Original: https://imagej.nih.gov/ij/images/Dot_Blot.jpg */ 045 DotBlot, 046 DotBlotSmall, 047 048 /** Grayscale image used for SIFT demos. */ 049 IrishManor, 050 051 /** Original gray scan from Kepler manuscript. */ 052 Kepler, 053 054 /** Binary image with a single connected component. */ 055 MapleLeafSmall, 056 057 /** Small grayscale image. */ 058 MonasterySmall, 059 060 /** Binary image with straight lines embedded in noise. */ 061 NoisyLines, 062 /** Binary image with circles embedded in noise. */ 063 NoisyCircles, 064 /** Binary image with ellipses embedded in noise. */ 065 NoisyEllipses, 066 067 068 /** TIFF image with attached ROI selection, used for trigonometric Fourier descriptors. */ 069 HouseRoi("HouseRoi.tif"), 070 071 /** Fairly large binary image with 0/1 values. */ 072 RhinoBigCrop, 073 074 /** A small binary image with 0/255 values (white background = 255). */ 075 RhinoSmall, 076 077 /** A small binary image with 0/255 values and inverted LUT (white background = 0). */ 078 RhinoSmallInv, 079 080 /** Binary image with star-shaped regions, used for SIFT demos. */ 081 Stars, 082 083 /** Binary image with various tools, used for connected components segmentation. */ 084 ToolsSmall, 085 086 /** Color image, used for piecewise image warping. */ 087 WartburgSmall("WartburgSmall.jpg"), 088 089 /** Color image used for projective rectification. */ 090 PostalPackageSmall("PostalPackageSmall.jpg"), 091 092 /** Full-RGB color image used for various non-linear transformations. */ 093 Flower("Flower.jpg"), 094 095 /** Indexed color image with 256 colors. */ 096 FlowerIdx256("FlowerIdx256.tif"), 097 098 /** Grayscale image used for MSER feature detection. */ 099 MortarSmall, 100 101 /** Grayscale image used for SIFT feature detection. */ 102 Castle, 103 /** Grayscale stereo image used for SIFT feature detection and matching. */ 104 RamsesSmall, 105 /** A stack of 2 small grayscale stereo frames used for SIFT feature detection and matching. */ 106 RamsesSmallStack("RamsesSmallStack.tif"), 107 108 /** A stack of 2 small grayscale images used for linear blending. */ 109 ShipBeachSmallStack("ShipBeachSmallStack.tif"), 110 111 /** A stack of small grayscale images used for histogram specification/matching. */ 112 CityscapeSmallStack("CityscapeSmallStack.tif"), 113 114 /** A small color test image for evaluating effects of filters in different color spaces. */ 115 ColorTest3, 116 117 /** A color image for testing color edge detectors. */ 118 Balloons600("Balloons600.jpg"), 119 120 /** A poor-quality, noisy color image for testing edge-preserving smoothing. */ 121 Postcard2c("Postcard2c.jpg"), 122 123 /** A binary image (inverted LUT) with circles and squares for chamfer matching. */ 124 CirclesSquares, 125 126 ; 127 128 // ------------------------------------------------------------------------------- 129 130 private final String filename; 131 132 GeneralSampleImage() { 133 this((String) null); 134 } 135 136 GeneralSampleImage(String filename) { 137 this.filename = filename; 138 } 139 140 @Override 141 public String getFileName() { 142 return (this.filename != null) ? this.filename : this.autoName(); 143 } 144 145 // public static void main(String[] args) { 146 // ImageResource ir = GeneralSampleImage.Balloons600; 147 // System.out.println(ir.getRelativePath()); 148 // // System.out.println(ir.getImagePlus()); 149 // } 150}