Gray level data of boundary pixels that are adjacent to a block boundary in
a photoelectric conversion section is stored. Then, a cumulative histogram regarding
the number of pixels for different gray levels is produced based on the stored
gray level data separately for each block, and a data table representing the correspondence
between each gray level before correction and that after correction for the block
to be corrected is produced so as to reduce the difference between the cumulative
histograms. The data table is stored in a correction data RAM. By using the data
table, the outputs of the block to be corrected are non-linearly corrected for
different gray levels.