[go: up one dir, main page]

CN100594418C - Image capturing device, focusing method thereof and method for determining image contrast value - Google Patents

Image capturing device, focusing method thereof and method for determining image contrast value Download PDF

Info

Publication number
CN100594418C
CN100594418C CN200610145865A CN200610145865A CN100594418C CN 100594418 C CN100594418 C CN 100594418C CN 200610145865 A CN200610145865 A CN 200610145865A CN 200610145865 A CN200610145865 A CN 200610145865A CN 100594418 C CN100594418 C CN 100594418C
Authority
CN
China
Prior art keywords
image
absolute value
brightness difference
value
mentioned
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN200610145865A
Other languages
Chinese (zh)
Other versions
CN101191978A (en
Inventor
谢汶宏
蔡净榕
杨智鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Asia Optical Co Inc
Original Assignee
Asia Optical Co Inc
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 Asia Optical Co Inc filed Critical Asia Optical Co Inc
Priority to CN200610145865A priority Critical patent/CN100594418C/en
Publication of CN101191978A publication Critical patent/CN101191978A/en
Application granted granted Critical
Publication of CN100594418C publication Critical patent/CN100594418C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Automatic Focus Adjustment (AREA)

Abstract

An image capturing device, a focusing method thereof and a method for determining an image contrast value are provided. Firstly, performing auto-focusing according to a contrast value of an image generated by a lens on a photosensitive component, wherein the determination of the contrast value of the image comprises: selecting an area of the image; determining the absolute value of the difference in brightness for each set of neighboring pixels over the area; and determining a specific brightness difference absolute value as the contrast value of the image according to the distribution of the obtained brightness difference absolute values, wherein the distribution is obtained by the corresponding relation of the brightness difference absolute value and the brightness difference absolute value of the same color and the number of strokes of adjacent pixels.

Description

影像撷取装置、其对焦方法以及影像对比值的确定方法 Image capture device, its focusing method and method for determining image contrast value

技术领域 technical field

本发明有关于影像处理技术,且特别有关于一种影像撷取装置、其对焦方法以及影像对比值的确定方法。The present invention relates to image processing technology, and particularly relates to an image capturing device, its focusing method and a method for determining image contrast value.

背景技术 Background technique

相机的自动对焦功能可以藉助于测距装置测量物相对于镜头的位置,据以调整镜距以对焦。被动式自动对焦的数字相机不需要测距装置,而是利用镜头撷取的数字化影像,以频域转换后的值作为清晰度的关键值,据以改变镜头焦距或是物距,藉以寻找关键值的最大值以呈现最清晰的画面。The autofocus function of the camera can measure the position of the object relative to the lens with the help of a distance measuring device, and adjust the lens distance to focus accordingly. Passive auto-focus digital cameras do not require a distance measuring device, but use the digitized image captured by the lens, and use the value after frequency domain conversion as the key value of sharpness, so as to change the focal length of the lens or the object distance to find the key value The maximum value for the clearest picture.

而对焦点的搜寻法,正是目前被动式自动对焦的发展课题。现今研发数字相机皆使用专门的数字讯号处理器(Digital Signal Processor,简称DSP),在DSP内部皆有包含侦测是否成功完成对焦的硬件。但是,此对焦方法仍有缺点。举例来说,例如对焦物为一根头发时,DSP一般的确定方式是把画面中的像素(Pixel)亮度值两两相减之后取平均值或累加作为对比值,但这却会把头发周围像素亮度相减所得的对比值平均,使像素亮度差异大者在对比值中的比重减轻,而无法准确的对焦。The focus search method is the current development topic of passive auto focus. Today's research and development of digital cameras all use a dedicated digital signal processor (Digital Signal Processor, referred to as DSP), and there is hardware in the DSP to detect whether the focus is successfully completed. However, this focusing method still has disadvantages. For example, when the focus object is a hair, the DSP generally determines the brightness values of the pixels (Pixel) in the picture by subtracting them and then taking the average value or summing them up as a contrast value, but this will make the surrounding hair The contrast value obtained by subtracting the pixel brightness is averaged, so that the proportion of the pixel brightness difference in the contrast value is reduced, and accurate focusing cannot be achieved.

发明内容 Contents of the invention

有鉴于此,本发明的目的在于提供影像撷取装置、其对焦方法以及影像对比值的确定方法。In view of this, the object of the present invention is to provide an image capture device, a focusing method thereof, and a method for determining an image contrast value.

基于上述目的,本发明提供一种影像撷取装置,包含:一感光组件,用以转换光束为电子讯号;一镜头,用以在上述感光组件上呈像;一处理器,根据在上述感光组件上产生的一影像的对比值以执行自动对焦,其中上述处理器选取上述影像的一区域,确定上述区域上的每一组两颜色相同且相邻像素的亮度差绝对值,并根据上述确定所得亮度差绝对值相同的同色且相邻像素的分布情况决定一特定亮度差绝对值作为上述影像的对比值,该分布情况通过亮度差绝对值与亮度差绝对值相同的同色且相邻像素的笔数的对应关系得到。Based on the above purpose, the present invention provides an image capture device, comprising: a photosensitive component, used to convert light beams into electronic signals; a lens, used to form an image on the above photosensitive component; a processor, based on the above photosensitive component The contrast value of an image generated on the above-mentioned image is used to perform auto-focus, wherein the above-mentioned processor selects an area of the above-mentioned image, determines the absolute value of the brightness difference of each group of two adjacent pixels with the same color on the above-mentioned area, and obtains according to the above-mentioned determination The distribution of adjacent pixels of the same color with the same absolute value of brightness difference determines a specific absolute value of brightness difference as the contrast value of the above-mentioned image. The corresponding relationship of numbers is obtained.

本发明所述的影像撷取装置,其中,上述处理器统计所得的所有上述亮度差绝对值中该数值相同的笔数,其中上述分布包含亮度差绝对值对应亮度差绝对值相同的笔数,上述处理器从上述所有亮度差绝对值的最大值往最小值,开始累加上述亮度差绝对值相同的笔数,以及当累加的总笔数加入一第一亮度差绝对值的笔数后等于或大于一预定数目,上述影像的对比值为该第一亮度差绝对值,其中所述累加的总笔数与所述第一亮度差绝对值均针对同一亮度差绝对值。In the image capture device according to the present invention, wherein the number of entries with the same value in all the absolute values of the brightness difference obtained by the processor is counted, wherein the distribution includes the number of entries with the same absolute value of the brightness difference corresponding to the absolute value of the brightness difference, The above-mentioned processor starts to accumulate the number of pens with the same absolute value of the above-mentioned brightness differences from the maximum value to the minimum value of the absolute value of all the brightness differences above, and when the accumulated total number of pens is added to the number of pens of the first absolute value of the brightness difference, it is equal to or If it is greater than a predetermined number, the contrast value of the image is the first absolute value of brightness difference, wherein both the accumulated total number and the first absolute value of brightness difference refer to the same absolute value of brightness difference.

本发明所述的影像撷取装置,其中,获得上述亮度差绝对值相同的笔数还包含:上述处理器每确定出上述区域上一组两颜色相同且相邻像素的亮度差绝对值后,即立即对该亮度差绝对值予以分类;以及待上述处理器确定完上述区域上每一组两颜色相同且相邻像素的亮度差绝对值后,即可同时获得上述亮度差绝对值相同的笔数。In the image capture device of the present invention, obtaining the number of items with the same absolute value of brightness difference further includes: after the processor determines the absolute value of brightness difference of two adjacent pixels with the same color in the above region, That is, the absolute value of the brightness difference is immediately classified; and after the above-mentioned processor determines the absolute value of the brightness difference of each group of two adjacent pixels with the same color on the above-mentioned area, the pen with the same absolute value of the above-mentioned brightness difference can be obtained at the same time. number.

根据本发明的影像撷取装置,其对焦方法包含:根据一镜头在一感光组件上产生的影像的对比值以执行自动对焦;在上述自动对焦过程中,利用一利用整个影像的对焦方法搜寻上述影像的最佳对比值;以及当搜寻上述影像的最佳对比值失败时,自动以一利用部分影像的对焦方法搜寻上述影像的最佳对比值。According to the image capture device of the present invention, its focusing method includes: performing auto-focusing according to the contrast value of an image generated by a lens on a photosensitive element; the optimal contrast value of the image; and when searching for the optimal contrast value of the above image fails, automatically search for the optimal contrast value of the above image by using a focusing method using part of the image.

本发明所述的对焦方法,其中,上述利用整个影像的对焦方法及上述利用部分影像的对焦方法分别选取上述影像的不同区域以确定上述影像的对比值。In the focusing method of the present invention, the above-mentioned focusing method using the whole image and the above-mentioned focusing method using part of the image respectively select different regions of the above-mentioned image to determine the contrast value of the above-mentioned image.

本发明所述的对焦方法,其中,上述利用部分影像的对焦方法从上述影像的一区域中的相邻像素的亮度差绝对值分布中,决定一特定亮度差绝对值作为上述影像的对比值。In the focusing method of the present invention, in the focusing method using partial images, a specific absolute value of brightness difference is determined as the contrast value of the image from the distribution of absolute brightness difference values of adjacent pixels in a region of the image.

本发明所述的对焦方法,其中,上述利用整个影像的对焦方法选取的影像范围为A,上述利用部分影像的对焦方法选取的影像范围为B,且上述区域的范围B不等同于上述影像的范围A。In the focusing method of the present invention, wherein, the image range selected by the focusing method using the entire image is A, and the image range selected by the focusing method using part of the image is B, and the range B of the above-mentioned area is not equal to the range of the above-mentioned image Range A.

根据本发明,所述影像对比值的确定方法,包含:根据一镜头在一感光组件上产生一影像,其中上述影像范围为A;选取上述影像的一区域,其中上述区域范围为B;确定上述区域上的每一组邻近像素的亮度差绝对值;以及根据上述确定所得一亮度差绝对值的分布决定一特定亮度差绝对值作为上述影像的对比值,该分布情况通过亮度差绝对值与亮度差绝对值相同的同色且相邻像素的笔数的对应关系得到。According to the present invention, the method for determining the image contrast value includes: generating an image on a photosensitive component according to a lens, wherein the range of the above image is A; selecting an area of the above image, wherein the range of the above area is B; determining the above The absolute value of the brightness difference of each group of adjacent pixels on the area; and determine a specific absolute value of the brightness difference as the contrast value of the above-mentioned image according to the distribution of the absolute value of the brightness difference obtained from the above determination, the distribution is determined by the absolute value of the brightness difference and the brightness difference The corresponding relationship of the number of adjacent pixels of the same color with the same absolute value difference is obtained.

本发明所述的影像对比值的确定方法,其中,上述区域的范围B不大于上述影像的范围A。In the method for determining the contrast value of an image according to the present invention, the range B of the above-mentioned region is not larger than the range A of the above-mentioned image.

本发明所述的影像对比值的确定方法,还包含:统计确定所得的所有上述亮度差绝对值中数值相同的笔数,以获得上述分布,其中上述分布包含亮度差绝对值对应亮度差绝对值相同的笔数;从上述所有亮度差绝对值的最大值往最小值,开始累加亮度差绝对值相同的笔数;以及当累加的总笔数加入一第一亮度差绝对值的笔数后等于或大于一预定数目,上述影像的对比值为该第一亮度差绝对值,其中所述累加的总笔数与所述第一亮度差绝对值均针对同一亮度差绝对值。The method for determining the contrast value of an image according to the present invention further includes: statistically determining the number of strokes with the same value in all the absolute values of the above-mentioned brightness differences obtained, so as to obtain the above-mentioned distribution, wherein the above-mentioned distribution includes the absolute value of the brightness difference corresponding to the absolute value of the brightness difference The same number of pens; from the maximum value to the minimum value of the absolute value of all brightness differences above, start to accumulate the number of pens with the same absolute value of brightness difference; and when the accumulated total number of pens is added to the number of pens of the first absolute value of brightness difference or greater than a predetermined number, the contrast value of the above-mentioned image is the first absolute value of brightness difference, wherein the total accumulated number and the first absolute value of brightness difference both refer to the same absolute value of brightness difference.

本发明所述的影像对比值的确定方法,其中,获得上述亮度差绝对值相同的笔数还包含:每确定出上述区域上一组邻近像素的亮度差绝对值后,立即对该亮度差绝对值予以分类;以及待确定完上述区域上每一组邻近像素的亮度差绝对值后,即可同时获得上述亮度差绝对值相同的笔数。The method for determining the image contrast value according to the present invention, wherein obtaining the number of strokes with the same absolute value of the brightness difference further includes: after each determination of the absolute value of the brightness difference of a group of adjacent pixels on the above-mentioned area, immediately absolute the brightness difference Values are classified; and after the absolute value of the brightness difference of each group of adjacent pixels on the above-mentioned area is determined, the number of strokes with the same absolute value of the above-mentioned brightness difference can be obtained at the same time.

为使本发明的上述目的、特征和优点能更明显易懂,下文特举详尽实施例并配合所附图式做详细说明。In order to make the above-mentioned objects, features and advantages of the present invention more comprehensible, the detailed embodiments are described in detail below together with the accompanying drawings.

附图说明 Description of drawings

图1:显示一影像撷取装置实施例的结构方块图;Fig. 1: shows the structural block diagram of an embodiment of an image capture device;

图2:显示对焦方法实施例的流程图;Figure 2: A flowchart showing an embodiment of a focusing method;

图3:显示对焦方法实施例的流程图;Figure 3: A flowchart showing an embodiment of a focusing method;

图4:显示一被动对焦的影像;Figure 4: Displaying a passive focus image;

图5:显示第二对焦方法实施例的流程图;Figure 5: a flow chart showing an embodiment of a second focusing method;

图6:显示图4的影像其中一影像区域的像素分布;Figure 6: Displays the pixel distribution of one of the image regions of the image in Figure 4;

图7:显示对比值的决定流程图;以及Figure 7: Decision flow chart showing contrast values; and

图8:显示亮度差绝对值对应亮度差绝对值相同的笔数分布。Figure 8: Displays the distribution of the number of pens whose absolute value of brightness difference corresponds to the same absolute value of brightness difference.

具体实施方式 Detailed ways

以下揭示一种对比值的确定方法、使用上述方法的影像撷取装置及对焦方法。须要了解的是,以下各实体及步骤的配置只是用以举例,而可以被调整。A method for determining a contrast value, an image capture device using the method, and a focusing method are disclosed below. It should be understood that the configurations of the following entities and steps are just examples and can be adjusted.

在图1的影像撷取装置100中,处理器1耦接记忆体2、感光组件4、输入装置6、镜头8及控制单元9。处理器1为数字讯号处理器(Digital Signal Processor,简称DSP)。控制单元9可以整合在处理器1之中。In the image capture device 100 in FIG. 1 , the processor 1 is coupled to the memory 2 , the photosensitive element 4 , the input device 6 , the lens 8 and the control unit 9 . The processor 1 is a digital signal processor (Digital Signal Processor, DSP for short). The control unit 9 can be integrated in the processor 1 .

感光组件4可以由互补金属氧化物半导体(Complementary Metal-OxideSemiconductor,简称CMOS)或电荷耦合组件(Charge-Coupled Device,简称CCD)构成。感光组件4从镜头8接收光束,藉以转换为电子讯号作为影像资料。The photosensitive element 4 can be composed of complementary metal-oxide semiconductor (Complementary Metal-Oxide Semiconductor, CMOS for short) or charge-coupled device (Charge-Coupled Device, CCD for short). The photosensitive element 4 receives the light beam from the lens 8, so as to convert it into an electronic signal as image data.

控制单元9耦接于对焦装置91,并根据处理器1提供的影像信息驱动对焦装置91,藉以自动调整镜头8或感光组件4的位置,以达到对焦的目的。控制单元9根据输入装置6状态激活自动对焦。输入装置6可以包含影像撷取系统100上的快门释放钮或外接式的激活控制装置。The control unit 9 is coupled to the focusing device 91 , and drives the focusing device 91 according to the image information provided by the processor 1 , so as to automatically adjust the position of the lens 8 or the photosensitive element 4 to achieve the purpose of focusing. The control unit 9 activates autofocus depending on the state of the input device 6 . The input device 6 may include a shutter release button on the image capture system 100 or an external activation control device.

镜头8可以由各种不同的镜头来实作。光束透过镜头8在感光组件4上呈像。举例来说,镜头8可以由数镜片组成,对焦装置91可以包含驱动对焦镜片81的位置的机械部件。The lens 8 can be implemented by various lenses. The light beam passes through the lens 8 to form an image on the photosensitive component 4 . For example, the lens 8 may consist of several lenses, and the focusing device 91 may include mechanical components for driving the position of the focusing lens 81 .

参照图2,处理器1移动对焦镜片81的位置,并根据镜头8在感光组件4上产生的影像的对比值以执行自动对焦。处理器1可以用不同方法进行对焦。Referring to FIG. 2 , the processor 1 moves the position of the focusing lens 81 , and performs auto-focus according to the contrast value of the image produced by the lens 8 on the photosensitive component 4 . Processor 1 can focus in different ways.

在自动对焦过程中,处理器1先利用第一方法进行对焦,以搜寻影像的最佳对比值(步骤S2),并判别是否成功找到最佳对比值(步骤S4)。当成功找到最佳对比值时,处理器1结束对焦作业。当搜寻影像的最佳对比值失败时,处理器1自动以第二方法搜寻上述影像的最佳对比值(步骤S6),其中第二方法不等同于第一方法。During the auto-focusing process, the processor 1 uses the first method to focus to search for the best contrast value of the image (step S2 ), and judges whether the best contrast value is successfully found (step S4 ). When the optimal contrast value is successfully found, the processor 1 ends the focusing operation. When searching for the best contrast value of the image fails, the processor 1 automatically searches for the best contrast value of the above-mentioned image by a second method (step S6 ), wherein the second method is not equal to the first method.

第一方法及第二方法可以分别取影像的不同区域以确定影像的对比值。举例来说,第一方法以整个影像作确定;第二方法则取整个影像的中间1/25的矩形区域以确定影像的对比值,其中第二方法所选取的矩形区域的长宽分别为整个影像的长宽的1/5倍。须要了解的是,实作上第二方法所取的区域可以是不同形状不同大小,也可以在上述影像的不同位置区域。The first method and the second method can respectively take different regions of the image to determine the contrast value of the image. For example, the first method uses the entire image for determination; the second method takes the middle 1/25 rectangular area of the entire image to determine the contrast value of the image, wherein the length and width of the rectangular area selected by the second method are respectively the entire 1/5 times the length and width of the image. It should be understood that, in practice, the regions selected by the second method can be of different shapes and sizes, and can also be in different positions of the above-mentioned image.

参照图3,处理器1在对焦镜片81的可移动范围内移动对焦镜片81(步骤S10)。对焦镜片81在每一位置时都会在感光组件4上形成一对应影像(步骤S12)。处理器1确定每一对应影像的对比值(步骤S14),找出具有最佳对比值的影像(步骤S16),并将对焦镜片81移至该影像对应的位置(步骤S18)。以此方式,处理器1根据在感光组件4上产生的影像的对比值以执行自动对焦。此对焦方法可优选利用台湾专利申请标题为“自动对焦方法及使用上述方法之影像撷取装置”的说明书揭示的技术。以较大的精度单位移动对焦镜片81,以求出较佳对比值及其对应位置。利用较佳对比值及其对应位置以及另外二笔数据(该对应位置前后有二位置及其二笔对比值)以内差方式求出绝对最佳对比值对应的位置。并将对焦镜片81移至该位置。Referring to FIG. 3, the processor 1 moves the focus lens 81 within the movable range of the focus lens 81 (step S10). When the focusing lens 81 is in each position, a corresponding image will be formed on the photosensitive element 4 (step S12 ). The processor 1 determines the contrast value of each corresponding image (step S14), finds the image with the best contrast value (step S16), and moves the focusing lens 81 to the corresponding position of the image (step S18). In this way, the processor 1 performs auto-focus according to the contrast value of the image generated on the photosensitive element 4 . This focusing method can preferably utilize the technology disclosed in the description of the Taiwan patent application titled "Automatic focusing method and image capture device using the above method". The focus lens 81 is moved with a larger precision unit to obtain a better contrast value and its corresponding position. The position corresponding to the absolute best contrast value is obtained by using the better contrast value and its corresponding position, and the other two data (there are two positions and their two contrast values before and after the corresponding position) by means of internal difference. And move the focusing lens 81 to this position.

图4显示对焦镜片81在一特定位置时,于感光组件4上的呈现影像200(步骤S12)。影像区域201为影像200的中间1/25的矩形区域。在上述第二方法中,处理器1可以从影像200中取影像区域201,再从影像区域201中相邻像素的亮度差绝对值分布中,决定一特定亮度差绝对值作为影像的对比值,详述如下。FIG. 4 shows an image 200 displayed on the photosensitive element 4 when the focusing lens 81 is at a specific position (step S12 ). The image area 201 is a rectangular area of the middle 1/25 of the image 200 . In the above-mentioned second method, the processor 1 can take the image area 201 from the image 200, and then determine a specific absolute value of the brightness difference from the distribution of the absolute value of the brightness difference of adjacent pixels in the image area 201 as the contrast value of the image, Details are as follows.

参照图5,处理器1取得影像200的影像区域201(步骤S20),确定影像区域201上的每一组邻近像素的亮度差绝对值,并记录已累积的笔数(步骤S22)。处理器1经由确定取得此影像区域201内亮度差绝对值的分布(步骤S24)。并根据此分布,决定一特定亮度差绝对值作为影像200的对比值(步骤S26)。Referring to FIG. 5, the processor 1 obtains the image area 201 of the image 200 (step S20), determines the absolute value of the brightness difference of each group of adjacent pixels on the image area 201, and records the accumulated number (step S22). The processor 1 obtains the distribution of the absolute value of the brightness difference in the image area 201 through determination (step S24 ). And according to the distribution, a specific absolute value of brightness difference is determined as the contrast value of the image 200 (step S26).

以下举例来说明获得亮度差绝对值的分布的方法。影像200可以符合贝尔图样(Bayer pattern),其亮度差绝对值的分布可经由确定影像区域201中的每组两颜色相同且相邻像素的亮度差绝对值,并以处理器1分类、统计而得。如图6所示,像素v1、v3及v5同为红色像素,而像素v2及v4同为绿色像素。处理器1确定像素v1及v3的亮度差绝对值,并以该数值予以分类;确定像素v2及v4的亮度差绝对值,并以该数值予以分类;确定像素v3及v5的亮度差绝对值,并以该数值予以分类….等。如此,待确定完影像区域201中的每一组两颜色相同且相邻像素的亮度差绝对值后,即可同时获得亮度差绝对值的分布。The method for obtaining the distribution of the absolute value of the brightness difference is illustrated below with an example. The image 200 can conform to a Bayer pattern, and the distribution of the absolute value of its brightness difference can be determined by determining the absolute value of the brightness difference of each group of two adjacent pixels with the same color in the image area 201, and using the processor 1 to classify and calculate the statistics. have to. As shown in FIG. 6 , the pixels v1 , v3 and v5 are all red pixels, and the pixels v2 and v4 are all green pixels. Processor 1 determines the absolute value of brightness difference between pixels v1 and v3, and classifies according to this value; determines the absolute value of brightness difference between pixels v2 and v4, and classifies according to this value; determines the absolute value of brightness difference between pixels v3 and v5, And classify by this value...etc. In this way, after determining the absolute value of the brightness difference of each group of two adjacent pixels with the same color in the image area 201 , the distribution of the absolute value of the brightness difference can be obtained simultaneously.

更进一步地说明,处理器1将影像区域201中相邻且同色的像素亮度值两两相减后取绝对值,再将此亮度差绝对值记录到一数组pixelsAF[]中。数组pixelsAF[]中的元素pixelsAF[0]至pixelsAF[255]的初始值设为0;并以Abs(x,y)函数表示两相邻且同色像素x及y的亮度差绝对值。参照图7,处理器1取得一组两相邻且同色像素x及y(步骤S30);确定像素x及y的亮度差绝对值Abs(x,y)(步骤S32)。若Abs(x,y)的值为K(K为正整数),处理器1将pixelsAF[K]的值加1(步骤S34)。例如在影像区域201中若存在一组两相邻且同色像素v1及v3的亮度差绝对值Abs(v1,v3)为255时,将元素pixelsAF[255]的值加1;若一组两相邻且同色像素v2及v4的亮度差绝对值Abs(v2,v4)为230时,将元素pixelsAF[230]的值加1。To further illustrate, the processor 1 subtracts the luminance values of adjacent pixels of the same color in the image area 201 to obtain an absolute value, and then records the absolute value of the luminance difference into an array pixelsAF[]. The initial value of the elements pixelsAF[0] to pixelsAF[255] in the array pixelsAF[] is set to 0; and the Abs(x, y) function is used to represent the absolute value of the brightness difference between two adjacent pixels x and y of the same color. Referring to FIG. 7 , processor 1 obtains a group of two adjacent pixels x and y of the same color (step S30 ); determines the absolute value of brightness difference Abs(x, y) of pixels x and y (step S32 ). If the value of Abs(x, y) is K (K is a positive integer), processor 1 adds 1 to the value of pixelsAF[K] (step S34). For example, in the image area 201, if there is a group of two adjacent pixels with the same color and the absolute value of the brightness difference Abs(v1, v3) is 255, add 1 to the value of the element pixelsAF[255]; When the absolute value of the brightness difference Abs(v2, v4) of adjacent and same-color pixels v2 and v4 is 230, add 1 to the value of the element pixelsAF[230].

处理器1判别像素x及y是否为影像区域201中最后一组相邻且同色的两像素(步骤S36)。如否,则再取影像区域201中另一组两相邻且同色像素(再回到步骤S30);如是,则执行下一步骤S38。完成上述确定后,即可立即获知绝对值Abs(x,y)相同的笔数,例如若像素亮度差绝对值Abs(x,y)=255的有2笔,则纪录pixelsAF[255]=2,若像素亮度差绝对值Abs(x,y)=254的有4笔,则纪录pixelsAF[254]=4,如此即可获得如第8图的统计图,即亮度差绝对值与亮度差绝对值相同的笔数分布300。The processor 1 determines whether the pixels x and y are the last two adjacent pixels of the same color in the image area 201 (step S36 ). If not, another group of two adjacent pixels with the same color in the image area 201 is obtained again (return to step S30); if yes, the next step S38 is executed. After the above determination is completed, the number of items with the same absolute value Abs(x, y) can be known immediately. For example, if there are 2 items with the absolute value of pixel brightness difference Abs(x, y)=255, record pixelsAF[255]=2 , if there are 4 items with the absolute value of the pixel brightness difference Abs(x, y)=254, then record pixelsAF[254]=4, so that the statistical chart as shown in Figure 8 can be obtained, that is, the absolute value of the brightness difference and the absolute value of the brightness difference The number of pens with the same value is distributed as 300.

最后,依图8所示的结果,处理器1将亮度差绝对值由最大值往最小值累加亮度差绝对值相同的笔数。最初处理器1先预设初始化总笔数Sum=0,当累加的总笔数Sum加入一亮度差绝对值相同的笔数后等于或大于一预定数目P时,处理器1即设定影像200的对比值为该亮度差绝对值。从实验得知,预定数目P设定为10较佳,故此处预定数目P=10,并预设变量i=255(步骤S38);接着执行累加,Sum=Sum+pixelsAF[i](步骤S40);处理器1判定是否Sum≥P(步骤S42)。如否,处理器1将变量i的值减1(步骤S44),接着继续累加(再回到步骤S40);如是,处理器1则设定影像200的对比值为变量i的值(步骤S46)。例如若此时变量i的值为253,处理器1即设定影像200的对比值为253。Finally, according to the result shown in FIG. 8 , the processor 1 accumulates the number of strokes whose absolute value of the brightness difference is the same from the maximum value to the minimum value. Initially, the processor 1 first presets the total number of initialized sums to be 0, and when the accumulated total number of sums is equal to or greater than a predetermined number P after adding a sum with the same absolute value of the brightness difference, the processor 1 immediately sets the image 200 The contrast value of is the absolute value of the brightness difference. Know from experiment, predetermined number P is set as 10 better, so here predetermined number P=10, and preset variable i=255 (step S38); Then carry out accumulation, Sum=Sum+pixelsAF[i] (step S40 ); Processor 1 determines whether Sum≥P (step S42). If no, processor 1 subtracts 1 from the value of variable i (step S44), and then continues to accumulate (return to step S40); if so, processor 1 then sets the contrast value of image 200 as the value of variable i (step S46 ). For example, if the value of the variable i is 253 at this time, the processor 1 sets the contrast value of the image 200 to 253.

运用上述方法,可再统计数个不同位置的对比值而找出最大值,最后再驱动对焦镜片81到对应此最大值的位置,以完成对焦。By using the above method, the comparison value of several different positions can be counted to find the maximum value, and finally the focus lens 81 is driven to the position corresponding to the maximum value to complete the focusing.

上述方法以影像的区域确定对比值,其中对比值不是以平均运算求得,而是确定两相邻且同色像素的实际亮度差绝对值,并统计该区域中所有亮度差绝对值的分布情形而得。The above method determines the contrast value based on the area of the image, where the contrast value is not obtained by averaging, but by determining the absolute value of the actual brightness difference between two adjacent pixels of the same color, and counting the distribution of the absolute value of brightness difference in this area. have to.

虽然本发明已以较佳实施例揭露如上,然其并非用以限定本发明,任何熟习此技艺者,在不脱离本发明的精神和范围内,当可作各种的更动与润饰,均不脱离本发明的专利范围。Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Anyone skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Do not depart from the patent scope of the present invention.

Claims (10)

1.一种影像撷取装置,其特征在于,所述影像撷取装置包含:1. An image capture device, characterized in that the image capture device comprises: 一感光组件,用以转换光束为电子讯号;A photosensitive element for converting light beams into electronic signals; 一镜头,用以在上述感光组件上成像;A lens for forming images on the above-mentioned photosensitive components; 一处理器,根据在上述感光组件上产生的一影像的对比值以执行自动对焦,其中上述处理器选取上述影像的一区域,确定上述区域上的每一组两颜色相同且相邻像素的亮度差绝对值,并根据上述确定所得亮度差绝对值相同的同色且相邻像素的分布情况决定一特定亮度差绝对值作为上述影像的对比值,该分布情况通过亮度差绝对值与亮度差绝对值相同的同色且相邻像素的笔数的对应关系得到。a processor, performing autofocus according to the contrast value of an image generated on the photosensitive element, wherein the processor selects an area of the image, and determines the brightness of each group of two adjacent pixels of the same color on the area The absolute value of the difference, and according to the distribution of adjacent pixels of the same color with the same absolute value of the brightness difference determined above, a specific absolute value of the brightness difference is determined as the contrast value of the above-mentioned image. The distribution is determined by the absolute value of the brightness difference and the absolute value of the brightness difference The corresponding relationship between the numbers of the same color and adjacent pixels is obtained. 2.如权利要求1所述的影像撷取装置,其特征在于,上述处理器统计所得的所有上述亮度差绝对值中该数值相同的笔数,其中上述分布包含亮度差绝对值对应亮度差绝对值相同的笔数,上述处理器从上述所有亮度差绝对值的最大值往最小值,开始累加上述亮度差绝对值相同的笔数,以及当累加的总笔数加入一第一亮度差绝对值的笔数后等于或大于一预定数目,上述影像的对比值为该第一亮度差绝对值,其中所述累加的总笔数与所述第一亮度差绝对值均针对同一亮度差绝对值。2. The image capture device as claimed in claim 1, wherein the number of items with the same value in all the absolute values of the brightness difference obtained by the processor is counted, wherein the distribution includes the absolute value of the brightness difference corresponding to the absolute value of the brightness difference For the number of strokes with the same value, the above-mentioned processor starts to accumulate the number of strokes with the same absolute value of the above-mentioned brightness difference from the maximum value to the minimum value of the absolute value of the above-mentioned all brightness differences, and when the accumulated total number of strokes adds a first absolute value of the brightness difference After the number of strokes is equal to or greater than a predetermined number, the contrast value of the above-mentioned image is the first absolute value of brightness difference, wherein the total number of accumulated strokes and the first absolute value of brightness difference both refer to the same absolute value of brightness difference. 3.如权利要求2所述的影像撷取装置,其特征在于,获得上述亮度差绝对值相同的笔数还包含:3. The image capture device as claimed in claim 2, wherein obtaining the number of strokes with the same absolute value of the brightness difference further comprises: 上述处理器每确定出上述区域上一组两颜色相同且相邻像素的亮度差绝对值后,即立即对该亮度差绝对值予以分类;以及After the above-mentioned processor determines the absolute value of the brightness difference of a group of two adjacent pixels with the same color on the above-mentioned area, it immediately classifies the absolute value of the brightness difference; and 待上述处理器确定完上述区域上每一组两颜色相同且相邻像素的亮度差绝对值后,即可同时获得上述亮度差绝对值相同的笔数。After the processor determines the absolute value of the brightness difference between each group of two adjacent pixels with the same color and the same color in the above region, the number of strokes with the same absolute value of the brightness difference can be simultaneously obtained. 4.一种如权利要求1所述影像撷取装置的对焦方法,其特征在于,所述对焦方法包含:4. A focusing method for the image capture device according to claim 1, wherein the focusing method comprises: 根据一镜头在一感光组件上产生的影像的对比值以执行自动对焦;performing autofocus according to the contrast value of an image produced by a lens on a photosensitive element; 在上述自动对焦过程中,利用一利用整个影像的对焦方法搜寻上述影像的对比值;以及during the autofocus process, searching for a contrast value of the image using a focusing method that utilizes the entire image; and 当搜寻上述影像的对比值失败时,自动以一利用部分影像的对焦方法搜寻上述影像的对比值。When searching for the contrast value of the above-mentioned image fails, automatically search for the contrast value of the above-mentioned image by using a focusing method using a part of the image. 5.如权利要求4所述的对焦方法,其特征在于,上述利用部分影像的对焦方法从上述影像的一区域中的两颜色相同且相邻像素的亮度差绝对值分布中,决定一特定亮度差绝对值作为上述影像的对比值。5. The focusing method according to claim 4, wherein the focusing method using partial images determines a specific brightness from the absolute value distribution of brightness differences between two adjacent pixels of the same color in a region of the image The absolute value of the difference was used as the contrast value of the above image. 6.如权利要求5所述的对焦方法,其特征在于,上述利用整个影像的对焦方法选取的影像范围为A,上述利用部分影像的对焦方法选取的影像范围为B,且上述区域的范围B不等同于上述影像的范围A。6. The focusing method according to claim 5, wherein the image range selected by the focusing method using the entire image is A, the image range selected by the focusing method using part of the image is B, and the range B of the above-mentioned area is Not equivalent to range A of the image above. 7.一种影像对比值的确定方法,其特征在于,该方法包含:7. A method for determining an image contrast value, characterized in that the method comprises: 根据一镜头在一感光组件上产生的一影像,其中上述影像范围为A;An image produced on a photosensitive element according to a lens, wherein the above-mentioned image range is A; 选取上述影像的一区域,其中上述区域范围为B;Select an area of the above-mentioned image, wherein the range of the above-mentioned area is B; 确定上述区域上的每一组两颜色相同且相邻像素的亮度差绝对值;以及Determining the absolute value of the brightness difference of each group of two adjacent pixels with the same color on the above-mentioned area; and 根据上述确定所得一亮度差绝对值相同的同色且相邻像素的分布情况决定一特定亮度差绝对值作为上述影像的对比值,该分布情况通过亮度差绝对值与亮度差绝对值相同的同色且相邻像素的笔数的对应关系得到。According to the distribution of adjacent pixels of the same color with the same absolute value of brightness difference determined above, a specific absolute value of brightness difference is determined as the contrast value of the above-mentioned image. The corresponding relationship of the number of adjacent pixels is obtained. 8.如权利要求7所述的影像对比值的确定方法,其特征在于,上述区域的范围B不大于上述影像的范围A。8. The method for determining the image contrast value according to claim 7, wherein the range B of the region is not larger than the range A of the image. 9.如权利要求7所述的影像对比值的确定方法,其特征在于,所述影像对比值的确定方法还包含:9. The method for determining image contrast value as claimed in claim 7, wherein the method for determining image contrast value further comprises: 统计确定所得的所有上述亮度差绝对值中数值相同的笔数,以获得上述分布,其中上述分布包含亮度差绝对值对应亮度差绝对值相同的笔数;Statistically determine the number of pens with the same value in all the absolute values of the above-mentioned brightness differences obtained, so as to obtain the above-mentioned distribution, wherein the above-mentioned distribution includes the number of pens whose absolute values of the brightness differences correspond to the same absolute values of the brightness differences; 从上述所有亮度差绝对值的最大值往最小值,开始累加亮度差绝对值相同的笔数;以及From the maximum value to the minimum value of the absolute value of all the brightness differences above, start to accumulate the number of pens with the same absolute value of the brightness difference; and 当累加的总笔数加入一第一亮度差绝对值的笔数后等于或大于一预定数目,上述影像的对比值为该第一亮度差绝对值;When the accumulated total number of strokes is equal to or greater than a predetermined number after adding the number of strokes of a first absolute value of brightness difference, the contrast value of the above-mentioned image is the first absolute value of brightness difference; 其中所述累加的总笔数与所述第一亮度差绝对值均针对同一亮度差绝对值。Wherein the total number of accumulated strokes and the first absolute value of the brightness difference both refer to the same absolute value of the brightness difference. 10.如权利要求9所述的影像对比值的确定方法,其特征在于,获得上述亮度差绝对值相同的笔数还包含:10. The method for determining image contrast values as claimed in claim 9, wherein obtaining the number of strokes with the same absolute value of the above-mentioned brightness difference also includes: 每确定出上述区域上一组两颜色相同且相邻像素的亮度差绝对值后,立即对该亮度差绝对值予以分类;以及Classify the absolute value of the brightness difference immediately after determining the absolute value of the brightness difference between two groups of adjacent pixels with the same color in the above-mentioned area; and 待确定完上述区域上每一组两颜色相同且相邻像素的亮度差绝对值后,即可同时获得上述亮度差绝对值相同的笔数。After determining the absolute value of the brightness difference of each group of two adjacent pixels with the same color and the same color in the above region, the above number of strokes with the same absolute value of the brightness difference can be obtained at the same time.
CN200610145865A 2006-11-21 2006-11-21 Image capturing device, focusing method thereof and method for determining image contrast value Active CN100594418C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200610145865A CN100594418C (en) 2006-11-21 2006-11-21 Image capturing device, focusing method thereof and method for determining image contrast value

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200610145865A CN100594418C (en) 2006-11-21 2006-11-21 Image capturing device, focusing method thereof and method for determining image contrast value

Publications (2)

Publication Number Publication Date
CN101191978A CN101191978A (en) 2008-06-04
CN100594418C true CN100594418C (en) 2010-03-17

Family

ID=39487046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200610145865A Active CN100594418C (en) 2006-11-21 2006-11-21 Image capturing device, focusing method thereof and method for determining image contrast value

Country Status (1)

Country Link
CN (1) CN100594418C (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778214B (en) * 2009-01-09 2011-08-31 华晶科技股份有限公司 Digital image pick-up device having brightness and focusing compensation function and image compensation method thereof
CN103888675B (en) * 2014-04-16 2017-04-05 格科微电子(上海)有限公司 The method for detecting position and camera module of camera module camera lens module
KR102189643B1 (en) 2014-12-30 2020-12-11 삼성전자주식회사 Display apparatus and control method thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5404163A (en) * 1992-07-14 1995-04-04 Mitutoyo Corporation In-focus detection method and method and apparatus using the same for non contact displacement measurement
JP2002303780A (en) * 2001-04-04 2002-10-18 Ricoh Co Ltd Automatic focus controller
CN1464323A (en) * 2002-06-13 2003-12-31 北京中星微电子有限公司 Process for automatic focusing
JP2005156597A (en) * 2003-11-20 2005-06-16 Canon Inc Automatic focusing apparatus and method, program, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5404163A (en) * 1992-07-14 1995-04-04 Mitutoyo Corporation In-focus detection method and method and apparatus using the same for non contact displacement measurement
JP2002303780A (en) * 2001-04-04 2002-10-18 Ricoh Co Ltd Automatic focus controller
CN1464323A (en) * 2002-06-13 2003-12-31 北京中星微电子有限公司 Process for automatic focusing
JP2005156597A (en) * 2003-11-20 2005-06-16 Canon Inc Automatic focusing apparatus and method, program, and storage medium

Also Published As

Publication number Publication date
CN101191978A (en) 2008-06-04

Similar Documents

Publication Publication Date Title
CN103988490B (en) Image processing apparatus, image processing method and recording medium
JP4588583B2 (en) Imaging apparatus and focus control method
JP2004354581A (en) Imaging apparatus
JP6906360B2 (en) Focus detector and its control method
JP2007263926A (en) Range finder and method for the same
JPWO2012137650A1 (en) Imaging apparatus and program
JP2016038414A (en) FOCUS DETECTION DEVICE, ITS CONTROL METHOD, AND IMAGING DEVICE
CN103562769B (en) Camera head and image capture method
JP2012049773A (en) Imaging apparatus and method, and program
JP2016133674A (en) Focus control device, and method, program and storage medium therefor
JP6548437B2 (en) Focusing apparatus, control method therefor, control program, and imaging apparatus
US20100026819A1 (en) Method and apparatus for compensating for motion of an autofocus area, and autofocusing method and apparatus using the same
US8270755B2 (en) Method to evaluate contrast value for an image and applications thereof
JP2005092085A (en) Focus detecting method and focusing method, and focus detecting device and focusing device
JP2010206722A (en) Image processing apparatus and image processing method, and, imaging apparatus
CN100594418C (en) Image capturing device, focusing method thereof and method for determining image contrast value
KR20070120969A (en) Imaging device
JP6941011B2 (en) Imaging device and its control method, program, storage medium
CN101750715A (en) Automatic focusing apparatus, automatic focusing method, and image pickup apparatus
KR101032174B1 (en) Auto Focus Method
JP6758964B2 (en) Control device, image pickup device, control method, program, and storage medium
JP2004085964A (en) Automatic focusing device, digital camera, and portable information input device
JP3272186B2 (en) Auto focus video camera
JP2004151183A (en) Automatic focusing device, digital camera and portable information terminal equipment equipped with the automatic focusing device
TW200920108A (en) Image capturing device and auto-focus method for the same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant