Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mlib_imagehistogram2(3mlib) [opensolaris man page]

mlib_ImageHistogram2(3MLIB)				    mediaLib Library Functions				       mlib_ImageHistogram2(3MLIB)

NAME
mlib_ImageHistogram2 - histogram SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageHistogram2(mlib_s32 **histo, const mlib_image *img, const mlib_s32 *numBins, const mlib_s32 *lowValue, const mlib_s32 *highValue, mlib_s32 xStart, mlib_s32 yStart, mlib_s32 xPeriod, mlib_s32 yPeriod); DESCRIPTION
The mlib_ImageHistogram2() function creates a histogram by scanning an image, counting the number of pixels within a given range for each channel of the image, and then generating a histogram. The image can have 1, 2, 3 or 4 channels. The data type of the image can be MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT. The histogram must have the same number of channels as the image has. One entry of the histogram, or a bin, is used to accumulate the number of pixels within a certain sub-range. The legal pixel range and the number of bins may be controlled separately. If binWidth is defined as (highValue - lowValue )/numBins then bin i counts pixel values in the following range: lowValue + i*binWidth <= x < lowValue + (i + 1)*binWidth The set of pixels scanned may furthermore be reduced by specifying xPeriod and yPeriod parameters that specify the sampling rate along each axis. The set of pixels to be accumulated may be obtained from the following equation: x = xStart + p*xPeriod; 0 <= p < (w - xStart)/xPeriod y = yStart + q*yPeriod; 0 <= q < (h - yStart)/yPeriod It is the user's responsibility to clear the histogram table before this function is called and to ensure that the histogram table supplied is suitable for the source image and the parameters. Otherwise, the result of this function is undefined. The range from lowValue[k] to (highValue[k] - 1) must be a valid subrange of the image type range. PARAMETERS
The function takes the following arguments: histo Pointer to histogram. The format of the histogram is histo[channel][index]. The index values for channel i can be 0, 1, ..., numBins[i]-1. img Pointer to source image. numBins The number of bins for each channel of the image. lowValue The lowest pixel value checked for each channel. highValue The highest pixel value checked for each channel. When counting the pixel values, highValue is not included. xStart The initial X sample coordinate. yStart The initial Y sample coordinate. xPeriod The X sampling rate. xPeriod >= 1. yPeriod The Y sampling rate. yPeriod >= 1. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageHistogram(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_ImageHistogram2(3MLIB)

Check Out this Related Man Page

mlib_ImageExtremaLocations(3MLIB)			    mediaLib Library Functions				 mlib_ImageExtremaLocations(3MLIB)

NAME
mlib_ImageExtremaLocations, mlib_ImageExtremaLocations_Fp - image extrema and their locations SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_ImageExtremaLocations( mlib_s32 *min, mlib_s32 *max, const mlib_image *img, mlib_s32 xStart, mlib_s32 yStart, mlib_s32 xPeriod, mlib_s32 yPeriod, mlib_s32 saveLocations, mlib_s32 maxRuns, mlib_s32 *minCounts, mlib_s32 *maxCounts, mlib_s32 **minLocations, mlib_s32 **maxLocations, mlib_s32 len); mlib_status mlib_ImageExtremaLocations_Fp( mlib_d64 *min, mlib_d64 *max, const mlib_image *img, mlib_s32 xStart, mlib_s32 yStart, mlib_s32 xPeriod, mlib_s32 yPeriod, mlib_s32 saveLocations, mlib_s32 maxRuns, mlib_s32 *minCounts, mlib_s32 *maxCounts, mlib_s32 **minLocations, mlib_s32 **maxLocations, mlib_s32 len); DESCRIPTION
Each of the functions finds the image-wise minimum and maximum pixel values for each channel, and optionally, their locations. Each of the functions scans an image, finds the minimum and maximum pixel values for each channel, and finds the locations of those pixels with the minimum or maximum values. The user provides initial minimum/maximum values through the arguments min and max. This function will update them based on findings. The set of pixels scanned may furthermore be reduced by specifying xPeriod and yPeriod parameters that specify the sampling rate along each axis. The set of pixels to be scanned may be obtained from the following equation: x = xStart + p*xPeriod; 0 <= p < (w - xStart)/xPeriod y = yStart + q*yPeriod; 0 <= q < (h - yStart)/yPeriod The locations of the minimum/maximum, if asked, are recorded in a format of run-length coding. Each run-length code, or simply called a run, has a format of (xStart, yStart, length). Here length is defined on the low-resolution image (with downsampling factors of 1/xPeriod, 1/yPeriod) and does not cross rows. So the run-length code (xStart, yStart, length) means that the pixels at (xStart, yStart), (xStart + xPeriod, yStart), ..., (xStart + (length - 1)*xPeriod, yStart) of the original image have a value of the minimum/maximum. The buffers for minLocations and maxLocations are organized in the following format for each channel i: minLocations[i][0] = xStart0; // the 1st run minLocations[i][1] = yStart0; minLocations[i][2] = length0; minLocations[i][3] = xStart1; // the 2nd run minLocations[i][4] = yStart1; minLocations[i][5] = length1; ...... // more runs minLocations[i][len-1] = ...; It is the user's responsibility to allocate enough memory for the buffers for minLocations and maxLocations. This function may return MLIB_OUTOFRANGE, if any of the buffers is not big enough. PARAMETERS
The function takes the following arguments: min Pointer to the minimum values. max Pointer to the maximum values. img Pointer to the input image. xStart Initial X sample coordinate. yStart Initial Y sample coordinate. xPeriod X sampling rate. xPeriod >= 1. yPeriod Y sampling rate. yPeriod >= 1. saveLocations If true (i.e., saveLocations != 0), find the extrema locations; otherwise only find the extrema. maxRuns Number of runs of the minimum/maximum the caller expects for each channel. maxRuns >= 1. If it is MLIB_S32_MAX, all the minimum/maximum locations should be recorded. minCounts Pointer to the numbers of runs of the minimum recorded in minLocations. maxCounts Pointer to the numbers of runs of the maximum recorded in maxLocations. minLocations Pointer to the minimum locations in a format of run-length coding. maxLocations Pointer to the maximum locations in a format of run-length coding. len Length of the buffers for the minimum/maximum locations in each channel. RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_ImageExtrema2(3MLIB), mlib_ImageMaximum(3MLIB), mlib_ImageMaximum_Fp(3MLIB), mlib_ImageMinimum(3MLIB), mlib_ImageMinimum_Fp(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_ImageExtremaLocations(3MLIB)
Man Page