C Image Processing Library
Generates adaptive mappings in both gray and color, testing individual parts. Uses pixGetBackgroundGrayMap(), pixGetInvBackgroundMap(), pixApplyInvBackgroundGrayMap(), pixGetBackgroundRGBMap(), pixBackgroundNorm().
Tests all the reg tests.
Tests transparency and cleaning under alpha.
Tests the alpha blending functions when used with various transforms (scaling, rotation, affine, projective, bilinear)
For each barcode in the image, if the barcode format is supported, this deskews and crops it, and then decodes it twice: (1) as is (deskewed) (2) after 180 degree rotation.
Demonstrates keystone warping correction using a projective transform and finding text baselines.
Exploration of various ways to bitwise compare two binary images.
This is a thorough regression test of different methods for doing binary morphology.
Thorough regression test for binary separable rasterops, using the sequence interpreters. This compares the results for 2-way composite Sels with unitary Sels, all invoked on the separable block morph ops.
This is a regression test of dwa functions.
Regression test for dwa brick morph operations.
Regression test for expanded dwa morph operations.
Regression test for pixBlendWithGrayMask().
Regression test for blending colormaps using pixBlendCmap().
Exploration of various pixel blending techniques.
Demonstrates using the bbuffer (byte buffer) operations.
Tests bytearray.c routines.
Comprehensive test for border-following representations of binary images.
Demonstrates using pixConnComp() and testing its speed.
Tests the "best" cc-preserving thinning functions. Displays all the strong cc-preserving 3x3 Sels.
Tests the examples in pixThinExamples().
Tests quantization of rgb image to a specific colormap. Does this by starting with a grayscale image, doing a grayscale quantization with a colormap in the dest, then adding new colors, scaling (which removes the colormap), and finally re-quantizing back to the original colormap.
Tests the ability to identify regions in HSV color space by analyzing the HS histogram and building masks that cover peaks in HS.
Tests color image morphology.
Regression test for various color quantizers.
This explores the space of the four parameters input for color segmentation: maxdist (the maximum distance between pixels that get clustered), selsize (responsible for smoothing the result), maxcolors and finalcolors.
Demonstrates unsupervised color segmentation using pixColorSegment().
Demonstrates comparing text pages using the location of word bounding boxes with pixGetWordBoxesInTextlines() and numaaCompareImagesByBoxes(), The goal is to get a fast and robust determination for whether two pages are the same.
Compares two images, using either the absolute value of the pixel differences or the difference clipped to 0.
Tests filters that select components based on size, areaPerimRatio, areaFraction, etc.
Regression test for connected components (both 4 and 8 connected), including regeneration of the original image from the components. This is also an implicit test of rasterop.
Enhances contrast of image using pixContrastTRC().
Regression test (_reg) for depth conversion functions including some of the octcube quantization.
Converts all image files in the given directory with matching substring to a pdf.
Converts all files in the given directory with matching substring to a level 3 compressed PostScript file, at the specified resolution.
Converts an image file from one format to another.
Converts all segmented image files in the given directory with matching substring to a mixed-raster pdf.
Converts all image files in a 'page' directory, using optional corresponding segmentation mask files in a 'mask' directory, to a level 2 compressed PostScript file.
Demonstrates converting a file to grayscale.
Convert any image file to PS for embedding.
Tests a number of convolution functions.
Demonstrates using pixFindCornerPixels().
Simple program that crops text pages to a given border.
Regression test for image dewarp based on text lines.
Demonstrates image dewarping based on text lines.
Extract barcode digits and put in a pixaa (a resource file for readnum.c).
This tests pixDistanceFunction() for a variety of usage with all 8 combinations of these parameters: connectivity (4 or 8), dest depth (8 or 16), and boundary cond (L_BOUNDARY_BG or L_BOUNDARY_FG).
Top-level fast binary morphology with auto-generated sels.
Generates the C code for the full set of linear Sels, for dilation, erosion, opening and closing, and for both horizontal and vertical operations, from length 2 to 63. These are put in files: dwalinear.3.c and dwalinearlow.3.c.
Low-level fast binary morphology with auto-generated sels.
Implements full regression test, including autogen of code, compilation, and running the result. (Works by running make so won't work under Windows)
Fairly thorough regression test for autogen'd dwa.
Demontrates edge detection using pixSobelEdgeFilter().
Enhance with various gamma TRC mappings, hue, saturation, contrast, and sharpening.
Tests the pixEqual() function in many situations. This also tests the quantization of grayscale and color images (to generate a colormapped image), and removal of the colormap to either RGB or grayscale.
Tests of various image expansion techniques.
Tests procedure for locating extrema (minima and maxima) of a sampled function.
Demonstrates conversion from grayscale to false color using pixConvertGrayToFalseColor(), where the colormap is modeled after the Matlab "jet" configuration.
This program is used to generate the two files of dwa code for combs, that are used in linear composite dwa operations for brick Sels. These two files, when compiled, are used to implement all the composite dwa operations for brick Sels, that are generated by selaAddDwaCombs().
Basic regression test for hit-miss transform: rasterops & dwa. Tests hmt from a set of hmt structuring elements by comparing the full image rasterop results with the automatically generated dwa results.
This program is used to generate the two files of dwa code for the hit-miss transform. These two files, when compiled, implement hit-miss dwa operations for all sels generated by selaAddHitMiss().
Returns information about the image data file.
Demonstrates using a hit-miss sel to find the letter "c" in feyn.tif.
Demonstrates generating a hit-miss sel by extracting the letter "c" and the word "Caltech" from feyn.tif and using pixGenerateSelRandom().
Demonstrates generating a hit-miss sel by extracting the letter "c" and the word "Caltech" from feyn.tif and using pixGenerateSelBoundary().
Uses pixGenerateSelBoundary() to generate hit-miss Sels that are a good fit for two 1 bpp patterns: a "T" in the banner name and the banner name ("Tribune").
Tests 90 degree orientation of text and whether the text is mirror reversed. Compares the rasterop with dwa implementations for speed. Shows the typical 'confidence' outputs from the functions in flipdetect.c.
Generates dwa code for hit-miss transform (hmt) that is used in pixPageFlipDetectDWA().
Basic regression test for erosion & dilation: rasterops & dwa. Tests erosion and dilation from 58 structuring elements by comparing the full image rasterop results with the automatically generated dwa results.
This program is used to generate the two files of dwa code for the basic morphological operations. These two files, when compiled, implement dwa operations for all sels generated by selaAddBasic().
This program can be used to generate characters for a font and save them in .pixa format.
This tests reading and writing gif for various image types.
(1) Tests the interpreter for grayscale morphology, as given in morphseq.c. (2) Tests composite operations: tophat and hdome. (3) Tests duality for grayscale erode/dilate, open/close, and black/white tophat. (4) Demonstrates closing plus white tophat. Note that this combination of operations can be quite useful. (5) Demonstrates a method of doing contrast enhancement by taking 3 * pixs and subtracting from this the closing and opening of pixs. (6) Playing around: extract the feynman diagrams from the stamp, using the tophat.
Compares graymorph results with special (3x1, 1x3, 3x3) cases against the general case.
Exploration of basic grayscale morphology.
Tests gray thresholding to 1, 2 and 4 bpp, with and without colormaps.
Regression test for pixBlendHardLight().
Tests the heap utility.
This is the primary Leptonica regression test for lossless read/write I/O to standard image files (png, tiff, bmp, etc.)
Tests all I/O except multipage/custom tiff and PostScript, which are separately tested in mtifftest and psiotest, respectively.
Demonstrates unsupervised classification of collections of connected components in binary images using jbCorrelation().
Demonstrates unsupervised classification of collections of connected components in binary images using jbRankHaus().
Demonstrates extracting and classifying words in textline order.
Test kernel creation, convolution,.
Demonstrates removing dark lines from a light pencil drawing (see http://leptonica.com/line-removal.html for details).
Shows two ways to normalize a document image for uneven illumination. It is somewhat more complicated than using the morphological tophat.
Makes Figures 7-8 in Chapter 18, "Document Image Applications" of the book "Mathematical morphology: from theory to applications"; demonstrates use of pixGenerateSelBoundary() to generate a hit-miss Sel.
Makes all the figures in Chapter 18, "Document Image Applications" of the book "Mathematical morphology: from theory to applications", edited by Laurent Najman and hugues Talbot. Published by Hermes Scientific Publishing, Ltd, 2010.
Generates an image of the set of 4 HMT Sels that are used for counting ascenders and descenders to detect text orientation.
Makes Figures 2-5 in Chapter 18, "Document Image Applications" of the book "Mathematical morphology: from theory to applications"; demonstrates page segmentation.
Makes Figure 1 in Chapter 18, "Document Image Applications" of the book "Mathematical morphology: from theory to applications"; demonstrates page segmentation.
Makes Figure 9 in Chapter 18, "Document Image Applications" of the book "Mathematical morphology: from theory to applications"; demonstrates tophat background cleaning.
Tests pix3.c boolean operations.
Generates a single image tiling of all images of a specific depth in a directory.
Tests the functions in maze.c: binary and gray maze search, largest rectangle in bg or fg.
Demonstrates: Combining two grayscale images using a mask with pixCombineMaskedGeneral() Combining two binary images using a mask with pixCombineMaskedGeneral() Doing a restricted seedfill with pixSeedfillBinaryRestricted() Colorizing a grayscale image with pixaDisplayRandomCmap() Converting color images to grayscale with pixConvertRGBToGray()
Demonstrates modifying the hue and saturation of an image.
Simple regression test for binary morph sequence (interpreter), showing display mode and rejection of invalid sequence components.
Exploration of rasterop-based morphological operations.
Exploration of multi-page tiff I/O and writing special tiff tags.
Generates histogram rank vs value & value vs rank plots.
Demonstrates theory behind Otsu splitting by generating plots of histogram and Otsu score function.
Demonstrates the usefulness of the modified version of Otsu for thresholding an image that doesn't have a well-defined background color.
Tests the function that combines boxes that overlap into their bounding regions.
Demonstrates Top level page segmentation using pixGetRegionsBinary().
Demonstrates the use of binary morphology for some simple and fast document segmentation operations using: pixScaleToGray2(), pixReduceRankBinaryCascade(), pixOpenBrick(), pixCloseSafeBrick(), pixSeedfillBinary(), pixMorphCompSequence(), pixGetOuterBordersPtaa(). Probably same basic thing that pixGetRegionsBinary() does?
Regression test for painting through a mask onto various depth images.
Demonstrates Bruel algorithm for extracting large whitespace boxes from a binary image using boxaGetWhiteblocks().
Tests PDF file I/O.
Generates segmented images and encodes them efficiently in a mixed-raster pdf.
Tests various replacement functions on pixa.
Regression test of pix splitting and pix array handling using pixaSplitPix().
Exercises various pixaDisplay*() functions: pixaDisplay(), pixaDisplayRandomCmap(), pixaDisplayOnLattice(), pixaDisplayUnsplit(), pixaDisplayTiled(), pixaDisplayTiledInRows(), and pixaDisplayTiledAndScaled().
Tests custom pix allocator.
Regression test for compressed pix and compressed pix arrays in memory.
Tests the fast (uncompressed) serialization of pix to a string in memory and the deserialization back to a pix.
Regression test of the gplot library functions that generate the plot commands and data required for input to gnuplot.
Tests reading and writing of images in PNG format for various depths, with and without colormaps.
Prints an image file.
Prints an image file on multiple pages.
Prints a multipage tiff file to a printer.
Tests projection stats for rows and columns.
Tests writing of images in PS, with arbitrary scaling and translation, in the following formats: uncompressed DCT compressed (jpeg for 8 bpp grayscale and RGB) CCITT-G4 compressed (g4 fax compression for 1 bpp) Flate compressed (gzip compression)
This tests the PostScript output for images with mixed text and images, coming from source of different depths, with and without colormaps. Illustrates binary halftone segmentation, combining images with masks, PS generation.
Tests quadtree statistical functions.
Tests rank filters on 8 and 32 bpp images.
This is a fairly rigorous test of rasterop. It demonstrates both that the results are correct with many different rop configurations, and, if done under valgrind, that no memory violations occur.
Tests in-place operation using the general 2-image pixRasterop(). The in-place operation works because there is no overlap between the src and dest rectangles.
Generate reduced image via a rank binary cascade of up to four 2x reductions using pixReduceRankBinaryCascade().
Removes colormap from image.
Exploration of various text drawing techniques.
Regression test for rotation by shear and area mapping. Displays results when images are rotated sequentially multiple times.
Regression test for rotation by shear, sampling and area mapping. Displays results from all the various types of rotations.
Alternative (slightly slower) method for rotating color images, with antialiasing. This is here just for comparison with the better methods in the library.
Regression test for all rotateorth functions.
Exploration of 90 and 180 degree rotations.
Exploration of image rotation techniques.
Demonstrates image rotation.
Demonstrates labeling pixels by membership in runs using pixRunlengthTransform().
This tests a number of scaling operations, through the pixScale() interface.
Generates a single image tiling of all images in a directory whose filename contains a given substring.
Exploration of image scaling techniques.
Exploration of scale-to-gray and color scaling.
Exploration of hole-filling and seedfilling.
Tests the seedspreading (voronoi finding & filling) function for both 4 and 8 connectivity.
Runs a number of tests on reading and writing of Sels.
Generate unsharp mask of image.
Regression test for quadratic shear, both sampled and interpolated.
Regression test for shear, both IP and to new pix.
Exploration of image shearing techniques.
Generates edges by using pixHalfEdgeByBandpass(), along with thresholding.
Regression test for skew detection.
Exploration of various skew finding methods, optionally deskewing the input (binary) image. The best version does a linear sweep followed by a binary (angle-splitting) search.
This is a regression test for scaling and rotation. The question to be answered is: in the quantization, where, if anywhere, do we add 0.5? The answer is that it should usually, but not always, be omitted. To see this, we operate on a very small pix and for visualization, scale up with replication to avoid aliasing and shifting.
Analyzes edges of a 1 bpp (connected component) image for smoothness.
Demonstrates adjusting one or more colors to a target color using pixSnapColor().
Demonstrates sorting pix arrays.
Regression test for splittings of a single component and for an image composed of several components, using different components and parameters.
Generates pdf of image tiles. Rotates the image before tiling if the tiles otherwise will have larger width than height.
This tests several sarray functions.
Regression test for subpixel scaling.
Tests sudoku solver.
Exploration of ways to find textline masks for very simple geometries. To do this task for more general layout, use pagesegtest* programs.
Regression test for in-place translation.
Generate gamma adjusted image using pixGammaTRC().
Generate smaller images for viewing and write html.
Tests stereoscopic warp and associated shear and stretching functions. Uses gthumb for visually identifying problems.
Demonstrates finding word boxes in line order by using pixGetWordBoxesInTextlines().
Writes all matched files into a multipage tiff.
Regression test for writing a block of text in one of 4 locations relative to a pix. This tests writing on 8 different types of images.
Tests ordered box transforms (rotation, scaling, translation). Also tests the various box hashing graphics operations.
Display an image with xv.
Tests the YUV to RGB conversion.
and == NULL, or v.v.). (4) If both
Input: dir (directory name; use '.' for local dir; no trailing '/' and is invalid) tail (<optional> tailname, including extension if any; can be null or empty but can't contain '/') usetime (1 to include current time in microseconds in the filename; 0 to omit. usepid (1 to include pid in filename; 0 to omit. Return: temp filename, or null on error
Notes: (1) Use unix-style pathname separators ('/'). (2) Specifying the root directory (
) is invalid. (3) Specifying a containing '/' is invalid. (4) The most general form ( = = 1) is: <dir>/<usec>_<pid>_<tail> When = 1, = 0, the output filename is: <dir>/<usec>_<tail> When = 0, = 1, the output filename is: <dir>/<pid>_<tail> When = = 0, the output filename is: <dir>/<tail> Note: It is not valid to have = null or empty and have both = = 0. That is, there must be some non-empty tail name. (5) N.B. The caller is responsible for freeing the returned filename. For windows, to avoid C-runtime boundary crossing problems when using DLLs, you must use lept_free() to free the name. (6) For windows, if the caller requests the directory '/tmp', this uses GetTempPath() to select the actual directory, avoiding platform-conditional code in use. The directory selected is <Temp>/leptonica, where <Temp> is the Windows temp directory. (7) Set = = 1 when (a) more than one process is writing and reading temp files, or (b) multiple threads from a single process call this function, or (c) there is the possiblity of an attack where the intruder is logged onto the server and might try to guess filenames.