Ejemplo n.º 1
0
int ImageProcessing::IVA_ProcessImage(Image *image)
{
    int success = 1;
    if(!processingOn) return success;
    IVA_Data *ivaData;
    ImageType imageType;
    int pParameter[1] = {35};
    float plower[1] = {0};
    float pUpper[1] = {50};
    int pCalibrated[1] = {0};
    int pExclude[1] = {0};
    ImageType imageType1;

    // Initializes internal data (buffers and array of points for caliper measurements)
    VisionErrChk(ivaData = IVA_InitData(5, 0));

    VisionErrChk(IVA_CLRThreshold(image, 0, 99, 144, 255, 102, 255, IMAQ_RGB));

    //-------------------------------------------------------------------//
    //                       Lookup Table: Equalize                      //
    //-------------------------------------------------------------------//
    // Calculates the histogram of the image and redistributes pixel values across
    // the desired range to maintain the same pixel value distribution.
    VisionErrChk(imaqGetImageType(image, &imageType));
    VisionErrChk(imaqEqualize(image, image, 0, (imageType == IMAQ_IMAGE_U8 ? 255 : 0), NULL));

    VisionErrChk(IVA_ParticleFilter(image, pParameter, plower, pUpper,
                                    pCalibrated, pExclude, 1, TRUE, TRUE));

    //-------------------------------------------------------------------//
    //                       Lookup Table: Equalize                      //
    //-------------------------------------------------------------------//
    // Calculates the histogram of the image and redistributes pixel values across
    // the desired range to maintain the same pixel value distribution.
    VisionErrChk(imaqGetImageType(image, &imageType1));
    VisionErrChk(imaqEqualize(image, image, 0, (imageType1 == IMAQ_IMAGE_U8 ? 255 : 0), NULL));

    // Releases the memory allocated in the IVA_Data structure.
    IVA_DisposeData(ivaData);

Error:
    return success;
}
Ejemplo n.º 2
0
int frcEqualize(Image* dest, const Image* source, float min, float max, const Image* mask)
{
	return imaqEqualize(dest, source, min, max, mask);
}