Restoration of Multicolor Images


The program (map) reads an image in the ppm (true-color) or pgm (gray-scale) format. The intensity of each color in each pixel (or the single gray scale intensity there) is written as a (eight bits) binary number.
A true-color image can be considered a set of three stacks of eight bitplanes. Each stack corresponds to one of the basic colors (red, green and blue). Similarly, a gray-scale image has only one "stack".
The program then constructs a graph for each one of those layers, construct the corresponding graphs and finds the minimum cut for each one of them using a standard implementation of the Ford Fulkerson algorithm. The program uses integer arithmetic scaled by a factor of 10000.
The map.tar file contains three programs, for Solaris. Source code and other ports will be available in the near future:
  1. map - the image restorer. A special option allows the definition of a restoration mask, restricting the operation just to the selected layers. A mask 255 restores everything, 128 just the first layer, and so on.
    % map -?
     usage:
     map input -h[value] -b[value] -o[arq]
     Options: 
     
     -h[value] -> new value for H
     -b[value] -> new value for beta
     -o[filename] -> output file
     -m[mask] -> restoration mask
          
  2. dust - introduces errors in a image, changing values of individual bits with a given probability.
    % dust -h
    Usage:
        dust [options] input [output]
    Options:
        -v : Verbose.
        -e prob : defines prob as the probability
                  to change a single bit. The value
                  must be between 0 and 1.
                              Default = 0.005000
    
          
  3. estima - estimates the error present in a image, and the best correction parameter.
    % estima -h
    Usage:
    estima [options] input
            Options:
                    -v : verbose.
                        A second occurrence adds verbosity.
    
          

Some sample restorations can be seen here. And here there is another set of restorations.