TWI387329B - Method of creating histogram according a digital image - Google Patents

Method of creating histogram according a digital image Download PDF

Info

Publication number
TWI387329B
TWI387329B TW97148763A TW97148763A TWI387329B TW I387329 B TWI387329 B TW I387329B TW 97148763 A TW97148763 A TW 97148763A TW 97148763 A TW97148763 A TW 97148763A TW I387329 B TWI387329 B TW I387329B
Authority
TW
Taiwan
Prior art keywords
partial
method
handheld device
values
average
Prior art date
Application number
TW97148763A
Other languages
Chinese (zh)
Other versions
TW201023635A (en
Inventor
ye lin Zhou
Xu Jun Qiu
Tony Tsai
Original Assignee
Inventec Appliances Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Appliances Corp filed Critical Inventec Appliances Corp
Priority to TW97148763A priority Critical patent/TWI387329B/en
Publication of TW201023635A publication Critical patent/TW201023635A/en
Application granted granted Critical
Publication of TWI387329B publication Critical patent/TWI387329B/en

Links

Description

Method for generating histograms from digital images

A histogram calculation method, in particular, a calculation method for decomposing a picture into a plurality of partial pictures, sampling each partial picture and converting the sampled values into a histogram.

In the current digital camera or digital camera, before taking a photo, a picture or a video, a reference image is taken, and a histogram indicating the brightness distribution of the full pixel is generated according to the brightness information of the reference image, and the color saturation is generated according to a calculation method. The value used for adjustment such as exposure and white balance. The digital camera or digital camera adjusts its shooting parameters according to these values, and then shoots to avoid problems such as color shift, light, shadow, and blurred image of photos, pictures or videos.

However, the prior art has more perfection, that is, although the mobile phone currently on the market has a camera function, when the mobile phone manufacturer manufactures the mobile phone, the adjustment parameters are first established in the mobile phone, so the user of the mobile phone or the mobile phone can only use the camera. The adjustment parameters of the construction and system have no ability to calculate the histogram for adjusting the shooting parameters. Moreover, the display screen of the mobile phone is generally too small, and the user sometimes cannot distinguish the exposure, color saturation, and white balance of the photo. Therefore, the photos taken by the camera of the mobile phone have problems such as color shift, light and shadow, reverse white, blurred image and the like.

In view of the above, the problem to be solved by the present invention is to provide a method for generating an adjustment parameter for photographing or a histogram for reference by a user.

In order to solve the above method problem, the technical means provided by the present invention discloses a method for generating a histogram according to a digital image. The method is applied to a handheld device with shooting capability. The handheld device first captures a reference picture, divides the reference picture into a plurality of partial images, calculates one sample value of each partial image, and finally converts all sample values into Always squared.

The present invention has superior effects over the prior art:

First, a histogram is quickly generated in the handheld device for reference by the user to adjust the shooting parameters of the handheld device. Alternatively, the operator can design an adjustment mechanism in the handheld device to enable the handheld device to adjust its own shooting parameters according to the histogram through the adjustment mechanism to enhance the applicability of the handheld device.

Second, in this method, the reference picture is divided into a plurality of partial maps, and the handheld device calculates the sample values to which the partial maps belong one by one, and the number of sampled values is equal to the number of partial maps, instead of the general The pixels are directly sampled for the conversion and calculation of the histogram. Therefore, during the histogram generation process, there is not a large amount of data to be calculated at the same time, and the same applies to the handheld device with low hardware capability and unable to calculate a large amount of data. , thereby improving the applicability of the handheld device.

In order to further understand the end point, structural features and functions of the present invention, the related embodiments and drawings are described in detail as follows:

Please refer to FIG. 1 , which is a schematic flowchart of an embodiment of the present invention. This method is suitable for handheld devices that can capture digital images. The process of this method is as follows:

First, the user first captures a reference picture 100 by using the handheld device (step S110).

Please refer to FIG. 2 , which is a schematic diagram of a reference picture according to an embodiment of the present invention. The reference picture 100 can be of two types. One is that the user first captures a digital photo by using the handheld device to form a digital image file, or temporarily archives Stored in a handheld device.

In addition, the reference picture 100 can be a projection of the shooting position of the handheld device, and the handheld device can first store the projection to form a temporary storage and store the memory in the handheld device (such as a memory card, flash memory). In the body, or in the scratchpad).

The handheld device divides the reference picture 100 into a plurality of partial views 110 (step S120) and the handheld device divides the reference picture 100 as follows:

First, a divided area is set by the handheld device, and the divided area is a rectangle or a square, but is not limited to the two methods, as long as the boundary can be completely reconnected and stacked in layers, such as a regular triangle. The regular hexagon can also be used as the shape of the divided area.

Assuming that the divided area is a square, the handheld device divides the reference picture 100 according to the divided area, and generates a plurality of partial maps 110 composed of rectangles and squares.

The generation of the rectangular partial map 110 is caused by the following reasons: (1) the length of the reference picture 100 is not a multiple of the length of the divided area; (2) the width of the reference picture 100 is not a multiple of the width of the divided area; 3) the length of the reference picture 100 is not a multiple of the width of the divided area; (4) the width of the reference picture 100 is not a multiple of the length of the divided area; (5) the length of the reference picture 100 is not a multiple of the length of the divided area, The width of the reference picture 100 is not a multiple of the width of the divided area, that is, the cases of (1) and (2) exist simultaneously; (6) the length of the reference picture 100 is not a multiple of the width of the divided area, and the reference picture 100 The width is not a multiple of the length of the divided area, that is, the cases of (3) and (4) exist simultaneously.

However, when the divided area is a rectangle, the partial map 110 different from the area of the divided area may be generated for the above reasons, and will not be described here.

Second, the length and width of the reference picture 100 are calculated by the handheld device, and then divided into a plurality of partial patterns 110 of the same shape or different shapes.

Referring to FIG. 3A and FIG. 3B, FIG. 3A is a schematic diagram of a square cut of a reference picture according to a first embodiment of the present invention, and FIG. 3B is a schematic diagram of a square cut of a reference picture according to the first embodiment of the present invention. Assume that the length and width of the reference map are 100 pixel units and 50 pixel units, respectively. The handheld device divides the length of the reference picture 100 by 20 and divides the width by 10 to define a partial map 110 having a length and a width of 5 pixel units (i.e., squares).

For example, FIG. 4A is a schematic diagram of a square cut of a reference picture according to a second embodiment of the present invention, and FIG. 4B is a schematic diagram of a square cut of a reference picture according to a second embodiment of the present invention. The length and width of the reference picture 100 are 100 pixel units and 50 pixel units, and the handheld device divides the length of the reference picture 100 by 10 and the width by 10 to divide the length into 10 pixel units and widths. A partial map of 5 pixel units (ie, a rectangle).

One sample value of each partial map 110 is calculated (step S130). In this step, the handheld device first establishes a sampling table having the same number of fields as the partial map 110.

Next, the handheld device will arrange all of the partial maps 110 to establish a read order. Thereafter, the handheld device sequentially acquires an unsampled partial map 110, and then reads the three primary color values of the respective pixels in the partial map 110. The handheld device accumulates the three primary color values of all pixels in the unsampled partial map 110 to form a total of three primary colors, the three primary color values individually corresponding to the above three primary colors.

For example, the length and width of the currently read partial map 110 are each 10 pixel units, so the unsampled partial map 110 has 10×10, that is, 100 pixel units. The handheld device calculates the three primary color values represented by each pixel in the 100 pixel unit, that is, the RGB values (R, RED, red; G, GREEN, green; B, BLUE, blue). Therefore, 100 pixel units each have 100 R primary color values, 100 G primary color values, and 100 B primary color values. The handheld device will accumulate 100 R primary color values into a total R primary color value, accumulate 100 G primary color values into a G primary color total value, and accumulate 100 B primary color values into a B primary color total value.

Then, the handheld device calculates a plurality of primary color averages based on the number of all pixels of the unsampled partial map 110 and the total values of all primary colors. The so-called primary color average refers to the value of the total color of the primary color divided by the number of pixels. In this example, the average of the primary colors has the average value of the R primary colors, that is, the total value of the R primary colors divided by 100 (the number of pixels); The value, that is, the total value of the G primary colors divided by 100 (the number of pixels); the B primary color average, that is, the total value of the B primary colors divided by 100 (the number of pixels). The average color of the primary color is the sum of the average values of the R primary colors, the average of the primary colors of G, and the average of the primary colors of B.

After that, the handheld device converts all the primary color averages and local average values into the aforementioned sample values and imports them into the corresponding fields of the sampling table. That is to say, the current partial image 110 of the first sequence is sampled, and the handheld device introduces the current sampling value into the first field of the sampling table; the current sampling of the 53th sequential partial image 110, the handheld device is about to be this time. The sampled value is imported into the 53rd field of the sample table, and so on.

Then, the handheld device determines whether all of the partial maps 110 have been completely sampled. When the determination is yes, the sampling of the partial map 110 is stopped. When the determination is no, the unsampled partial map 110 is sequentially sampled in the order of the partial maps 110 that have not been sampled.

However, in the above steps, in order to speed up the process of sampling values, the handheld device may adopt a multi-thread calculation method, or adopt a multi-task or time-sharing calculation method. The sample values of the two or more partial maps 110 are calculated substantially simultaneously.

In addition, the sampled values are in RGB565 format, RGB444 format, RGB555 format, RGB666 or RGB332 format. Each sample value contains the R primary color average, the G primary color average and the B primary color average. Generally, these values are represented by double-byte (DWORD) data, and the average value of each primary color is 0. To 31.

Finally, the handheld device converts all sampled values into a histogram (step S140). In this step, the handheld device derives the sampled value of the sampling table to the data structure of the histogram according to the field order of the sampling table. In this embodiment, the data structure of the histogram is:

Hist{R(n), G(n), B(n), W(n)}; Hist[32].

In the above data structure, Hist refers to the Histogram, the English name of the histogram, R(n) refers to the R primary color average, G(n) refers to the G primary color average, and B(n) refers to the B primary color average. W(n) refers to a local average, and n refers to the field order of the sampling table to which the current sample value belongs, and also represents the order of the partial map 110. This W(n) refers to the local average corresponding to the nth partial map 110. This local average is the average of the average of the three primary colors of R(n), G(n), and B(n) of the nth partial map 110.

Please refer to FIG. 5 , which is a schematic diagram of a histogram display according to an embodiment of the present invention. The histogram displayed by the handheld device has four curves, and the number of values referred to by the histogram is the same as the number of the partial map 110. Therefore, the handheld device can be a personal digital assistant with a simple embedded system, a mobile phone, or a multi-thread capable of executing a multi-thread like Windows Mobile or Windows CE. (Multi-Task) or time-sharing calculations such as smart phones.

While the present invention has been described above in terms of the preferred embodiments thereof, it is not intended to limit the invention, and the equivalent of the modification and retouching of the present invention is still within the spirit and scope of the present invention. Within the scope of patent protection of the present invention.

100. . . Benchmark picture

110. . . Partial view

1 is a schematic flow chart of an embodiment of the present invention;

2 is a schematic diagram of a reference picture of an embodiment of the present invention;

3A is a schematic view showing a square cut of a reference picture according to a first embodiment of the present invention;

3B is a schematic view showing the completion of the square cut of the reference picture according to the first embodiment of the present invention;

4A is a schematic view showing a rectangular cut of a reference picture according to a second embodiment of the present invention;

4B is a schematic view showing completion of rectangular cutting of a reference picture according to a second embodiment of the present invention;

FIG. 5 is a schematic diagram showing a histogram display of an embodiment of the present invention.

Claims (11)

  1. A method for generating a histogram according to a digital image, which is applied to a handheld device capable of capturing a digital image system, the method comprising: capturing a reference picture; dividing the reference picture into a plurality of partial images; and calculating each of the partial portions a sampled value of the image; obtaining an unsampled partial image; accumulating the three primary color values of the plurality of pixels of the unsampled partial image to form three primary color values corresponding to the three primary colors respectively; according to the unsampled partial image Calculating a plurality of primary color average values for the number of equal pixels and the total value of the primary colors; converting the average of the primary colors to the sampled value; and when determining that the full sample values of the partial images are not calculated, repeating the obtaining Sampling a partial map until a step of converting a sample value; and converting the sampled values to a histogram.
  2. The method of claim 1, wherein the average of the primary colors is the total value of each of the primary colors divided by the number of the pixels.
  3. The method of claim 1, wherein the histogram shows a local average of each of the partial maps, each of the local averages being the average of the primary colors of each of the partial maps. An average.
  4. The method of claim 1, wherein the calculation is performed In one of the sampling values of the partial maps, the handheld device uses a multi-thread calculation method to simultaneously calculate the sample values of the two or more of the partial maps.
  5. The method of claim 1, wherein in the step of calculating a sample value for each of the partial maps, the handheld device uses a multi-task calculation method to simultaneously calculate two or more The sampled values of the partial maps.
  6. The method of claim 1, wherein the sampled value is RGB565 format, RGB444 format, RGB555 format, RGB666 or RGB332 format.
  7. The method of claim 1, wherein the shape of the partial map is selected from the group consisting of a rectangle and a square.
  8. The method of claim 1, wherein the step of dividing the reference picture into a plurality of partial maps, the handheld device calculating the length and width of the reference picture to plan to have the same length and the same width These partial maps.
  9. The method of claim 1, wherein the sample value is a double-byte format (Double Word; DWORD).
  10. The method of claim 1, wherein the handheld device is a personal digital assistant.
  11. The method of claim 1, wherein the handheld device is a mobile phone.
TW97148763A 2008-12-15 2008-12-15 Method of creating histogram according a digital image TWI387329B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97148763A TWI387329B (en) 2008-12-15 2008-12-15 Method of creating histogram according a digital image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97148763A TWI387329B (en) 2008-12-15 2008-12-15 Method of creating histogram according a digital image

Publications (2)

Publication Number Publication Date
TW201023635A TW201023635A (en) 2010-06-16
TWI387329B true TWI387329B (en) 2013-02-21

Family

ID=44833481

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97148763A TWI387329B (en) 2008-12-15 2008-12-15 Method of creating histogram according a digital image

Country Status (1)

Country Link
TW (1) TWI387329B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060147112A1 (en) * 1999-03-12 2006-07-06 Electronics And Telecommunications Research Institute Method for generating a block-based image histogram
US20070183660A1 (en) * 2006-02-08 2007-08-09 Samsung Electronics Co., Ltd. Apparatus and method for histogram analysis of image and luminance compensation apparatus using the same
US20070196013A1 (en) * 2006-02-21 2007-08-23 Microsoft Corporation Automatic classification of photographs and graphics
US20080312874A1 (en) * 2007-06-13 2008-12-18 Nvidia Corporation Efficient Histogram Generation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060147112A1 (en) * 1999-03-12 2006-07-06 Electronics And Telecommunications Research Institute Method for generating a block-based image histogram
US20070183660A1 (en) * 2006-02-08 2007-08-09 Samsung Electronics Co., Ltd. Apparatus and method for histogram analysis of image and luminance compensation apparatus using the same
US20070196013A1 (en) * 2006-02-21 2007-08-23 Microsoft Corporation Automatic classification of photographs and graphics
US20080312874A1 (en) * 2007-06-13 2008-12-18 Nvidia Corporation Efficient Histogram Generation

Also Published As

Publication number Publication date
TW201023635A (en) 2010-06-16

Similar Documents

Publication Publication Date Title
US9615012B2 (en) Using a second camera to adjust settings of first camera
JP4234195B2 (en) Image segmentation method and image segmentation system
DE112006000358B4 (en) Method and device for creating a panoramic image
US6614996B2 (en) Image forming apparatus and image forming method
CN101600054B (en) Camera, and camera control method
RU2523027C1 (en) Flash synchronisation using image sensor interface timing signal
CN101800857B (en) Image capturing apparatus and control method thereof
US20020171747A1 (en) Image capturing apparatus, and method of display-control thereof
JP3758452B2 (en) Recording medium, image processing device, and image processing method
US8311362B2 (en) Image processing apparatus, imaging apparatus, image processing method and recording medium
US20100208099A1 (en) Imaging device and imaging method
JP2004064676A (en) Image pickup apparatus
US20080143841A1 (en) Image stabilization using multi-exposure pattern
JP4135100B2 (en) Imaging device
KR101229600B1 (en) Image capturing apparatus and camera shake correction method, and computer-readable medium
US7952618B2 (en) Apparatus for controlling display of detection of target image, and method of controlling same
JP4193804B2 (en) Imaging device, image storage device, imaging method, storage method, and program
US8723974B2 (en) Image pickup apparatus, image pickup method and recording device recording image processing program
US8866927B2 (en) Determining an image capture payload burst structure based on a metering image capture sweep
JP2006087063A (en) Multiple exposure image composite system and multiple exposure image composite method
JP3468231B2 (en) Image processing apparatus, image quality control method, program, and recording medium
KR20110010076A (en) Image processing apparatus, image processing method, and storage medium thereof
US8237809B2 (en) Imaging camera processing unit and method
TWI293846B (en) Image pickup device with brightness correcting function and method of correcting brightness of image
US8294805B2 (en) Image capturing apparatus capable of displaying live preview image