![]() |
Leptonica
1.77.0
Image processing and image analysis suite
|
#include <string.h>#include <math.h>#include "allheaders.h"Go to the source code of this file.
Functions | |
| static l_int32 | numaExtendArray (NUMA *na) |
| static l_int32 | numaaExtendArray (NUMAA *naa) |
| NUMA * | numaCreate (l_int32 n) |
| NUMA * | numaCreateFromIArray (l_int32 *iarray, l_int32 size) |
| NUMA * | numaCreateFromFArray (l_float32 *farray, l_int32 size, l_int32 copyflag) |
| NUMA * | numaCreateFromString (const char *str) |
| void | numaDestroy (NUMA **pna) |
| NUMA * | numaCopy (NUMA *na) |
| NUMA * | numaClone (NUMA *na) |
| l_ok | numaEmpty (NUMA *na) |
| l_ok | numaAddNumber (NUMA *na, l_float32 val) |
| l_ok | numaInsertNumber (NUMA *na, l_int32 index, l_float32 val) |
| l_ok | numaRemoveNumber (NUMA *na, l_int32 index) |
| l_ok | numaReplaceNumber (NUMA *na, l_int32 index, l_float32 val) |
| l_int32 | numaGetCount (NUMA *na) |
| l_ok | numaSetCount (NUMA *na, l_int32 newcount) |
| l_ok | numaGetFValue (NUMA *na, l_int32 index, l_float32 *pval) |
| l_ok | numaGetIValue (NUMA *na, l_int32 index, l_int32 *pival) |
| l_ok | numaSetValue (NUMA *na, l_int32 index, l_float32 val) |
| l_ok | numaShiftValue (NUMA *na, l_int32 index, l_float32 diff) |
| l_int32 * | numaGetIArray (NUMA *na) |
| l_float32 * | numaGetFArray (NUMA *na, l_int32 copyflag) |
| l_int32 | numaGetRefcount (NUMA *na) |
| l_ok | numaChangeRefcount (NUMA *na, l_int32 delta) |
| l_ok | numaGetParameters (NUMA *na, l_float32 *pstartx, l_float32 *pdelx) |
| l_ok | numaSetParameters (NUMA *na, l_float32 startx, l_float32 delx) |
| l_ok | numaCopyParameters (NUMA *nad, NUMA *nas) |
| SARRAY * | numaConvertToSarray (NUMA *na, l_int32 size1, l_int32 size2, l_int32 addzeros, l_int32 type) |
| NUMA * | numaRead (const char *filename) |
| NUMA * | numaReadStream (FILE *fp) |
| NUMA * | numaReadMem (const l_uint8 *data, size_t size) |
| l_ok | numaWriteDebug (const char *filename, NUMA *na) |
| l_ok | numaWrite (const char *filename, NUMA *na) |
| l_ok | numaWriteStream (FILE *fp, NUMA *na) |
| l_ok | numaWriteMem (l_uint8 **pdata, size_t *psize, NUMA *na) |
| NUMAA * | numaaCreate (l_int32 n) |
| NUMAA * | numaaCreateFull (l_int32 nptr, l_int32 n) |
| l_ok | numaaTruncate (NUMAA *naa) |
| void | numaaDestroy (NUMAA **pnaa) |
| l_ok | numaaAddNuma (NUMAA *naa, NUMA *na, l_int32 copyflag) |
| l_int32 | numaaGetCount (NUMAA *naa) |
| l_int32 | numaaGetNumaCount (NUMAA *naa, l_int32 index) |
| l_int32 | numaaGetNumberCount (NUMAA *naa) |
| NUMA ** | numaaGetPtrArray (NUMAA *naa) |
| NUMA * | numaaGetNuma (NUMAA *naa, l_int32 index, l_int32 accessflag) |
| l_ok | numaaReplaceNuma (NUMAA *naa, l_int32 index, NUMA *na) |
| l_ok | numaaGetValue (NUMAA *naa, l_int32 i, l_int32 j, l_float32 *pfval, l_int32 *pival) |
| l_ok | numaaAddNumber (NUMAA *naa, l_int32 index, l_float32 val) |
| NUMAA * | numaaRead (const char *filename) |
| NUMAA * | numaaReadStream (FILE *fp) |
| NUMAA * | numaaReadMem (const l_uint8 *data, size_t size) |
| l_ok | numaaWrite (const char *filename, NUMAA *naa) |
| l_ok | numaaWriteStream (FILE *fp, NUMAA *naa) |
| l_ok | numaaWriteMem (l_uint8 **pdata, size_t *psize, NUMAA *naa) |
Variables | |
| static const l_int32 | INITIAL_PTR_ARRAYSIZE = 50 |
Numa creation, destruction, copy, clone, etc.
NUMA *numaCreate()
NUMA *numaCreateFromIArray()
NUMA *numaCreateFromFArray()
NUMA *numaCreateFromString()
void *numaDestroy()
NUMA *numaCopy()
NUMA *numaClone()
l_int32 numaEmpty()
Add/remove number (float or integer)
l_int32 numaAddNumber()
static l_int32 numaExtendArray()
l_int32 numaInsertNumber()
l_int32 numaRemoveNumber()
l_int32 numaReplaceNumber()
Numa accessors
l_int32 numaGetCount()
l_int32 numaSetCount()
l_int32 numaGetIValue()
l_int32 numaGetFValue()
l_int32 numaSetValue()
l_int32 numaShiftValue()
l_int32 *numaGetIArray()
l_float32 *numaGetFArray()
l_int32 numaGetRefcount()
l_int32 numaChangeRefcount()
l_int32 numaGetParameters()
l_int32 numaSetParameters()
l_int32 numaCopyParameters()
Convert to string array
SARRAY *numaConvertToSarray()
Serialize numa for I/O
NUMA *numaRead()
NUMA *numaReadStream()
NUMA *numaReadMem()
l_int32 numaWriteDebug()
l_int32 numaWrite()
l_int32 numaWriteStream()
l_int32 numaWriteMem()
Numaa creation, destruction, truncation
NUMAA *numaaCreate()
NUMAA *numaaCreateFull()
NUMAA *numaaTruncate()
void *numaaDestroy()
Add Numa to Numaa
l_int32 numaaAddNuma()
static l_int32 numaaExtendArray()
Numaa accessors
l_int32 numaaGetCount()
l_int32 numaaGetNumaCount()
l_int32 numaaGetNumberCount()
NUMA **numaaGetPtrArray()
NUMA *numaaGetNuma()
NUMA *numaaReplaceNuma()
l_int32 numaaGetValue()
l_int32 numaaAddNumber()
Serialize numaa for I/O
NUMAA *numaaRead()
NUMAA *numaaReadStream()
NUMAA *numaaReadMem()
l_int32 numaaWrite()
l_int32 numaaWriteStream()
l_int32 numaaWriteMem()
(1) The Numa is a struct holding an array of floats. It can also be used to store l_int32 values, with some loss of precision for floats larger than about 10 million. Use the L_Dna instead if integers larger than a few million need to be stored.
(2) Always use the accessors in this file, never the fields directly.
(3) Storing and retrieving numbers:
* to append a new number to the array, use numaAddNumber(). If the number is an int, it will will automatically be converted to l_float32 and stored.
* to reset a value stored in the array, use numaSetValue().
* to increment or decrement a value stored in the array,
use numaShiftValue().* to obtain a value from the array, use either numaGetIValue() or numaGetFValue(), depending on whether you are retrieving an integer or a float. This avoids doing an explicit cast, such as (a) return a l_float32 and cast it to an l_int32 (b) cast the return directly to (l_float32 *) to satisfy the function prototype, as in numaGetFValue(na, index, (l_float32 *)&ival); [ugly!]
(4) int <–> float conversions:Tradition dictates that type conversions go automatically from l_int32 --> l_float32, even though it is possible to lose precision for large integers, whereas you must cast (l_int32) to go from l_float32 --> l_int32 because you're truncating to the integer value.
(5) As with other arrays in leptonica, the numa has both an allocated
size and a count of the stored numbers. When you add a number, it
goes on the end of the array, and causes a realloc if the array
is already filled. However, in situations where you want to
add numbers randomly into an array, such as when you build a
histogram, you must set the count of stored numbers in advance.
This is done with numaSetCount(). If you set a count larger
than the allocated array, it does a realloc to the size requested. (6) In situations where the data in a numa correspond to a function
y(x), the values can be either at equal spacings in x or at
arbitrary spacings. For the former, we can represent all x values
by two parameters: startx (corresponding to y[0]) and delx
for the change in x for adjacent values y[i] and y[i+1].
startx and delx are initialized to 0.0 and 1.0, rsp.
For arbitrary spacings, we use a second numa, and the two
numas are typically denoted nay and nax. (7) The numa is also the basic struct used for histograms. Every numa
has startx and delx fields, initialized to 0.0 and 1.0, that can
be used to represent the "x" value for the location of the
first bin and the bin width, respectively. Accessors are the
numa*Parameters() functions. All functions that make numa
histograms must set these fields properly, and many functions
that use numa histograms rely on the correctness of these values.
Definition in file numabasic.c.
| [in] | naa | |
| [in] | na | to be added |
| [in] | copyflag | L_INSERT, L_COPY, L_CLONE |
Definition at line 1482 of file numabasic.c.
References L_CLONE, L_COPY, L_INSERT, Numaa::n, Numaa::nalloc, Numaa::numa, numaaExtendArray(), numaaGetCount(), numaClone(), and numaCopy().
Referenced by boxaExtractSortedPattern(), boxaFindNearestBoxes(), boxaSort2d(), ccbaGenerateStepChains(), ccbaReadStream(), l_uncompressGrayHistograms(), numaaCreateFull(), numaaJoin(), numaaReadStream(), pixGetGrayHistogramTiled(), ptraConcatenatePdfToData(), and recogExtractNumbers().
| l_ok numaaAddNumber | ( | NUMAA * | naa, |
| l_int32 | index, | ||
| l_float32 | val | ||
| ) |
| [in] | naa | |
| [in] | index | of numa within numaa |
| [in] | val | float or int to be added; stored as a float |
Notes:
(1) Adds to an existing numa only.
Definition at line 1771 of file numabasic.c.
References L_CLONE, numaAddNumber(), numaaGetCount(), numaaGetNuma(), and numaDestroy().
Referenced by boxaSort2d(), and recogTrainingFinished().
| NUMAA* numaaCreate | ( | l_int32 | n | ) |
| [in] | n | size of numa ptr array to be alloc'd 0 for default |
Definition at line 1340 of file numabasic.c.
Referenced by boxaExtractSortedPattern(), boxaFindNearestBoxes(), boxaSort2d(), ccbaGenerateStepChains(), ccbaReadStream(), l_uncompressGrayHistograms(), numaaCreateFull(), numaaReadStream(), pixGetGrayHistogramTiled(), ptraConcatenatePdfToData(), and recogExtractNumbers().
| NUMAA* numaaCreateFull | ( | l_int32 | nptr, |
| l_int32 | n | ||
| ) |
| [in] | nptr | size of numa ptr array to be alloc'd |
| [in] | n | size of individual numa arrays to be allocated to 0 for default |
Notes:
(1) This allocates numaa and fills the array with allocated numas.
In use, after calling this function, use
numaaAddNumber(naa, index, val);
to add val to the index-th numa in naa.
Definition at line 1379 of file numabasic.c.
References L_INSERT, numaaAddNuma(), numaaCreate(), and numaCreate().
Referenced by recogTrainingFinished().
| l_ok numaAddNumber | ( | NUMA * | na, |
| l_float32 | val | ||
| ) |
| [in] | na | |
| [in] | val | float or int to be added; stored as a float |
Definition at line 473 of file numabasic.c.
References Numa::array, Numa::n, Numa::nalloc, numaExtendArray(), and numaGetCount().
Referenced by addColorizedGrayToCmap(), bmfGetWordWidths(), boxaaFlattenToBoxa(), boxaBinSort(), boxaExtractAsNuma(), boxaExtractSortedPattern(), boxaFindNearestBoxes(), boxaGetSizes(), boxaMakeAreaIndicator(), boxaMakeSizeIndicator(), boxaMakeWHRatioIndicator(), boxaMedianDimensions(), boxaPlotSides(), boxaPlotSizes(), boxaReconcileSizeByMedian(), boxaSimilar(), boxaSizeConsistency1(), boxaSizeConsistency2(), boxaSort2d(), ccbaGenerateStepChains(), ccbaReadStream(), compareTilesByHisto(), dewarpaListPages(), dewarpaReadStream(), dewarpFindVertDisparity(), dewarpQuadraticLSF(), genConstrainedNumaInRange(), grayHistogramsToEMD(), grayInterHistogramStats(), l_dnaConvertToNuma(), l_uncompressGrayHistograms(), mergeLookup(), numaaAddNumber(), numaClipToInterval(), numaConvertToInt(), numaCopy(), numaCreateFromFArray(), numaCreateFromIArray(), numaCrossingsByPeaks(), numaCrossingsByThreshold(), numaDifferentiateInterval(), numaDiscretizeRankAndIntensity(), numaFindExtrema(), numaFindPeaks(), numaGammaTRC(), numaGetBinSortIndex(), numaGetCrossingDistances(), numaGetMedianDevFromMedian(), numaGetPartialSums(), numaGetPeakCentroids(), numaGetSortIndex(), numaInterpolateArbxInterval(), numaInterpolateEqxInterval(), numaJoin(), numaLocatePeakRanges(), numaLowPassIntervals(), numaMakeDelta(), numaMakeHistogramAuto(), numaMakeRankFromHistogram(), numaMakeSequence(), numaMakeThresholdIndicator(), numaNormalizeHistogram(), numaQuantizeCrossingsByWindow(), numaRandomPermutation(), numaReadStream(), numaRebinHistogram(), numaReverse(), numaSelectCrossingThreshold(), numaSortByIndex(), numaSplitDistribution(), numaSubsample(), numaThresholdEdges(), numaTransform(), numaUniformSampling(), numaWindowedMedian(), parseStringForNumbers(), pixaaDisplayByPixa(), pixaaFlattenToPixa(), pixaaGetCount(), pixaBinSort(), pixaComparePhotoRegionsByHisto(), pixaDisplayTiledInRows(), pixaFindAreaFraction(), pixaFindDimensions(), pixaFindPerimSizeRatio(), pixaFindPerimToAreaRatio(), pixaFindStrokeWidth(), pixaFindWidthHeightProduct(), pixaFindWidthHeightRatio(), pixaMakeSizeIndicator(), pixaSelectByNumConnComp(), pixcmapGetRankIntensity(), ptaConvertToNuma(), ptaGetCubicLSF(), ptaGetLinearLSF(), ptaGetQuadraticLSF(), ptaGetQuarticLSF(), ptaGetSortIndex(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptraConcatenatePdfToData(), recogAddMissingClassStrings(), recogAverageSamples(), recogExtractNumbers(), recogFilterPixaBySize(), recogMakeBootDigitTemplates(), recogShowMatchesInRange(), recogTransferRchToDid(), selaCreateFromFile(), transferRchToRcha(), and wshedSaveBasin().
| void numaaDestroy | ( | NUMAA ** | pnaa | ) |
| [in,out] | pnaa | to be destroyed and nulled, if it exists |
Definition at line 1444 of file numabasic.c.
References Numaa::n, Numaa::numa, and numaDestroy().
Referenced by boxaSort2d(), ccbaGenerateStepChains(), ccbDestroy(), numaaReadStream(), pixGetWordsInTextlines(), recogDestroy(), recogExtractNumbers(), and recogTrainingFinished().
|
static |
| [in] | naa |
Definition at line 1523 of file numabasic.c.
References Numaa::nalloc, Numaa::numa, and reallocNew().
Referenced by numaaAddNuma().
| l_int32 numaaGetCount | ( | NUMAA * | naa | ) |
| [in] | naa |
Definition at line 1550 of file numabasic.c.
References Numaa::n.
Referenced by boxaSort2dByIndex(), compareTilesByHisto(), gplotSimpleXYN(), grayHistogramsToEMD(), grayInterHistogramStats(), l_compressGrayHistograms(), numaaAddNuma(), numaaAddNumber(), numaaCompareImagesByBoxes(), numaaGetNumberCount(), numaaGetValue(), numaaJoin(), numaaReplaceNuma(), numaaTruncate(), numaaWriteStream(), and pixaSort2dByIndex().
| [in] | naa | |
| [in] | index | to the index-th numa |
| [in] | accessflag | L_COPY or L_CLONE |
Definition at line 1659 of file numabasic.c.
References L_CLONE, L_COPY, Numaa::n, Numaa::numa, numaClone(), and numaCopy().
Referenced by boxaSort2d(), boxaSort2dByIndex(), compareTilesByHisto(), grayHistogramsToEMD(), grayInterHistogramStats(), l_compressGrayHistograms(), numaaAddNumber(), numaaCompareImagesByBoxes(), numaaGetNumberCount(), numaaJoin(), numaaTruncate(), numaaWriteStream(), pixaSort2dByIndex(), and showExtractNumbers().
| l_int32 numaaGetNumaCount | ( | NUMAA * | naa, |
| l_int32 | index | ||
| ) |
| [in] | naa | |
| [in] | index | of numa in naa |
Definition at line 1568 of file numabasic.c.
References Numaa::n, Numaa::numa, and numaGetCount().
Referenced by grayInterHistogramStats(), and l_compressGrayHistograms().
| l_int32 numaaGetNumberCount | ( | NUMAA * | naa | ) |
| [in] | naa |
Definition at line 1589 of file numabasic.c.
References L_CLONE, numaaGetCount(), numaaGetNuma(), numaDestroy(), and numaGetCount().
Referenced by boxaSort2dByIndex(), grayHistogramsToEMD(), and pixaSort2dByIndex().
| [in] | naa |
Notes:
(1) This function is convenient for doing direct manipulation on
a fixed size array of Numas. To do this, it sets the count
to the full size of the allocated array of Numa ptrs.
The originating Numaa owns this array: DO NOT free it!
(2) Intended usage:
Numaa *naa = numaaCreate(n);
Numa **array = numaaGetPtrArray(naa);
... [manipulate Numas directly on the array]
numaaDestroy(&naa);
(3) Cautions:
~ Do not free this array; it is owned by tne Numaa.
~ Do not call any functions on the Numaa, other than
numaaDestroy() when you're finished with the array.
Adding a Numa will force a resize, destroying the ptr array.
~ Do not address the array outside its allocated size.
With the bare array, there are no protections. If the
allocated size is n, array[n] is an error.
Definition at line 1638 of file numabasic.c.
References Numaa::n, Numaa::nalloc, and Numaa::numa.
Referenced by numaaFlattenToNuma().
| l_ok numaaGetValue | ( | NUMAA * | naa, |
| l_int32 | i, | ||
| l_int32 | j, | ||
| l_float32 * | pfval, | ||
| l_int32 * | pival | ||
| ) |
| [in] | naa | |
| [in] | i | index of numa within numaa |
| [in] | j | index into numa |
| [out] | pfval | [optional] float value |
| [out] | pival | [optional] int value |
Definition at line 1728 of file numabasic.c.
References Numa::array, Numa::n, Numaa::numa, and numaaGetCount().
| NUMAA* numaaRead | ( | const char * | filename | ) |
| [in] | filename |
Definition at line 1803 of file numabasic.c.
References fopenReadStream(), and numaaReadStream().
| NUMAA* numaaReadMem | ( | const l_uint8 * | data, |
| size_t | size | ||
| ) |
| [in] | data | numaa serialization; in ascii |
| [in] | size | of data; can use strlen to get it |
Definition at line 1875 of file numabasic.c.
References L_Kernel::data, fopenReadFromMemory(), and numaaReadStream().
| NUMAA* numaaReadStream | ( | FILE * | fp | ) |
| [in] | fp | file stream |
Definition at line 1830 of file numabasic.c.
References L_INSERT, NUMA_VERSION_NUMBER, numaaAddNuma(), numaaCreate(), numaaDestroy(), and numaReadStream().
Referenced by numaaRead(), and numaaReadMem().
| [in] | naa | |
| [in] | index | to the index-th numa |
| [in] | na | insert and replace any existing one |
Notes:
(1) Any existing numa is destroyed, and the input one
is inserted in its place.
(2) If the index is invalid, return 1 (error)
Definition at line 1695 of file numabasic.c.
References Numaa::numa, numaaGetCount(), and numaDestroy().
Referenced by boxaSort2d().
| l_ok numaaTruncate | ( | NUMAA * | naa | ) |
| [in] | naa |
Notes:
(1) This identifies the largest index containing a numa that
has any numbers within it, destroys all numa beyond that
index, and resets the count.
Definition at line 1410 of file numabasic.c.
References L_CLONE, Numaa::n, Numaa::numa, numaaGetCount(), numaaGetNuma(), numaDestroy(), and numaGetCount().
Referenced by recogTrainingFinished().
| l_ok numaaWrite | ( | const char * | filename, |
| NUMAA * | naa | ||
| ) |
| [in] | filename | |
| [in] | naa |
Definition at line 1903 of file numabasic.c.
References fopenWriteStream(), and numaaWriteStream().
| l_ok numaaWriteMem | ( | l_uint8 ** | pdata, |
| size_t * | psize, | ||
| NUMAA * | naa | ||
| ) |
| [out] | pdata | data of serialized numaa; ascii |
| [out] | psize | size of returned data |
| [in] | naa |
Notes:
(1) Serializes a numaa in memory and puts the result in a buffer.
Definition at line 1976 of file numabasic.c.
References fopenWriteWinTempfile(), l_binaryReadStream(), and numaaWriteStream().
| l_ok numaaWriteStream | ( | FILE * | fp, |
| NUMAA * | naa | ||
| ) |
| [in] | fp | file stream |
| [in] | naa |
Definition at line 1934 of file numabasic.c.
References L_CLONE, NUMA_VERSION_NUMBER, numaaGetCount(), numaaGetNuma(), numaDestroy(), and numaWriteStream().
Referenced by numaaWrite(), and numaaWriteMem().
| l_ok numaChangeRefcount | ( | NUMA * | na, |
| l_int32 | delta | ||
| ) |
numaChangeRefCount()
| [in] | na | |
| [in] | delta | change to be applied |
Definition at line 915 of file numabasic.c.
References Numa::refcount.
Referenced by numaClone(), and numaDestroy().
| [in] | na |
Definition at line 423 of file numabasic.c.
References numaChangeRefcount().
Referenced by numaaAddNuma(), numaaGetNuma(), numaInterpolateArbxInterval(), rchaExtract(), and wshedBasins().
| SARRAY* numaConvertToSarray | ( | NUMA * | na, |
| l_int32 | size1, | ||
| l_int32 | size2, | ||
| l_int32 | addzeros, | ||
| l_int32 | type | ||
| ) |
| [in] | na | |
| [in] | size1 | size of conversion field |
| [in] | size2 | for float conversion: size of field to the right of the decimal point |
| [in] | addzeros | for integer conversion: to add lead zeros |
| [in] | type | L_INTEGER_VALUE, L_FLOAT_VALUE |
Notes:
(1) For integer conversion, size2 is ignored.
For float conversion, addzeroes is ignored.
Definition at line 1027 of file numabasic.c.
References L_COPY, L_FLOAT_VALUE, L_INTEGER_VALUE, numaGetCount(), numaGetFValue(), numaGetIValue(), sarrayAddString(), and sarrayCreate().
| [in] | na |
Definition at line 394 of file numabasic.c.
References Numa::array, Numa::delx, Numa::n, Numa::nalloc, numaAddNumber(), numaCreate(), and Numa::startx.
Referenced by numaaAddNuma(), numaAddBorder(), numaAddSpecifiedBorder(), numaaGetNuma(), numaClose(), numaDilate(), numaEarthMoverDistance(), numaErode(), numaFindPeaks(), numaInvert(), numaMakeAbsValue(), numaOpen(), numaRemoveBorder(), numaSort(), numaSortPair(), numaWindowedMedian(), and recogPreSplittingFilter().
Definition at line 989 of file numabasic.c.
References numaGetParameters(), and numaSetParameters().
Referenced by numaConvertToInt(), numaDilate(), numaErode(), numaNormalizeHistogram(), and numaTransform().
| NUMA* numaCreate | ( | l_int32 | n | ) |
| [in] | n | size of number array to be alloc'd 0 for default |
Definition at line 187 of file numabasic.c.
Referenced by addColorizedGrayToCmap(), bmfGetWordWidths(), boxaaFlattenToBoxa(), boxaBinSort(), boxaExtractAsNuma(), boxaExtractSortedPattern(), boxaFindNearestBoxes(), boxaGetSizes(), boxaMakeAreaIndicator(), boxaMakeSizeIndicator(), boxaMakeWHRatioIndicator(), boxaMedianDimensions(), boxaPlotSides(), boxaPlotSizes(), boxaReconcileSizeByMedian(), boxaSimilar(), boxaSizeConsistency1(), boxaSizeConsistency2(), boxaSort2d(), ccbaGenerateStepChains(), ccbaReadStream(), compareTilesByHisto(), dewarpaListPages(), dewarpaReadStream(), dewarpFindVertDisparity(), dewarpQuadraticLSF(), genConstrainedNumaInRange(), grayHistogramsToEMD(), grayInterHistogramStats(), kernelCreateFromFile(), l_dnaConvertToNuma(), l_uncompressGrayHistograms(), mergeLookup(), numaaCompareImagesByBoxes(), numaaCreateFull(), numaaFlattenToNuma(), numaClipToInterval(), numaConvertToInt(), numaCopy(), numaCreateFromFArray(), numaCreateFromIArray(), numaCrossingsByPeaks(), numaCrossingsByThreshold(), numaDifferentiateInterval(), numaDiscretizeRankAndIntensity(), numaEvalSyncError(), numaFindExtrema(), numaFindPeaks(), numaGammaTRC(), numaGetBinSortIndex(), numaGetCrossingDistances(), numaGetMedianDevFromMedian(), numaGetPartialSums(), numaGetPeakCentroids(), numaGetPeakWidthLUT(), numaGetSortIndex(), numaInterpolateArbxInterval(), numaInterpolateEqxInterval(), numaLocatePeakRanges(), numaLowPassIntervals(), numaMakeDelta(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), numaMakeRankFromHistogram(), numaMakeSequence(), numaMakeThresholdIndicator(), numaNormalizeHistogram(), numaQuantizeCrossingsByWindow(), numaRandomPermutation(), numaReadStream(), numaRebinHistogram(), numaReverse(), numaSelectCrossingThreshold(), numaSortByIndex(), numaSplitDistribution(), numaSubsample(), numaThresholdEdges(), numaTransform(), numaUniformSampling(), numaWindowedMedian(), parseStringForNumbers(), pixaaDisplayByPixa(), pixaaFlattenToPixa(), pixaaGetCount(), pixaBinSort(), pixaComparePhotoRegionsByHisto(), pixaCountPixels(), pixaDisplayTiledInRows(), pixaFindAreaFraction(), pixaFindDimensions(), pixaFindPerimSizeRatio(), pixaFindPerimToAreaRatio(), pixaFindStrokeWidth(), pixaFindWidthHeightProduct(), pixaFindWidthHeightRatio(), pixaMakeSizeIndicator(), pixaSelectByNumConnComp(), pixcmapGetRankIntensity(), pixCompareRankDifference(), pixCompareTilesByHisto(), ptaConvertToNuma(), ptaGetArrays(), ptaGetCubicLSF(), ptaGetLinearLSF(), ptaGetQuadraticLSF(), ptaGetQuarticLSF(), ptaGetSortIndex(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptraConcatenatePdfToData(), rchaCreate(), recogAddMissingClassStrings(), recogAverageSamples(), recogExtractNumbers(), recogFilterPixaBySize(), recogMakeBootDigitTemplates(), recogShowMatchesInRange(), and selaCreateFromFile().
| NUMA* numaCreateFromFArray | ( | l_float32 * | farray, |
| l_int32 | size, | ||
| l_int32 | copyflag | ||
| ) |
| [in] | farray | float array |
| [in] | size | of the array |
| [in] | copyflag | L_INSERT or L_COPY |
Notes:
(1) With L_INSERT, ownership of the input array is transferred
to the returned numa, and all size elements are considered
to be valid.
Definition at line 265 of file numabasic.c.
References Numa::array, L_COPY, L_INSERT, Numa::n, numaAddNumber(), and numaCreate().
| NUMA* numaCreateFromIArray | ( | l_int32 * | iarray, |
| l_int32 | size | ||
| ) |
| [in] | iarray | integer array |
| [in] | size | of the array |
Notes:
(1) We can't insert this int array into the numa, because a numa
takes a float array. So this just copies the data from the
input array into the numa. The input array continues to be
owned by the caller.
Definition at line 228 of file numabasic.c.
References numaAddNumber(), and numaCreate().
Referenced by numaPseudorandomSequence().
| NUMA* numaCreateFromString | ( | const char * | str | ) |
| [in] | str | string of comma-separated numbers |
Notes:
(1) The numbers can be ints or floats; they will be interpreted
and stored as floats. To use them as integers (e.g., for
indexing into arrays), use numaGetIValue(...).
Definition at line 309 of file numabasic.c.
References sarrayCreate().
Referenced by pixaSelectWithString().
| void numaDestroy | ( | NUMA ** | pna | ) |
| [in,out] | pna | numa to be destroyed and nulled if it exists |
Notes:
(1) Decrements the ref count and, if 0, destroys the numa.
(2) Always nulls the input ptr.
Definition at line 360 of file numabasic.c.
References Numa::array, numaChangeRefcount(), and numaGetRefcount().
Referenced by addColorizedGrayToCmap(), bmfGetLineStrings(), boxaBinSort(), boxaEqual(), boxaGetRankVals(), boxaHandleOverlaps(), boxaLinearFit(), boxaMedianDimensions(), boxaPermutePseudorandom(), boxaReconcileSizeByMedian(), boxaSelectByArea(), boxaSelectBySize(), boxaSelectByWHRatio(), boxaSizeConsistency1(), boxaSizeConsistency2(), boxaSizeVariation(), boxaSort2d(), boxaSort2dByIndex(), boxaWindowedMedian(), dewarpaDestroy(), dewarpaInsertRefModels(), dewarpaListPages(), dewarpDestroy(), dewarpFindVertDisparity(), dewarpMinimize(), dewarpQuadraticLSF(), gplotDestroy(), grayHistogramsToEMD(), grayInterHistogramStats(), kernelCreateFromFile(), kernelCreateFromString(), l_compressGrayHistograms(), mergeLookup(), numaaAddNumber(), numaaCompareImagesByBoxes(), numaaDestroy(), numaaGetNumberCount(), numaaReplaceNuma(), numaaTruncate(), numaaWriteStream(), numaBinSort(), numaClose(), numaCountReversals(), numaCrossingsByPeaks(), numaDifferentiateInterval(), numaDiscretizeRankAndIntensity(), numaEarthMoverDistance(), numaEvalSyncError(), numaFindPeaks(), numaGetBinSortIndex(), numaGetCrossingDistances(), numaGetMedianDevFromMedian(), numaGetMode(), numaGetRankBinValues(), numaGetRankValue(), numaGetStatsUsingHistogram(), numaIntegrateInterval(), numaInterpolateArbxInterval(), numaInvertMap(), numaMakeRankFromHistogram(), numaMakeThresholdIndicator(), numaOpen(), numaQuantizeCrossingsByWindow(), numaRandomPermutation(), numaReadStream(), numaSelectCrossingThreshold(), numaSortGeneral(), numaSortPair(), numaWindowedMean(), numaWindowedMeanSquare(), numaWindowedMedian(), numaWindowedStats(), pixaaDisplayByPixa(), pixaBinSort(), pixaConstrainedSelect(), pixaDisplayTiledByIndex(), pixaDisplayTiledInRows(), pixaEqual(), pixaModifyStrokeWidth(), pixaRemoveSelected(), pixaSelectByAreaFraction(), pixaSelectByNumConnComp(), pixaSelectByPerimSizeRatio(), pixaSelectByPerimToAreaRatio(), pixaSelectBySize(), pixaSelectByWidthHeightRatio(), pixaSelectToPdf(), pixaSelectWithString(), pixaSort2dByIndex(), pixcmapContrastTRC(), pixcmapGammaTRC(), pixcmapGetRankIntensity(), pixCompareRankDifference(), pixDisplayPtaa(), pixGetDifferenceStats(), pixGetTextBaseline(), pixGetWordBoxesInTextlines(), pixReadBarcodes(), pixSplitDistributionFgBg(), pixThresholdGrayArb(), ptaGetSortIndex(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), ptaSort(), rchaDestroy(), recogAddMissingClassStrings(), recogAverageSamples(), recogDestroy(), recogDestroyDid(), recogExtractNumbers(), recogIsPaddingNeeded(), recogShowContent(), selaCreateFromFile(), showExtractNumbers(), wshedDestroy(), and wshedRenderFill().
| l_ok numaEmpty | ( | NUMA * | na | ) |
| [in] | na |
Notes:
(1) This does not change the allocation of the array.
It just clears the number of stored numbers, so that
the array appears to be empty.
Definition at line 449 of file numabasic.c.
References Numa::n.
|
static |
| [in] | na |
Definition at line 499 of file numabasic.c.
References Numa::array, Numa::nalloc, and reallocNew().
Referenced by numaAddNumber(), and numaInsertNumber().
| l_int32 numaGetCount | ( | NUMA * | na | ) |
| [in] | na |
Definition at line 631 of file numabasic.c.
References Numa::n.
Referenced by bmfGetLineStrings(), boxaSelectWithIndicator(), boxaSort2dByIndex(), dewarpaInfo(), dewarpaModelStats(), dewarpaWriteStream(), kernelCreateFromFile(), kernelCreateFromString(), l_showIndicatorSplitValues(), makeGrayQuantTableArb(), makePlotPtaFromNumaGen(), mergeLookup(), numaaCompareImagesByBoxes(), numaAddBorder(), numaAddNumber(), numaAddSpecifiedBorder(), numaAddToNumber(), numaaGetNumaCount(), numaaGetNumberCount(), numaArithOp(), numaaTruncate(), numaChooseSortType(), numaClipToInterval(), numaConvertToDna(), numaConvertToInt(), numaConvertToPta1(), numaConvertToPta2(), numaConvertToSarray(), numaCountNonzeroRuns(), numaCountReversals(), numaCrossingsByPeaks(), numaCrossingsByThreshold(), numaDifferentiateInterval(), numaDilate(), numaDiscretizeRankAndIntensity(), numaEarthMoverDistance(), numaErode(), numaEvalHaarSum(), numaEvalSyncError(), numaFindExtrema(), numaFindPeaks(), numaFitMax(), numaGetBinSortIndex(), numaGetCountRelativeToZero(), numaGetCrossingDistances(), numaGetEdgeValues(), numaGetFArray(), numaGetHistogramStatsOnInterval(), numaGetIArray(), numaGetMax(), numaGetMeanDevFromMedian(), numaGetMedianDevFromMedian(), numaGetMin(), numaGetMode(), numaGetNonzeroRange(), numaGetPartialSums(), numaGetPeakCentroids(), numaGetPeakWidthLUT(), numaGetRankBinValues(), numaGetRankValue(), numaGetSortIndex(), numaGetSpanValues(), numaGetStatsUsingHistogram(), numaGetSum(), numaGetSumOnInterval(), numaHasOnlyIntegers(), numaHistogramGetRankFromVal(), numaHistogramGetValFromRank(), numaInsertNumber(), numaIntegrateInterval(), numaInterpolateArbxInterval(), numaInterpolateArbxVal(), numaInterpolateEqxInterval(), numaInterpolateEqxVal(), numaInvert(), numaInvertMap(), numaIsSorted(), numaJoin(), numaLocatePeakRanges(), numaLogicalOp(), numaLowPassIntervals(), numaMakeAbsValue(), numaMakeDelta(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), numaMakeRankFromHistogram(), numaMakeThresholdIndicator(), numaNormalizeHistogram(), numaQuantizeCrossingsByWidth(), numaQuantizeCrossingsByWindow(), numaRandomPermutation(), numaRebinHistogram(), numaRemoveBorder(), numaRemoveNumber(), numaReplaceNumber(), numaReverse(), numaSelectCrossingThreshold(), numaSimilar(), numaSimpleStats(), numaSort(), numaSortByIndex(), numaSplitDistribution(), numaSubsample(), numaThresholdEdges(), numaTransform(), numaUniformSampling(), numaWindowedMean(), numaWindowedMeanSquare(), numaWindowedMedian(), numaWindowedStats(), numaWindowedVariance(), numaWriteStream(), pixaaScaleToSizeVar(), pixaConstrainedSelect(), pixAddWithIndicator(), pixaDisplayTiledByIndex(), pixaDisplayTiledInRows(), pixaExtendByScaling(), pixaRemoveSelected(), pixaSelectWithIndicator(), pixaSelectWithString(), pixaSort2dByIndex(), pixDisplayOutliers(), pixGetTextBaseline(), pixReadBarcodes(), pixRemoveWithIndicator(), pixThresholdGrayArb(), ptaaSortByIndex(), ptaCreateFromNuma(), ptaSortByIndex(), recogExtractNumbers(), recogRescoreDidResult(), recogShowPath(), selaCreateFromFile(), showExtractNumbers(), and writeCustomTiffTags().
| l_float32* numaGetFArray | ( | NUMA * | na, |
| l_int32 | copyflag | ||
| ) |
| [in] | na | |
| [in] | copyflag | L_NOCOPY or L_COPY |
Notes:
(1) If copyflag == L_COPY, it makes a copy which the caller
is responsible for freeing. Otherwise, it operates
directly on the bare array of the numa.
(2) Very important: for L_NOCOPY, any writes to the array
will be in the numa. Do not write beyond the size of
the count field, because it will not be accessible
from the numa! If necessary, be sure to set the count
field to a larger number (such as the alloc size)
BEFORE calling this function. Creating with numaMakeConstant()
is another way to insure full initialization.
Definition at line 865 of file numabasic.c.
References Numa::array, L_NOCOPY, and numaGetCount().
Referenced by grayInterHistogramStats(), numaAddBorder(), numaAddSpecifiedBorder(), numaDifferentiateInterval(), numaDilate(), numaEarthMoverDistance(), numaErode(), numaGetMode(), numaGetPeakWidthLUT(), numaGetSortIndex(), numaIntegrateInterval(), numaInterpolateArbxInterval(), numaInterpolateArbxVal(), numaInterpolateEqxVal(), numaRemoveBorder(), numaUniformSampling(), numaWindowedMean(), numaWindowedMeanSquare(), numaWindowedVariance(), pixCompareRankDifference(), and pixGetDifferenceStats().
| l_ok numaGetFValue | ( | NUMA * | na, |
| l_int32 | index, | ||
| l_float32 * | pval | ||
| ) |
| [in] | na | |
| [in] | index | into numa |
| [out] | pval | float value; set to 0.0 on error |
Notes:
(1) Caller may need to check the function return value to
decide if a 0.0 in the returned ival is valid.
Definition at line 692 of file numabasic.c.
References Numa::array, and Numa::n.
Referenced by kernelCreateFromFile(), kernelCreateFromString(), makePlotPtaFromNumaGen(), numaClipToInterval(), numaConvertToDna(), numaConvertToPta1(), numaConvertToPta2(), numaConvertToSarray(), numaCountReversals(), numaCrossingsByPeaks(), numaCrossingsByThreshold(), numaDiscretizeRankAndIntensity(), numaEvalHaarSum(), numaEvalSyncError(), numaFindExtrema(), numaFindPeaks(), numaFitMax(), numaGetCountRelativeToZero(), numaGetCrossingDistances(), numaGetHistogramStatsOnInterval(), numaGetMax(), numaGetMeanDevFromMedian(), numaGetMedianDevFromMedian(), numaGetMin(), numaGetNonzeroRange(), numaGetPartialSums(), numaGetPeakCentroids(), numaGetRankValue(), numaGetStatsUsingHistogram(), numaGetSum(), numaGetSumOnInterval(), numaHasOnlyIntegers(), numaHistogramGetRankFromVal(), numaHistogramGetValFromRank(), numaInterpolateArbxVal(), numaIsSorted(), numaJoin(), numaLocatePeakRanges(), numaLowPassIntervals(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), numaMakeRankFromHistogram(), numaMakeThresholdIndicator(), numaNormalizeHistogram(), numaQuantizeCrossingsByWindow(), numaRandomPermutation(), numaReverse(), numaSimilar(), numaSimpleStats(), numaSortByIndex(), numaSplitDistribution(), numaSubsample(), numaThresholdEdges(), numaTransform(), pixaModifyStrokeWidth(), pixDisplayOutliers(), ptaCreateFromNuma(), ptaNoisyLinearLSF(), ptaNoisyQuadraticLSF(), recogExtractNumbers(), recogShowMatchesInRange(), recogShowPath(), and showExtractNumbers().
| l_int32* numaGetIArray | ( | NUMA * | na | ) |
| [in] | na |
Notes:
(1) A copy of the array is always made, because we need to
generate an integer array from the bare float array.
The caller is responsible for freeing the array.
(2) The array size is determined by the number of stored numbers,
not by the size of the allocated array in the Numa.
(3) This function is provided to simplify calculations
using the bare internal array, rather than continually
calling accessors on the numa. It is typically used
on an array of size 256.
Definition at line 820 of file numabasic.c.
References numaGetCount(), and numaGetIValue().
Referenced by numaCountReversals(), numaFillCmapFromHisto(), pixaaDisplayByPixa(), recogMakeDecodingArray(), recogRunViterbi(), and substituteObjectNumbers().
| l_ok numaGetIValue | ( | NUMA * | na, |
| l_int32 | index, | ||
| l_int32 * | pival | ||
| ) |
| [in] | na | |
| [in] | index | into numa |
| [out] | pival | integer value; set to 0 on error |
Notes:
(1) Caller may need to check the function return value to
decide if a 0 in the returned ival is valid.
Definition at line 727 of file numabasic.c.
References Numa::array, and Numa::n.
Referenced by bmfGetLineStrings(), boxaExtractSortedPattern(), boxaHandleOverlaps(), boxaReconcilePairWidth(), boxaReconcileSizeByMedian(), boxaSelectWithIndicator(), boxaSizeVariation(), boxaSort2d(), boxaSort2dByIndex(), boxaSortByIndex(), boxaWindowedMedian(), dewarpaInfo(), dewarpaInsertRefModels(), dewarpaModelStats(), dewarpaWriteStream(), l_compressGrayHistograms(), makeGrayQuantTableArb(), mergeLookup(), numaaCompareImagesByBoxes(), numaConvertToInt(), numaConvertToSarray(), numaCountNonzeroRuns(), numaCrossingsByPeaks(), numaDiscretizeRankAndIntensity(), numaEvalSyncError(), numaGetBinSortIndex(), numaGetEdgeValues(), numaGetIArray(), numaGetPeakCentroids(), numaGetPeakWidthLUT(), numaGetSpanValues(), numaInvert(), numaInvertMap(), numaMakeDelta(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), numaQuantizeCrossingsByWindow(), numaRandomPermutation(), numaRebinHistogram(), numaSelectCrossingThreshold(), numaSortByIndex(), pixaAddTextNumber(), pixaaScaleToSizeVar(), pixaComparePhotoRegionsByHisto(), pixaConstrainedSelect(), pixAddWithIndicator(), pixaDisplayTiledByIndex(), pixaDisplayTiledInRows(), pixaEqual(), pixaRemoveSelected(), pixaSelectWithIndicator(), pixaSelectWithString(), pixaSort2dByIndex(), pixaSortByIndex(), pixcmapContrastTRC(), pixcmapGammaTRC(), pixcmapGetRankIntensity(), pixDisplayPtaa(), pixGetTextBaseline(), pixReadBarcodes(), pixRemoveWithIndicator(), ptaaSortByIndex(), ptaSortByIndex(), recogAddMissingClassStrings(), recogIsPaddingNeeded(), recogShowContent(), recogShowMatchesInRange(), recogShowPath(), sarraySortByIndex(), selaCreateFromFile(), writeCustomTiffTags(), wshedGetHeight(), and wshedRenderFill().
| l_ok numaGetParameters | ( | NUMA * | na, |
| l_float32 * | pstartx, | ||
| l_float32 * | pdelx | ||
| ) |
| [in] | na | |
| [out] | pstartx | [optional] startx |
| [out] | pdelx | [optional] delx |
Definition at line 936 of file numabasic.c.
References Numa::delx, and Numa::startx.
Referenced by makePlotPtaFromNumaGen(), numaAddBorder(), numaClipToInterval(), numaConvertToPta1(), numaCopyParameters(), numaCountReversals(), numaCrossingsByPeaks(), numaCrossingsByThreshold(), numaGetRankBinValues(), numaHistogramGetRankFromVal(), numaHistogramGetValFromRank(), numaLowPassIntervals(), numaRebinHistogram(), numaRemoveBorder(), numaThresholdEdges(), numaUniformSampling(), numaWriteStream(), and ptaCreateFromNuma().
| l_int32 numaGetRefcount | ( | NUMA * | na | ) |
numaGetRefCount()
| [in] | na |
Definition at line 897 of file numabasic.c.
References Numa::refcount.
Referenced by numaDestroy().
| l_ok numaInsertNumber | ( | NUMA * | na, |
| l_int32 | index, | ||
| l_float32 | val | ||
| ) |
| [in] | na | |
| [in] | index | location in na to insert new value |
| [in] | val | float32 or integer to be added |
Notes:
(1) This shifts na[i] –> na[i + 1] for all i >= index,
and then inserts val as na[index].
(2) It should not be used repeatedly on large arrays,
because the function is O(n).
Definition at line 534 of file numabasic.c.
References Numa::array, Numa::n, Numa::nalloc, numaExtendArray(), and numaGetCount().
| NUMA* numaRead | ( | const char * | filename | ) |
| [in] | filename |
Definition at line 1083 of file numabasic.c.
References fopenReadStream(), and numaReadStream().
| NUMA* numaReadMem | ( | const l_uint8 * | data, |
| size_t | size | ||
| ) |
| [in] | data | numa serialization; in ascii |
| [in] | size | of data; can use strlen to get it |
Definition at line 1156 of file numabasic.c.
References L_Kernel::data, fopenReadFromMemory(), and numaReadStream().
| NUMA* numaReadStream | ( | FILE * | fp | ) |
| [in] | fp | file stream |
Definition at line 1110 of file numabasic.c.
References NUMA_VERSION_NUMBER, numaAddNumber(), numaCreate(), numaDestroy(), and numaSetParameters().
Referenced by numaaReadStream(), numaRead(), and numaReadMem().
| l_ok numaRemoveNumber | ( | NUMA * | na, |
| l_int32 | index | ||
| ) |
| [in] | na | |
| [in] | index | element to be removed |
Notes:
(1) This shifts na[i] –> na[i - 1] for all i > index.
(2) It should not be used repeatedly on large arrays,
because the function is O(n).
Definition at line 573 of file numabasic.c.
References Numa::array, Numa::n, and numaGetCount().
| l_ok numaReplaceNumber | ( | NUMA * | na, |
| l_int32 | index, | ||
| l_float32 | val | ||
| ) |
| [in] | na | |
| [in] | index | element to be replaced |
| [in] | val | new value to replace old one |
Definition at line 602 of file numabasic.c.
References Numa::array, and numaGetCount().
Referenced by boxaEqual(), dewarpaInsertRefModels(), numaInvertMap(), and ptraConcatenatePdfToData().
| l_ok numaSetCount | ( | NUMA * | na, |
| l_int32 | newcount | ||
| ) |
| [in] | na | |
| [in] | newcount |
Notes:
(1) If newcount <= na->nalloc, this resets na->n.
Using newcount = 0 is equivalent to numaEmpty().
(2) If newcount > na->nalloc, this causes a realloc
to a size na->nalloc = newcount.
(3) All the previously unused values in na are set to 0.0.
Definition at line 658 of file numabasic.c.
References Numa::array, Numa::n, Numa::nalloc, and reallocNew().
Referenced by numaEvalSyncError(), numaGetPeakWidthLUT(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), and pixCompareRankDifference().
| l_ok numaSetParameters | ( | NUMA * | na, |
| l_float32 | startx, | ||
| l_float32 | delx | ||
| ) |
| [in] | na | |
| [in] | startx | x value corresponding to na[0] |
| [in] | delx | difference in x values for the situation where the elements of na correspond to the evaulation of a function at equal intervals of size delx |
Definition at line 966 of file numabasic.c.
References Numa::delx, and Numa::startx.
Referenced by numaAddBorder(), numaClipToInterval(), numaCopyParameters(), numaInterpolateEqxInterval(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), numaReadStream(), numaRebinHistogram(), numaRemoveBorder(), and numaUniformSampling().
| l_ok numaSetValue | ( | NUMA * | na, |
| l_int32 | index, | ||
| l_float32 | val | ||
| ) |
| [in] | na | |
| [in] | index | to element to be set |
| [in] | val | to set |
Definition at line 759 of file numabasic.c.
References Numa::array, and Numa::n.
Referenced by boxaFindInvalidBoxes(), boxaHandleOverlaps(), compareTilesByHisto(), numaDiscretizeRankAndIntensity(), numaEvalSyncError(), numaFindPeaks(), numaGetPeakWidthLUT(), numaInvert(), numaLocatePeakRanges(), numaMakeHistogramAuto(), numaMakeHistogramClipped(), numaReverse(), pixaComparePhotoRegionsByHisto(), pixaDisplayTiledByIndex(), pixCompareTilesByHisto(), ptraConcatenatePdfToData(), and recogAddMissingClassStrings().
| l_ok numaShiftValue | ( | NUMA * | na, |
| l_int32 | index, | ||
| l_float32 | diff | ||
| ) |
| [in] | na | |
| [in] | index | to element to change relative to the current value |
| [in] | diff | increment if diff > 0 or decrement if diff < 0 |
Definition at line 784 of file numabasic.c.
References Numa::array, and Numa::n.
| l_ok numaWrite | ( | const char * | filename, |
| NUMA * | na | ||
| ) |
| [in] | filename | |
| [in] | na |
Definition at line 1215 of file numabasic.c.
References fopenWriteStream(), and numaWriteStream().
Referenced by numaWriteDebug().
| l_ok numaWriteDebug | ( | const char * | filename, |
| NUMA * | na | ||
| ) |
| [in] | filename | |
| [in] | na |
Notes:
(1) Debug version, intended for use in the library when writing
to files in a temp directory with names that are compiled in.
This is used instead of numaWrite() for all such library calls.
(2) The global variable LeptDebugOK defaults to 0, and can be set
or cleared by the function setLeptDebugOK().
Definition at line 1193 of file numabasic.c.
References numaWrite().
| l_ok numaWriteMem | ( | l_uint8 ** | pdata, |
| size_t * | psize, | ||
| NUMA * | na | ||
| ) |
| [out] | pdata | data of serialized numa; ascii |
| [out] | psize | size of returned data |
| [in] | na |
Notes:
(1) Serializes a numa in memory and puts the result in a buffer.
Definition at line 1289 of file numabasic.c.
References fopenWriteWinTempfile(), l_binaryReadStream(), and numaWriteStream().
| l_ok numaWriteStream | ( | FILE * | fp, |
| NUMA * | na | ||
| ) |
| [in] | fp | file stream |
| [in] | na |
Definition at line 1246 of file numabasic.c.
References Numa::array, NUMA_VERSION_NUMBER, numaGetCount(), and numaGetParameters().
Referenced by numaaWriteStream(), numaSelectCrossingThreshold(), numaWrite(), and numaWriteMem().