Skip to content
Snippets Groups Projects
Commit 189d5326 authored by ariotte's avatar ariotte
Browse files

fixed histogramOp

parent 8c44fe6b
No related branches found
No related tags found
No related merge requests found
......@@ -95,17 +95,10 @@ Image* HistogramOp::equalize( const Image *img ) {
Image *HistogramOp::normalize( const Image *img ) {
Image* resImg = new Image(img->getWidth(), img->getHeight(), img->getNbChannels());
Image* resImg = new Image(*img);
for(unsigned int c = 0; c < img->getNbChannels(); ++c) {
Histogram hist_data = img->getHistogram(c);
int min=255,max=0;
for(int counter=0; counter< 256; counter++ ) {
if(hist_data[255-counter]!=0)
min=255-counter;
if(hist_data[counter]!=0)
max=counter;
}
int min = img->min(c);
int max = img->max(c);
for(unsigned int j = 0; j < img->getHeight(); ++j) {
for(unsigned int i = 0; i < img->getWidth(); ++i) {
double K = img->getPixel(i, j, c);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment