Сделайте гистограмму обратной проекции в C# - PullRequest
0 голосов
/ 25 марта 2020

У меня есть массив с плавающей точкой, который служит гистограммой для изображения. Если бы я выровнял этот массив с плавающей точкой (гистограмма), как бы я применил его обратно к изображению? (без использования opencv / emgucv)

Mat image= CvInvoke.Imread(op.FileName, Emgu.CV.CvEnum.ImreadModes.AnyColor);
Image<Gray, Byte> gray = image.ToImage<Gray, Byte>();
float[] hist = new float[256];
for(int i=0;i<gray.Rows;i++)
{
    for(int j=0;j<gray.Cols;j++)
    {
        hist[gray.Data[i, j, 0]] += 1;
    }
}
//doing something with the histogram, i've not implemented yet
//backwards projecting the hist back to the Image<Gray, Byte>, it doesnt matter if 've not done anything to the histogram yet
...