Summary of the invention
The purpose of the embodiment of the present application provides the processing method and the device of picture contrast, and optimization will reduce the problem of its display effect to digital video image degree of comparing at display terminal to solve in the prior art.
For solving the problems of the technologies described above, the embodiment of the present application provides following technical scheme:
A kind of processing method of picture contrast is used in digital photographing apparatus image degree of comparing being handled, and comprising:
Obtain a pending two field picture;
Pairing each passage of the color space of a described two field picture is carried out statistics with histogram, obtain statistics with histogram information;
The pixel grey scale of adjusting described image according to described statistics with histogram information distributes, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank are adjusted in output;
Remap according to the grey scale pixel value of described mapping relations, obtain the image after contrast is handled described image.
Described obtaining before the pending two field picture also comprises: set in advance the frame period threshold value of obtaining a two field picture;
Describedly obtain a pending two field picture and be specially: obtain satisfy described frame period threshold value a two field picture as a described pending two field picture.
Described obtaining after the pending two field picture, also comprise: the color space to a described two field picture is changed;
Pairing each passage of described color space to a two field picture carries out statistics with histogram and is specially: pairing each passage of the color space after the conversion of a described two field picture is carried out statistics with histogram.
Pairing each passage of described color space to a two field picture carries out statistics with histogram, obtains statistics with histogram information and comprises:
Calculate the number of pixels of each the grey level correspondence in each passage of color space correspondence of a described two field picture;
The probability that occurs according to each grey level in each passage after the described number of pixels output normalization, the probability that described each grey level is occurred is as the statistics with histogram information of described each passage.
Describedly adjust described image pixel intensity profile according to statistics with histogram information and comprise:
The probability that each grey level in each passage is occurred adds up, and obtains the accumulative histogram of each passage;
Obtain to adjust preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank according to accumulative histogram.
Describedly adjust described image pixel intensity profile according to statistics with histogram information and comprise:
The probability that each grey level in each passage occurs carry out local averageization, obtain the local average histogram information of each passage;
According to default target histogram described local average histogram is traveled through, the minimal gray rank and the maximum gray scale that obtain to satisfy specified requirements are other;
According to described satisfy specified requirements minimal gray rank and maximum gray scale other, pixel grey scale rank before adjusting and the mapping relations between the adjusted pixel grey scale rank.
Describedly remap according to the grey scale pixel value of mapping relations to image, the image that obtains after contrast is handled comprises:
The grey scale pixel value of each passage that obtains described each pixel of image is as the grey scale pixel value before adjusting;
Mate described mapping relations according to the grey scale pixel value before the described adjustment, obtain the adjusted grey scale pixel value of each pixel correspondence;
According to described adjusted grey scale pixel value described each pixel is carried out the gray scale adjustment;
Adjusted described each passage is synthesized the contrast of finishing described image to be handled.
A kind of processing unit of picture contrast is used in picture pick-up device image degree of comparing being handled, and comprising:
Acquiring unit is used to obtain a pending two field picture;
Statistic unit is used for pairing each passage of the color space of a described two field picture is carried out statistics with histogram, obtains statistics with histogram information;
Adjustment unit be used for adjusting according to described statistics with histogram information the pixel grey scale distribution of described image, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank is adjusted in output;
Map unit is used for remapping according to the grey scale pixel value of described mapping relations to described image, obtains the image after contrast is handled.
Also comprise: default unit is used to set in advance the frame period threshold value of obtaining a two field picture;
Described acquiring unit, specifically be used to obtain satisfy described frame period threshold value a two field picture as a described pending two field picture.
Also comprise: converting unit is used for the color space of a described two field picture is changed;
Described statistic unit specifically is used for pairing each passage of the color space after the conversion of a described two field picture is carried out statistics with histogram.
Described statistic unit comprises:
The number of pixels computation subunit is used for calculating the number of pixels of each grey level correspondence of each passage of the color space correspondence of a described two field picture;
Gray probability normalization subelement is used for the probability that each grey level according to each passage after the described number of pixels output normalization occurs, and the probability that described each grey level is occurred is as the statistics with histogram information of described each passage.
Described adjustment unit comprises:
Histogram accumulative total subelement is used for the probability that each grey level to each passage occurs and adds up, and obtains the accumulative histogram of each passage;
Mapping relations are obtained subelement, are used for obtaining to adjust preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank according to accumulative histogram.
Described adjustment unit comprises:
Histogram local average beggar unit is used for the probability that each grey level to each passage occurs and carry out local averageization, obtains the local average histogram information of each passage;
Histogram traversal subelement is used for according to default target histogram described local average histogram being traveled through, and the minimal gray rank and the maximum gray scale that obtain to satisfy specified requirements are other;
Mapping relations are obtained subelement, be used for according to described minimal gray rank and the maximum gray scale that satisfies specified requirements other, pixel grey scale rank before obtaining to adjust and the mapping relations between the adjusted pixel grey scale rank.
Described map unit comprises:
The source pixel gray scale is obtained subelement, and the grey scale pixel value of each pixel that is used to obtain described each passage of image is as the grey scale pixel value before adjusting;
Object pixel gray scale coupling subelement is used for mating described mapping relations according to the grey scale pixel value before the described adjustment, obtains the adjusted grey scale pixel value of each pixel correspondence;
Pixel grey scale is adjusted subelement, is used for according to described adjusted grey scale pixel value described each pixel being carried out the gray scale adjustment;
Passage synthon unit is used for that adjusted described each passage is synthesized the contrast of finishing described image and handles.
As seen, the embodiment of the present application is applied in the picture pick-up device image degree of comparing is handled, after obtaining a pending two field picture, pairing each passage of the color space of this two field picture is carried out statistics with histogram, obtain statistics with histogram information, the pixel grey scale of adjusting this image according to statistics with histogram information distributes, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank are adjusted in output, remap according to the grey scale pixel value of mapping relations, obtain the image after contrast is handled this image.It is that the contrast of carrying out in picture pick-up device is handled that the contrast that application the embodiment of the present application is carried out image is handled, promptly before compressing or transmit, realizes image the contrast of image is strengthened, avoided image degree of comparing enhancement process to compression or the quality decline of transmission back, cause the noise of image or disturb the problem that further enlarges, by in the optimization process of picture pick-up device degree of comparing front end, strengthened the display effect of digital video image thus.
Embodiment
The embodiment of the present application provides a kind of processing method and device of picture contrast, and the embodiment of the present application is applied in the digital photographing apparatus (for example, digital camera), is used for that image is carried out the front end contrast and handles.
In order to make those skilled in the art person understand technical scheme in the embodiment of the present application better, and the above-mentioned purpose of the embodiment of the present application, feature and advantage can be become apparent more, below in conjunction with accompanying drawing technical scheme in the embodiment of the present application is described in further detail.
Referring to Fig. 2, be the first embodiment flow chart of the processing method of the application's picture contrast:
Step 201: obtain a pending two field picture.
Step 202: pairing each passage of the color space of a two field picture is carried out statistics with histogram, obtain statistics with histogram information.
Concrete, calculate the number of pixels of each the grey level correspondence in each passage of color space correspondence of a two field picture, the probability that occurs according to each grey level in each passage after the number of pixels output normalization, the probability that each grey level is occurred is as the statistics with histogram information of each passage.
Step 203: the pixel grey scale of adjusting image according to statistics with histogram information distributes, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank are adjusted in output.
Concrete, the probability that can occur each grey level in each passage adds up, and obtains the accumulative histogram of each passage, pixel grey scale rank before obtaining to adjust according to accumulative histogram and the mapping relations between the adjusted pixel grey scale rank; Perhaps, also the probability that can occur each grey level in each passage carry out local averageization, obtain the local average histogram information of each passage, according to default target histogram local equalization histogram is traveled through, it is other that the minimal gray rank and the maximum gray scale of specified requirements satisfied in acquisition, other according to minimal gray rank that satisfies specified requirements and maximum gray scale, pixel grey scale rank before obtaining to adjust and the mapping relations between the adjusted pixel grey scale rank.
Step 204: remap according to the grey scale pixel value of mapping relations, obtain the image after contrast is handled to image.
Concrete, the grey scale pixel value of each pixel that obtains each passage of image is as the grey scale pixel value before adjusting, according to the pixel grey scale rank coupling mapping relations before adjusting, obtain the adjusted grey scale pixel value of each pixel correspondence, according to adjusted grey scale pixel value each pixel is carried out the gray scale adjustment, adjusted each passage is synthesized the contrast of finishing image handle.
Referring to Fig. 3, be the second embodiment flow chart of the processing method of the application's picture contrast, this embodiment shows in detail in video camera image is carried out the detailed process that the front end contrast is handled:
Step 301: set in advance the frame period threshold value of obtaining a two field picture.
Video camera is when obtaining video image, the video image of consecutive frame has continuity and similitude in certain time period, in order to improve the image processing speed of video camera, can only handle and obtain other mapping relations of pixel grayscale the two field picture degree of comparing in certain period, and utilize other mapping relations of this pixel grayscale that other two field picture in this time period is carried out handling with the same contrast of this image to get final product, for example, can set in advance every ten frames and obtain a frame video image, then other nine two field picture all adopts the mapping relations of this two field picture to shine upon.
Step 302: judge whether a two field picture that receives satisfies the frame period threshold value, if then execution in step 303; Otherwise, execution in step 308.
Step 303: a two field picture that will receive is changed the color space of this two field picture as a pending two field picture.
In the embodiment of the present application, it is optional step that two field picture is carried out color space conversion.When needs are used a plurality of color space information, when particularly color video frequency image being handled, can utilize the combination of a plurality of color spaces, guarantee that thus the video image contrast strengthens front and back, bigger distortion can not take place in the color of image; When the image pickup mode of video camera is grayscale mode, perhaps when video camera is less demanding to color assurance degree, can two field picture not carried out color space conversion.
When two field picture is carried out color space conversion, with the video image of input from a color space conversion to another one or the several objects color space, and the data of each passage of export target color space.
Step 304: the number of pixels of calculating each the grey level correspondence in each passage of color space correspondence of a two field picture.
Step 305: the probability that occurs according to each grey level in each passage after the number of pixels output normalization, the probability that each grey level is occurred is as the statistics with histogram information of each passage.
Step 306: the probability that each grey level in each passage is occurred adds up, and obtains the accumulative histogram of each passage.
Step 307: obtain to adjust preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank according to accumulative histogram.
Need to prove that the mode that above-mentioned steps 306 and step 307 illustrate by accumulative histogram obtains mapping relations; In addition, the embodiment of the present application also can adopt the histogrammic mode of local averageization to obtain mapping relations, and perhaps, the mode that accumulative histogram and local equalization histogram are combined obtains mapping relations, and this embodiment of the present application is not limited.
The mapping relations that obtained are exactly to be used for mapping relations that statistics with histogram information is strengthened, these mapping relations can be adjusted histogrammic shape, make the ground that distributes in its tonal range (0 to 255) more even, thereby strengthen the contrast of image at image.
Step 308: the grey scale pixel value of each pixel that obtains each passage of image is as the grey scale pixel value before adjusting.
Directly carry out this step for the two field picture that does not satisfy the frame period threshold value in the step 302, promptly the contrast mapping relations of the two field picture by satisfying frame period are to other two field picture degree of the comparing adjustment in this frame period.
Step 309:, obtain the adjusted grey scale pixel value of each pixel correspondence according to the pixel grey scale rank coupling mapping relations before adjusting.
Step 310: each pixel is carried out the gray scale adjustment according to adjusted grey scale pixel value.
Step 311: adjusted each passage is synthesized the contrast of finishing image handle.
Referring to Fig. 4 A, be the structural representation of the applied a kind of picture pick-up device of the embodiment of the present application, complete showing in this picture pick-up device: image processing module 450, contrast processing module 460 and coding modules 470 such as camera lens module 410, image sensor module 420, color interpolation module 430, exposure control module 440, white balance as lower module.Wherein, contrast processing module 460 in the embodiment of the present application in picture pick-up device, carrying out the module that the front end contrast is handled to be increased, the function of other module is consistent with prior art.Contrast processing module 460 can further be subdivided into color space conversion submodule 461, statistics with histogram submodule 462, histogram enhancer module 463 and pixel and remap submodule 464.
In conjunction with Fig. 4 A, outside scenery is through the optical path of camera lens module 410, on image sensor module 420, form real image, become the view data of Bayer form via imageing sensor, carry out color interpolation through 430 pairs of Bayer data of color interpolation module again, and be transformed into specific color space, view data after will handling then outputs to exposure control module 440, exposure control module 440 is exported on the one hand to camera lens, the control signal that shutter is controlled, on the one hand picture signal is outputed to image processing modules 450 such as white balance, picture signal is carried out output to contrast processing module 460 after the processing such as Automatic white balance, carry out outputing to coding module 470 after the auto contrast strengthens via 460 pairs of view data of contrast processing module, show or handle through outputing to rear end (for example, PC etc.) after coding module 470 coding again.
460 pairs of view data of contrast processing module are carried out the auto contrast when strengthening, at first, optionally, the picture signal of image processing modules such as white balance 450 being imported by color space conversion submodule 461 is transformed into another one or other several color space from a color space, after the execution color space transforms needed calculating, the video data of each passage of export target color space, and statistics and storage are used for the follow-up color data that histogram strengthens of carrying out; Each passage in 462 pairs of primitive color spaces of statistics with histogram submodule, perhaps each passage in the color space conversion submodule 461 color of object space of being exported carries out statistics with histogram, number of pixels to each grey level correspondence in each passage carries out stored counts, and be normalized to the probability that each grey level occurs in this channel image, export the statistics with histogram information of each passage then; The probability that histogram enhancer module 463 occurs according to each grey level in the statistics with histogram information, the histogrammic shape of adaptive adjustment, histogram is more evenly distributed in whole tonal range, thereby realize the contrast of video image is strengthened, what histogram enhancer module 463 was exported mainly is the mapping relations between the pixel grey scale rank before and after histogram strengthens; Pixel remaps the pixel grey scale rank mapping relations before and after the enhancing that submodule 464 exported according to histogram enhancer module 463, each pixel to video image remaps, give its new grey scale pixel value, after the gray value of all pixels of entire image shone upon, the gray value of pixel is arrived whole tonal range by reasonable distribution, thereby has improved the contrast of entire image.In addition, need to prove, consider the continuity and the similitude of video image adjacent several frames in the special time scope, in order to improve the speed of service of picture pick-up device, also can just carry out a histogram every some two field pictures strengthens, for other consecutive frame image in this time range, can remap submodule 464 by pixel and other consecutive frame image be remapped correspondence according to the mapping relations that a histogram enhancing obtains, other consecutive frame image is after 450 outputs of image processing modules such as white balance, can be directly inputted to pixel and remap submodule 464 and remap, encoded then module 470 is handled laggard line output.
Below in conjunction with Fig. 4 A, an application example that utilizes the embodiment of the present application that the contrast of one two field picture is handled is described.
The first, obtain a two field picture as key frame.Key frame refers to the contrast of video image is carried out when frame is handled, a two field picture that is received is for recomputating a two field picture of pixel grey scale rank mapping relations, and other two field picture can be by pixel grey scale rank mapping relations degree of the comparing adjustment of key frame;
The second, the key frame that obtains is carried out color space conversion as original image frame to it.When carrying out color space conversion, can colored original image frame be handled to obtain the better contrast effect by information in conjunction with a plurality of color spaces.For example, if the color space of original image frame is a rgb format, then rgb format can be transformed into the color space of yuv format, if the color space of original image frame is a yuv format, then it can be transformed into the color space of rgb format, if the color space of original image frame is yuv format or rgb format, then also it can be transformed into the color space of forms such as the color space of HSI form or CMY, perhaps also a kind of color space of form can be transformed into the color space of multiple form, this embodiment of the present application is not limited.When carrying out color space conversion, can carry out, not repeat them here according to existing color space conversion mode;
The 3rd, carry out statistics with histogram.No matter whether original image frame is carried out the conversion of color space, the color space of pending original image frame is all corresponding a plurality of passages, when each passage to these selected color spaces carries out statistics with histogram, suppose that c is certain channel components in the selected picture frame, i is certain grey level of this selected channel components c, then when carrying out statistics with histogram, need add up, obtain the statistic histogram h of channel components c the value of each pixel among the channel components c
c(i), the abscissa of this statistic histogram has been represented different grey levels, and ordinate has been represented the number of pixels that each grey level comprised in the image, obtains statistics with histogram information h
c(i) time, can adopt following formula:
In the following formula, n represents the number of pixels of a two field picture, n
iThe expression grey level is the number of times that the pixel of i occurs, and grey level i span is [l
Min, l
Max], wherein, l
MinBe the minimal gray rank of image, l
MaxFor the maximum gray scale of image other;
The 4th, carry out histogram and strengthen.It mainly is the adjustment of histogram being carried out shape that histogram strengthens, and it is reasonable more, even that it is distributed in tonal range, thereby strengthens the contrast of original image frame indirectly.When carrying out the histogram enhancing, can adopt several different methods as follows:
Method 1:
At aforementioned statistics with histogram information h
c(i), it is added up, obtain the accumulative histogram of passage c, accumulative histogram can be obtained by following formula:
By following formula as can be known, the histogram h after the normalization
c(i) also be the probability density function of each gray scale of passage c simultaneously, and s
c(i) be h
c(i) accumulated probability density.
Before and after histogram strengthens any pixel grayscale of passage c other remap and concern T
c(i) can obtain by following formula:
T
c(i)=[k
1*s
c(i)+k
2*ζ(i)]*(l
max-l
min)+l
min
In the following formula, ζ (i) is a pre-set histogram optimal curve, and its typical shape can be shown in Fig. 4 B, s
c(i) be the histogram equalization curve, k
1, k
2Be the weight coefficient of equalization curve and default histogram optimal curve, generally can be with k
1, k
2All be set at 0.5, distinguishingly, also can be with k
2Be made as 0.
Method 2:
For aforementioned statistics with histogram information h
c(i), it carry out local averageization, obtain the local average histogram of passage c, the local average histogram can obtain by following formula:
In the following formula, k is the smoothing factor of local averageization, but general value is (l
Max-l
MinThe local average histogram is asked for mainly in order to make histogram more level and smooth in)/32, is keeping removing the little spike in the histogram under the immovable prerequisite of histogram global shape.
After having obtained the local average histogram, can be from i=l
MinBeginning increases progressively the i value gradually, local equalization histogram is traveled through, if detect certain p
c(i)>G
c, then i value at this moment is designated as l
Min'; Same, from i=l
MaxBegin to successively decrease gradually the i value, local equalization histogram is traveled through, if detect certain p
c(i)>G
c, then i value at this moment is designated as l
Max'; Wherein, G
cBe a preset threshold value, this threshold value is used to control the histogram enhanced strength.
After above-mentioned traversal is finished, before and after can strengthening with the following formula compute histograms any pixel grayscale of passage c other remap and concern T
c(i):
In the following formula, ζ (i) is a pre-set histogram optimal curve equally, and its meaning is with identical shown in shape and the method 1.
Method 3:
For aforementioned statistics with histogram information h
c(i), asking for its accumulative histogram s
c(i) time, can adopt following formula:
Asking its local average histogram p
c(i) time, can adopt following formula:
The traversal that increases progressively in the local average histogram and successively decrease then increases progressively and detects certain p
c(i)>G
cThe time, then i at this moment is designated as l
Min'; Successively decrease and detect certain p
c(i)>G
c, then i at this moment is designated as l
Max'; G
cIt is a preset threshold value.
Before and after histogram strengthens any pixel grayscale of passage c other remap and concern T
c(i) can obtain by following mode:
Wherein, s
c(i) be the histogram equalization curve,
Be histogram shape curve, k
1, k
2Be the weight coefficient of equalization curve and pattern curve, generally can all get 0.5.
Can obtain by following formula:
Need to prove, more than three kinds of methods only be several may implementations the describing that histogram in the embodiment of the present application is strengthened, be not limited to the concrete scope of application and the using method of the embodiment of the present application.
The 5th, according to the pixel mapping relation original image frame is remapped.The enhancing of aforementioned process histogram can obtain remapping of any pixel grey scale rank of passage c i and concern T
c(i), therefore, according to T
c(i) can recomputate the channel components c ' after promptly being enhanced after the calculating to the gray value of all pixels of passage c.After each passage to original image frame carries out above-mentioned processing, each passage is synthesized, promptly obtain the result images after the auto contrast handles.
Different and according to selected color space to the requirement of amount of calculation, can carry out flexibly the processing of each passage.For example, for the RGB passage, synthetic again after can respectively three passages of RGB being handled; Perhaps also can be to after wherein certain passage is handled, directly all passages are remapped processing with the mapping relations of this passage; Perhaps also can calculate mapping relations, then all passages be remapped processing with the mean value of RGB passage; Perhaps also can ask for mapping relations such as Y passage, then to the processing of remapping of all passages in conjunction with other color space with the YUV color space.
In the foregoing description, the contrast processing that image is carried out is that the contrast of carrying out in digital photographing apparatus is handled, promptly before compressing or transmit, realizes image the contrast of image is strengthened, avoided image degree of comparing enhancement process to compression or the quality decline of transmission back, cause the noise of image or disturb the problem that further enlarges, by in the optimization process of digital photographing apparatus degree of comparing front end, strengthened the display effect of video image thus; The embodiment of the present application can solve because the problem of contrast deficiency such as the image that a variety of causes such as illumination condition causes is gloomy increases the clear sense of video image, thereby promotes the visual effect of the video image that picture pick-up device exports.
Corresponding with the embodiment of the processing method of the application's picture contrast, the application also provides the embodiment of the processing unit of picture contrast.
Referring to Fig. 5, be the first embodiment block diagram of the processing unit of the application's picture contrast.
This device comprises: acquiring unit 510, statistic unit 520, adjustment unit 530 and map unit 540.
Wherein, acquiring unit 510 is used to obtain a pending two field picture;
Statistic unit 520 is used for pairing each passage of the color space of a two field picture is carried out statistics with histogram, obtains statistics with histogram information;
Adjustment unit 530 be used for adjusting according to statistics with histogram information the pixel grey scale distribution of image, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank is adjusted in output;
Map unit 540 is used for remapping according to the grey scale pixel value of mapping relations to image, obtains the image after contrast is handled.
Referring to Fig. 6, be the second embodiment block diagram of the processing unit of the application's picture contrast.
This device comprises: default unit 610, acquiring unit 620, converting unit 630, statistic unit 640, adjustment unit 650 and map unit 660.
Wherein, default unit 610 is used to set in advance the frame period threshold value of obtaining a two field picture;
Acquiring unit 620, be used to obtain satisfy the frame period threshold value a two field picture as a pending two field picture;
Converting unit 630 is used for the color space of the two field picture that obtains is changed;
Statistic unit 640 is used for pairing each passage of the color space after the conversion of a two field picture is carried out statistics with histogram;
Adjustment unit 650 be used for adjusting according to statistics with histogram information the pixel grey scale distribution of image, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank is adjusted in output;
Map unit 660 is used for remapping according to the grey scale pixel value of mapping relations to image, obtains the image after contrast is handled.
Referring to Fig. 7 A, be the embodiment block diagram of the statistic unit that installs shown in Fig. 6.
This statistic unit 640 comprises: number of pixels computation subunit 641 and gray probability normalization subelement 642.
Wherein, number of pixels computation subunit 641 is used for calculating the number of pixels of each grey level correspondence of each passage of the color space correspondence of a described two field picture;
Gray probability normalization subelement 642 is used for the probability that each grey level according to each passage after the described number of pixels output normalization occurs, and the probability that described each grey level is occurred is as the statistics with histogram information of described each passage.
Referring to Fig. 7 B, be the embodiment block diagram of a kind of adjustment unit of installing shown in Fig. 6.
This adjustment unit 650 comprises: histogram accumulative total subelement 651 and mapping relations are obtained subelement 652.
Wherein, histogram accumulative total subelement 651 is used for the probability that each grey level to each passage occurs and adds up, and obtains the accumulative histogram of each passage;
Mapping relations are obtained subelement 652, are used for obtaining to adjust preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank according to accumulative histogram.
Referring to Fig. 7 C, be the embodiment block diagram of the another kind of adjustment unit that installs shown in Fig. 6.
This adjustment unit 650 comprises: histogram local average beggar unit 653, histogram traversal subelement 654 and mapping relations are obtained subelement 655.
Wherein, histogram local average beggar unit 653 is used for the probability that each grey level to each passage occurs and carry out local averageization, obtains the local average histogram information of each passage;
Histogram traversal subelement 654 is used for according to default target histogram described local average histogram being traveled through, and the minimal gray rank and the maximum gray scale that obtain to satisfy the specify arithmetic relation are other;
Mapping relations are obtained subelement 655, be used for according to the minimal gray rank and the maximum gray scale of described specify arithmetic relation other, pixel grey scale rank before obtaining to adjust and the mapping relations between the adjusted pixel grey scale rank.
Referring to Fig. 7 D, be the embodiment block diagram of the map unit of installing shown in Fig. 6.
This map unit 660 comprises: the source pixel gray scale is obtained subelement 661, object pixel gray scale coupling subelement 662, pixel grey scale adjustment subelement 663 and passage synthon unit 664.
Wherein, the source pixel gray scale is obtained subelement 661, and the grey scale pixel value of each passage that is used to obtain described each pixel of image is as the grey scale pixel value before adjusting;
Object pixel gray scale coupling subelement 662 is used for mating described mapping relations according to the grey scale pixel value before the described adjustment, obtains the adjusted grey scale pixel value of each pixel in the correspondence of described each passage;
Pixel grey scale is adjusted subelement 663, is used for according to described adjusted grey scale pixel value described each pixel being carried out the grey level adjustment at each passage;
Passage synthon unit 664 is used for that adjusted each passage is synthesized the contrast of finishing image and handles.
As seen through the above description of the embodiments, the embodiment of the present application is applied in the picture pick-up device image degree of comparing is handled, after obtaining a pending two field picture, pairing each passage of the color space of this two field picture is carried out statistics with histogram, obtain statistics with histogram information, the pixel grey scale of adjusting this image according to statistics with histogram information distributes, and preceding pixel grey scale rank and the mapping relations between the adjusted pixel grey scale rank are adjusted in output, remap according to the grey scale pixel value of mapping relations, obtain the image after contrast is handled this image.It is that the contrast of carrying out in picture pick-up device is handled that the contrast that application the embodiment of the present application is carried out image is handled, promptly before compressing or transmit, realizes image the contrast of image is strengthened, avoided image degree of comparing enhancement process to compression or the quality decline of transmission back, cause the noise of image or disturb the problem that further enlarges, by in the optimization process of digital photographing apparatus degree of comparing front end, strengthened the display effect of video image thus.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the application and can realize by the mode that software adds essential general hardware platform.Based on such understanding, the part that the application's technical scheme contributes to prior art in essence in other words can embody with the form of software product, this computer software product can be stored in the storage medium, as ROM/RAM, magnetic disc, CD etc., comprise that some instructions are with so that a computer equipment (can be a personal computer, server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the application or embodiment.
Each embodiment in this specification all adopts the mode of going forward one by one to describe, and identical similar part is mutually referring to getting final product between each embodiment, and each embodiment stresses all is difference with other embodiment.Especially, for system embodiment, because it is substantially similar in appearance to method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
The application can describe in the general context of the computer executable instructions of being carried out by computer, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract, program, object, assembly, data structure or the like.Also can in distributed computing environment (DCE), put into practice the application, in these distributed computing environment (DCE), by by communication network connected teleprocessing equipment execute the task.In distributed computing environment (DCE), program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
Though described the application by embodiment, those of ordinary skills know, the application has many distortion and variation and the spirit that do not break away from the application, wish that appended claim comprises these distortion and variation and the spirit that do not break away from the application.