Normalization¶
This code snippet shows how to apply normalization.
C++¶
#include <eVision/EasyImage/EasyImage.h>
#include <eVision/EasyImage/EImageStatisticsBW8.h>
using namespace eVision;
EImageBW8 referenceImage;
EImageBW8 tooLightImage;
EImageStatisticsBW8 stats;
stats.SetImage(&referenceImage);
float imposedStandardDeviation = stats.GetPixelStdDev();
float imposedStandardAverage = stats.GetPixelAverage();
EImageBW8 correctedImage;
correctedImage.SetSize(&referenceImage);
EasyImage::Normalize(&tooLightImage, &correctedImage, imposedStandardAverage, imposedStandardDeviation);
C#¶
using eVision;
using System.Collections.Generic;
EImageBW8 referenceImage = new EImageBW8();
EImageBW8 tooLightImage = new EImageBW8();
EImageStatisticsBW8 stats = new EImageStatisticsBW8();
stats.SetImage(referenceImage);
float imposedStandardDeviation = stats.PixelStdDev;
float imposedStandardAverage = stats.PixelAverage;
EImageBW8 correctedImage = new EImageBW8();
correctedImage.SetSize(referenceImage);
EasyImage.Normalize(tooLightImage, correctedImage, imposedStandardAverage, imposedStandardDeviation);
Python¶
import eVision
referenceImage = eVision.EImageBW8()
tooLightImage = eVision.EImageBW8()
stats = eVision.EImageStatisticsBW8()
stats.SetImage(referenceImage)
imposedStandardDeviation = stats.PixelStdDev
imposedStandardAverage = stats.PixelAverage
correctedImage = eVision.EImageBW8()
correctedImage.SetSize(referenceImage)
eVision.EasyImage.Normalize(tooLightImage, correctedImage, imposedStandardAverage, imposedStandardDeviation)