[go: up one dir, main page]

CN106254855B - A kind of three-dimensional modeling method and system based on zoom ranging - Google Patents

A kind of three-dimensional modeling method and system based on zoom ranging Download PDF

Info

Publication number
CN106254855B
CN106254855B CN201610723110.XA CN201610723110A CN106254855B CN 106254855 B CN106254855 B CN 106254855B CN 201610723110 A CN201610723110 A CN 201610723110A CN 106254855 B CN106254855 B CN 106254855B
Authority
CN
China
Prior art keywords
subregion
image
zoom
sub
region
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.)
Expired - Fee Related
Application number
CN201610723110.XA
Other languages
Chinese (zh)
Other versions
CN106254855A (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.)
RUIMA ELECTRIC MANUFACTURING (FUJIAN) Co Ltd
Original Assignee
RUIMA ELECTRIC MANUFACTURING (FUJIAN) Co Ltd
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 RUIMA ELECTRIC MANUFACTURING (FUJIAN) Co Ltd filed Critical RUIMA ELECTRIC MANUFACTURING (FUJIAN) Co Ltd
Priority to CN201610723110.XA priority Critical patent/CN106254855B/en
Publication of CN106254855A publication Critical patent/CN106254855A/en
Application granted granted Critical
Publication of CN106254855B publication Critical patent/CN106254855B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)
  • Studio Devices (AREA)

Abstract

本发明公开了一种基于变焦测距的三维建模方法,涉及三维重建领域,包括如下步骤:首先,将目标物体划分为若干子区域;然后,变焦采集各个子区域图像,根据对焦评价函数值,获取子区域的正焦图像,并采集子区域的焦距或物距;变焦评价函数值用于衡量子区域是否准确对焦,正焦图像为子区域准确对焦的图像;最后,根据各个子区域的正焦图像和各个子区域的焦距或物距,建立三维模型。同时,本发明还公开了一种基于变焦测距的三维建模系统。本发明提供了一种快速三维重建方法,避免了双目视差法三维重建局部区域获得不了精确的三维深度信息。同时,本发明只需要一个拍摄镜头,在一个位置即可获得物体的三维模型。

The invention discloses a three-dimensional modeling method based on zoom distance measurement, which relates to the field of three-dimensional reconstruction, comprising the following steps: firstly, dividing a target object into several sub-regions; , to obtain the focus image of the sub-region, and collect the focal length or object distance of the sub-region; the zoom evaluation function value is used to measure whether the sub-region is in focus, and the focus image is an image in which the sub-region is in focus; finally, according to the The orthofocus image and the focal length or object distance of each sub-region are used to establish a 3D model. At the same time, the invention also discloses a three-dimensional modeling system based on zoom distance measurement. The invention provides a fast three-dimensional reconstruction method, which avoids the inability to obtain accurate three-dimensional depth information in a local region of the three-dimensional reconstruction by the binocular parallax method. At the same time, the present invention only needs one shooting lens, and the three-dimensional model of the object can be obtained at one position.

Description

一种基于变焦测距的三维建模方法及系统A 3D modeling method and system based on zoom ranging

技术领域technical field

本发明涉及物体三维重建领域,特别涉及一种基于变焦测距的三维建模方法及其系统。The invention relates to the field of object three-dimensional reconstruction, in particular to a three-dimensional modeling method and system based on zoom distance measurement.

背景技术Background technique

三维重建具有广泛的应用领域,包括体积测量、立体显示、3D打印、物体模型建立等。现有三维重建一般采用双目时差法,通过两个摄像头对物体进行拍摄,通过两个拍摄图像的微小差别,获得物体的立体信息并进行三维重构。然而,这种方法存在不足之处:三维物体的一些局部区域,在两张图像中,并不同时出现,当物体的局部出现在左图像并且未出现在右图像,此时该位置的深度信息的处理往往是不精确的。综上,现有技术由于其技术原理本身的缺陷,造成局部区域不能很好地获得图像深度信息,影响物体的三维重建,需要探求一种物体三维重建新方法。3D reconstruction has a wide range of applications, including volume measurement, stereoscopic display, 3D printing, object model building, etc. The existing 3D reconstruction generally adopts the binocular time-of-flight method, and the object is photographed by two cameras, and the three-dimensional information of the object is obtained and three-dimensionally reconstructed through the slight difference between the two captured images. However, this method has shortcomings: some local areas of the three-dimensional object do not appear in the two images at the same time. When the part of the object appears in the left image and does not appear in the right image, the depth information of the position at this time The processing is often imprecise. To sum up, due to the defects of the technical principle itself in the existing technology, image depth information cannot be obtained well in local areas, which affects the 3D reconstruction of objects, and it is necessary to explore a new method for 3D reconstruction of objects.

发明内容Contents of the invention

有鉴于现有技术的上述缺陷,本发明所要解决的技术问题是提供一种基于变焦测距的三维建模方法,旨在解决现有技术由于其技术原理本身的缺陷,即造成局部区域不能很好地获得图像深度信息,影响物体的三维重建的技术问题。In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is to provide a three-dimensional modeling method based on zoom ranging, which aims to solve the defect of the prior art due to its technical principle itself, that is, local areas cannot be easily Obtaining image depth information well affects the technical issues of 3D reconstruction of objects.

为实现上述目的,本发明提供了一种基于变焦测距的三维建模方法,包括:To achieve the above object, the present invention provides a three-dimensional modeling method based on zoom ranging, including:

步骤S1、将目标物体划分为若干子区域;Step S1, dividing the target object into several sub-regions;

步骤S2、变焦采集各个所述子区域图像,根据对焦评价函数值,获取所述 子区域的正焦图像,并采集所述子区域的焦距或物距;所述变焦评价函数值用于衡量所述子区域是否准确对焦,所述正焦图像为所述子区域准确对焦的图像;Step S2, zooming to collect images of each of the sub-regions, obtaining the in-focus image of the sub-region according to the value of the focus evaluation function, and collecting the focal length or object distance of the sub-region; the value of the zoom evaluation function is used to measure the Whether the sub-region is accurately focused, and the in-focus image is an image of the sub-region accurately focused;

步骤S3、根据各个所述子区域的正焦图像和各个所述子区域的焦距或物距,建立三维模型。Step S3, building a three-dimensional model according to the in-focus image of each of the sub-regions and the focal length or object distance of each of the sub-regions.

在该技术方案中,将目标分割为多个子区域,分别对每个子区域进行对焦,通过图像处理判断是否对焦,获取正焦图像并记录焦距。根据各个子区域的焦距或物距信息获得深度信息,并进行三维重建。该技术方案提供了一种快速三维重建方法,避免了双目视差法三维重建局部区域获得不了精确的三维深度信息。In this technical solution, the target is divided into a plurality of sub-regions, each sub-region is focused on, and whether it is focused is judged through image processing, and the in-focus image is acquired and the focal length is recorded. Depth information is obtained according to the focal length or object distance information of each sub-region, and three-dimensional reconstruction is performed. The technical solution provides a fast three-dimensional reconstruction method, which avoids the inability to obtain accurate three-dimensional depth information in a local area of the three-dimensional reconstruction by the binocular parallax method.

进一步而言,所述步骤S2,具体包括:Further, the step S2 specifically includes:

采集第k个子区域Jk的第i张变焦图像内与所述子区域相对应的M×N个像素的RGB值;Collect the RGB values of M×N pixels corresponding to the sub-region in the ith zoom image of the k-th sub-region J k ;

计算所述子区域Jk的第i张变焦图像的对焦评价函数值 Calculate the focus evaluation function value of the i-th zoom image of the sub-region J k

获取所述子区域Jk在I张所述变焦图像中的对焦评价函数最大值所述对焦评价函数最大值相应的变焦图像为所述子区域的正焦图像;所述 所述I为变焦图像总数,I为自然数;Obtain the maximum value of the focus evaluation function of the sub-region J k in one zoom image The focus evaluation function maximum value The corresponding zoom image is the positive focus image of the sub-region; the The I is the total number of zoom images, and I is a natural number;

所述 said

其中,所述i、k、M、N为自然数,所述x满足1≤x≤M,所述y满足1≤y≤N,所述Ri(x,y)、Gi(x,y)、Bi(x,y)分别为像素的RGB值;所述为子区域Jk内R像素平均值,所述为子区域Jk内G像素平均值,所述为子区域Jk内B像素平均值。Wherein, the i, k, M, and N are natural numbers, the x satisfies 1≤x≤M, the y satisfies 1≤y≤N, and the R i (x, y), G i (x, y ), B i (x, y) are the RGB values of the pixel respectively; is the average value of R pixels in the sub-region J k , the is the average value of G pixels in the sub-region J k , the is the average value of B pixels in the sub-region J k .

在该技术方案中,通过获取RGB三色的对焦评价函数,对焦评价精度高。In this technical scheme, through Obtain the focus evaluation function of RGB three colors, and the focus evaluation accuracy is high.

进一步而言,所述步骤S3,还包括:根据所述物距或焦距,生成子区域图像放大倍率,修正各个所述子区域的尺寸。Further, the step S3 further includes: generating sub-region image magnifications according to the object distance or focal length, and correcting the size of each sub-region.

在该技术方案中,基于近大远小原理,根据焦距对各个图层的尺寸大小进行修正,即越靠近镜头的物体,放大倍率越小;其有益之处在于,提高三维建模的精度和准确性。In this technical solution, based on the principle of near-large and far-small, the size of each layer is corrected according to the focal length, that is, the closer the object is to the lens, the smaller the magnification; it is beneficial to improve the accuracy and accuracy of 3D modeling. accuracy.

有鉴于现有技术的缺陷,本发明所要解决的第二个技术问题是提供一种基于变焦测距的三维建模系统,旨在解决现有技术由于其技术原理本身的缺陷,即造成局部区域不能很好地获得图像深度信息,影响物体的三维重建的技术问题。In view of the defects of the prior art, the second technical problem to be solved by the present invention is to provide a 3D modeling system based on zoom distance measurement, which aims to solve the defects of the prior art due to its technical principle itself, that is, local area The depth information of the image cannot be obtained well, which affects the technical problem of the 3D reconstruction of the object.

为实现上述目的,本发明提供了一种基于变焦测距的三维建模方法,包括:To achieve the above object, the present invention provides a three-dimensional modeling method based on zoom ranging, including:

子区域划分模块,用于将目标物体划分为若干子区域;A sub-area division module is used to divide the target object into several sub-areas;

图像采集模块,用于变焦采集各个所述子区域图像;An image acquisition module, configured to zoom in and acquire images of each of the sub-regions;

变焦驱动模块,用于驱动所述图像采集模块连续变焦;A zoom drive module, configured to drive the image acquisition module to zoom continuously;

拍摄焦距采集模块,用于采集所述子区域的焦距或物距;A focal length acquisition module for capturing the focal length or object distance of the sub-area;

子区域正焦图像识别模块,用于根据对焦评价函数值获取所述子区域的正焦图像;其中,所述变焦评价函数值用于衡量所述子区域是否准确对焦,所述正焦图像为所述子区域准确对焦的图像;The sub-region focus image recognition module is used to obtain the focus image of the sub-region according to the focus evaluation function value; wherein, the zoom evaluation function value is used to measure whether the sub-region is in focus, and the focus image is an in-focus image of said sub-region;

三维重建模块,用于根据各个所述子区域的正焦图像和各个所述子区域的焦距或物距,并建立三维模型。The three-dimensional reconstruction module is used to establish a three-dimensional model according to the in-focus image of each of the sub-regions and the focal length or object distance of each of the sub-regions.

在该技术方案中,将目标分割为多个子区域,分别对每个子区域进行对焦,通过图像处理判断是否对焦,获取正焦图像并记录焦距。根据各个子区域的焦 距或物距信息获得深度信息,并进行三维重建。该技术方案提供了一种快速三维重建方法,避免了双目视差法三维重建局部区域获得不了精确的三维深度信息。In this technical solution, the target is divided into a plurality of sub-regions, each sub-region is focused on, and whether it is focused is judged through image processing, and the in-focus image is acquired and the focal length is recorded. Obtain depth information according to the focal length or object distance information of each sub-region, and perform 3D reconstruction. The technical solution provides a fast three-dimensional reconstruction method, which avoids the inability to obtain accurate three-dimensional depth information in a local area of the three-dimensional reconstruction by the binocular parallax method.

进一步而言,所述子区域正焦图像识别模块,被配置为:Further, the sub-region focus image recognition module is configured to:

采集第k个子区域Jk的第i张变焦图像内与所述子区域相对应的M×N个像素的RGB值;Collect the RGB values of M×N pixels corresponding to the sub-region in the ith zoom image of the k-th sub-region J k ;

计算所述子区域Jk的第i张变焦图像的对焦评价函数值 Calculate the focus evaluation function value of the i-th zoom image of the sub-region J k

获取所述子区域Jk在I张所述变焦图像中的对焦评价函数最大值所述对焦评价函数最大值相应的变焦图像为所述子区域的正焦图像;所述所述I为变焦图像总数,I为自然数;Obtain the maximum value of the focus evaluation function of the sub-region J k in one zoom image The focus evaluation function maximum value The corresponding zoom image is the positive focus image of the sub-region; the The I is the total number of zoom images, and I is a natural number;

所述 said

其中,所述i、k、M、N为自然数,所述x满足1≤x≤M,所述y满足1≤y≤N,所述Ri(x,y)、Gi(x,y)、Bi(x,y)分别为像素的RGB值;所述为子区域Jk内R像素平均值,所述为子区域Jk内G像素平均值,所述为子区域Jk内B像素平均值。Wherein, the i, k, M, and N are natural numbers, the x satisfies 1≤x≤M, the y satisfies 1≤y≤N, and the R i (x, y), G i (x, y ), B i (x, y) are the RGB values of the pixel respectively; is the average value of R pixels in the sub-region J k , the is the average value of G pixels in the sub-region J k , the is the average value of B pixels in the sub-region J k .

在该技术方案中,通过获取RGB三色的对焦评价函数,对焦评价精度高。In this technical scheme, through Obtain the focus evaluation function of RGB three colors, and the focus evaluation accuracy is high.

进一步而言,所述系统还包括:子区域比例放大模块;所述子区域比例放大模块被配置为:根据所述物距或焦距,生成子区域图像放大倍率,修正各个所述子区域的尺寸。Further, the system further includes: a sub-region scaling module; the sub-region scaling module is configured to: generate a sub-region image magnification according to the object distance or focal length, and correct the size of each sub-region .

在该技术方案中,基于近大远小原理,根据焦距对各个图层的尺寸大小进行修正,即越靠近镜头的物体,放大倍率越小;其有益之处在于,提高三维建 模的精度和准确性。In this technical solution, based on the principle of near-large and far-small, the size of each layer is corrected according to the focal length, that is, the closer the object is to the lens, the smaller the magnification; it is beneficial to improve the accuracy and accuracy of 3D modeling. accuracy.

本发明的有益效果是:本发明通过将目标物体分割为多个子区域,分别对每个子区域进行对焦,通过图像处理判断是否对焦,获取正焦图像并记录焦距。根据各个子区域的焦距或物距信息获得深度信息,并进行三维重建。该技术方案提供了一种快速三维重建方法,避免了双目视差法三维重建局部区域获得不了精确的三维深度信息。同时,本发明只需要一个拍摄镜头,在一个位置即可获得物体的三维模型。The beneficial effects of the present invention are: the present invention divides the target object into a plurality of sub-regions, focuses on each sub-region respectively, judges whether to focus through image processing, acquires a focus image and records the focal length. Depth information is obtained according to the focal length or object distance information of each sub-region, and three-dimensional reconstruction is performed. The technical solution provides a fast three-dimensional reconstruction method, which avoids the inability to obtain accurate three-dimensional depth information in a local area of the three-dimensional reconstruction by the binocular parallax method. At the same time, the present invention only needs one shooting lens, and the three-dimensional model of the object can be obtained at one position.

附图说明Description of drawings

图1是本发明一具体实施方式的流程示意图;Fig. 1 is a schematic flow sheet of a specific embodiment of the present invention;

图2是本发明一具体实施方式的系统结构示意图。Fig. 2 is a schematic diagram of the system structure of a specific embodiment of the present invention.

具体实施方式detailed description

下面结合附图和实施例对本发明作进一步说明:Below in conjunction with accompanying drawing and embodiment the present invention will be further described:

如图1所示,本发明一实施例中提供一种基于变焦测距的三维建模方法,包括:As shown in Figure 1, an embodiment of the present invention provides a three-dimensional modeling method based on zoom ranging, including:

步骤S1、将目标物体划分为若干子区域;Step S1, dividing the target object into several sub-regions;

步骤S2、变焦采集各个所述子区域图像,根据对焦评价函数值,获取所述子区域的正焦图像,并采集所述子区域的焦距或物距;所述变焦评价函数值用于衡量所述子区域是否准确对焦,所述正焦图像为所述子区域准确对焦的图像;Step S2, zooming to collect images of each of the sub-regions, obtaining the in-focus image of the sub-region according to the value of the focus evaluation function, and collecting the focal length or object distance of the sub-region; the value of the zoom evaluation function is used to measure the Whether the sub-region is accurately focused, and the in-focus image is an image of the sub-region accurately focused;

步骤S3、根据各个所述子区域的正焦图像和各个所述子区域的焦距或物距,建立三维模型。Step S3, building a three-dimensional model according to the in-focus image of each of the sub-regions and the focal length or object distance of each of the sub-regions.

下面对本实施例作进一步说明。This embodiment will be further described below.

在本实施例中,首先,将目标物体划分为若干区域;在一可选的实例中, 是将拍摄设备上的物体图像划分为若干区域。In this embodiment, firstly, the target object is divided into several regions; in an optional example, the object image on the shooting device is divided into several regions.

然后,对每个区域进行分别对焦,是否对焦成功是通过图像识别清晰度或者图像识别计算对焦评价函数值是否达到最大来判定的。Then, each area is separately focused, and whether the focus is successful is judged by whether the image recognition sharpness or the value of the focus evaluation function calculated by image recognition reaches the maximum.

当对焦成功,此时拍摄获得子区域的图像就是正焦图像,显然的,需要对图像进行分割,将子区域的图像分割出来。现有常用镜头一般是通过变焦电机进行变焦的,变焦电机一般是采用步进电机。通过采集变焦电机的步数,即可获得变焦的焦距或者物距。其中,变焦电机步数与焦距关系曲线可以由厂商提供,也可以是通过实验获得,本公开并不对此限定。同理,变焦电机步数与物距关系曲线也可以有厂商提供,或者实验获得。值得一提的是,在一个变焦镜头中,可以包含两组电机,分别为变焦电机和聚焦电机,相应也可以存在焦距和电机步数关系。When the focus is successful, the image of the sub-region captured at this time is the in-focus image. Obviously, the image needs to be segmented to separate the image of the sub-region. Existing commonly used lenses are generally zoomed by a zoom motor, and the zoom motor generally adopts a stepping motor. By collecting the steps of the zoom motor, the zoom focal length or object distance can be obtained. Wherein, the relationship curve between the number of steps of the zoom motor and the focal length may be provided by the manufacturer, or may be obtained through experiments, which is not limited in the present disclosure. Similarly, the relationship curve between the number of steps of the zoom motor and the object distance can also be provided by the manufacturer, or obtained through experiments. It is worth mentioning that a zoom lens can contain two sets of motors, namely the zoom motor and the focus motor. Correspondingly, there can also be a relationship between the focal length and the number of motor steps.

值得一提的是,除了采用变焦电机变焦,还存在其它变焦方式,如通过电压调控实现液晶透镜、液体透镜变焦,本公开实例并不限定镜头的变焦方式。It is worth mentioning that, in addition to using a zoom motor to zoom, there are other zooming methods, such as liquid crystal lens and liquid lens zooming through voltage regulation, and the example of the present disclosure does not limit the zooming method of the lens.

最后,通过各个区域的正焦图像以及相应的焦距或物距信息,构建成三维模型。Finally, a three-dimensional model is constructed through the orthofocus images of each area and the corresponding focal length or object distance information.

在一可选实例中,通过子区域的焦距以及焦距-物距关系曲线,获得物体子区域的深度信息,获得三维模型。In an optional example, the depth information of the object sub-region is obtained through the focal length of the sub-region and the focal length-object distance relationship curve to obtain a three-dimensional model.

在另一可选实例中,焦距和物距成正比,以焦距信息来构建与原物体呈现一定比例的三维模型。In another optional example, the focal length is proportional to the object distance, and the focal length information is used to construct a three-dimensional model with a certain proportion of the original object.

在自动调焦系统中是通过计算机编程,利用一些算法规则来判断图像清晰度是否达到了最准确状态,带动电动对焦装置进行对焦,这个算法就称为对焦状态评价函数,简称为对焦评价函数。在本发明中,可以利用对焦评价函数, 从多个变焦图像中,获得正确对焦的图像。In the automatic focusing system, computer programming is used to use some algorithmic rules to judge whether the image clarity has reached the most accurate state, and drive the electric focusing device to focus. This algorithm is called the focusing state evaluation function, referred to as the focusing evaluation function. In the present invention, the focus evaluation function can be used to obtain correctly focused images from multiple zoomed images.

可选地,对焦评价函数可以为灰度梯度函数、频域函数、信息学函数和统计学函数,现有技术中公开了相关评价函数的算法,这里不再赘述。Optionally, the focus evaluation function may be a grayscale gradient function, a frequency domain function, an informatics function, and a statistical function. Algorithms of related evaluation functions are disclosed in the prior art, and will not be repeated here.

优选地,在本公开的实施例中,所采用的对焦评价函数为Preferably, in the embodiments of the present disclosure, the focus evaluation function used is

具体而言,在本实施例中,所述步骤S2,具体包括:Specifically, in this embodiment, the step S2 specifically includes:

采集第k个子区域Jk的第i张变焦图像内与所述子区域相对应的M×N个像素的RGB值;Collect the RGB values of M×N pixels corresponding to the sub-region in the ith zoom image of the k-th sub-region J k ;

计算所述子区域Jk的第i张变焦图像的对焦评价函数值 Calculate the focus evaluation function value of the i-th zoom image of the sub-region J k

获取所述子区域Jk在I张所述变焦图像中的对焦评价函数最大值所述对焦评价函数最大值相应的变焦图像为所述子区域的正焦图像;所述 所述I为变焦图像总数,I为自然数;Obtain the maximum value of the focus evaluation function of the sub-region J k in one zoom image The focus evaluation function maximum value The corresponding zoom image is the positive focus image of the sub-region; the The I is the total number of zoom images, and I is a natural number;

所述 said

其中,所述i、k、M、N为自然数,所述x满足1≤x≤M,所述y满足1≤y≤N,所述Ri(x,y)、Gi(x,y)、Bi(x,y)分别为像素的RGB值;所述为子区域Jk内R像素平均值,所述为子区域Jk内G像素平均值,所述为子区域Jk内B像素平均值。Wherein, the i, k, M, and N are natural numbers, the x satisfies 1≤x≤M, the y satisfies 1≤y≤N, and the R i (x, y), G i (x, y ), B i (x, y) are the RGB values of the pixel respectively; is the average value of R pixels in the sub-region J k , the is the average value of G pixels in the sub-region J k , the is the average value of B pixels in the sub-region J k .

在本实施例中,通过焦距获得三维模型的深度信息,而三维模型在X-Y面上的尺寸数据,则是由各个子区域大小尺寸决定的。实际上,根据近大远小法则,拍摄物体距离镜头越远,成像大小越小。故而,在本实施例中,根据物距或焦距对各个子区域的尺寸进行比例放大。In this embodiment, the depth information of the 3D model is obtained through the focal length, while the size data of the 3D model on the X-Y plane is determined by the size of each sub-region. In fact, according to the near-large-far-small rule, the farther the subject is from the lens, the smaller the image size will be. Therefore, in this embodiment, the size of each sub-region is scaled up according to the object distance or the focal length.

可选地,所述步骤S3,还包括:根据所述物距或焦距,生成子区域图像放 大倍率,修正各个所述子区域的尺寸。Optionally, the step S3 further includes: generating sub-region image magnifications according to the object distance or focal length, and correcting the size of each sub-region.

在另一可选的实施例中,子区域图像放大倍率β与焦距f成正比,子区域图像放大倍率所述f0为放大倍率为1所对应的焦距。在另一可选的实施例中,子区域图像放大倍率与物距成正比。In another optional embodiment, the sub-region image magnification β is proportional to the focal length f, and the sub-region image magnification The f 0 is the focal length corresponding to a magnification of 1. In another optional embodiment, the sub-region image magnification is proportional to the object distance.

如图2所示,在本发明第二实施例中,提供一种基于变焦测距的三维建模系统,包括:As shown in Figure 2, in the second embodiment of the present invention, a 3D modeling system based on zoom ranging is provided, including:

子区域划分模块,用于将目标物体划分为若干子区域;A sub-area division module is used to divide the target object into several sub-areas;

图像采集模块,用于变焦采集各个所述子区域图像;An image acquisition module, configured to zoom in and acquire images of each of the sub-regions;

变焦驱动模块,用于驱动所述图像采集模块连续变焦;A zoom drive module, configured to drive the image acquisition module to zoom continuously;

拍摄焦距采集模块,用于采集所述子区域的焦距或物距;A focal length acquisition module for capturing the focal length or object distance of the sub-area;

子区域正焦图像识别模块,用于根据对焦评价函数值获取所述子区域的正焦图像;其中,所述变焦评价函数值用于衡量所述子区域是否准确对焦,所述正焦图像为所述子区域准确对焦的图像;The sub-region focus image recognition module is used to obtain the focus image of the sub-region according to the focus evaluation function value; wherein, the zoom evaluation function value is used to measure whether the sub-region is in focus, and the focus image is an in-focus image of said sub-region;

三维重建模块,用于根据各个所述子区域的正焦图像和各个所述子区域的焦距或物距,并建立三维模型。The three-dimensional reconstruction module is used to establish a three-dimensional model according to the in-focus image of each of the sub-regions and the focal length or object distance of each of the sub-regions.

可选地,对焦评价函数可以为灰度梯度函数、频域函数、信息学函数和统计学函数。Optionally, the focus evaluation function may be a gray gradient function, a frequency domain function, an informatics function, and a statistical function.

在本实施例中,所述子区域正焦图像识别模块,被配置为:In this embodiment, the sub-area focus image recognition module is configured to:

采集第k个子区域Jk的第i张变焦图像内与所述子区域相对应的M×N个像素的RGB值;Collect the RGB values of M×N pixels corresponding to the sub-region in the ith zoom image of the k-th sub-region J k ;

计算所述子区域Jk的第i张变焦图像的对焦评价函数值 Calculate the focus evaluation function value of the i-th zoom image of the sub-region J k

获取所述子区域Jk在I张所述变焦图像中的对焦评价函数最大值所 述对焦评价函数最大值相应的变焦图像为所述子区域的正焦图像;所述 所述I为变焦图像总数,I为自然数;Obtain the maximum value of the focus evaluation function of the sub-region J k in one zoom image The focus evaluation function maximum value The corresponding zoom image is the positive focus image of the sub-region; the The I is the total number of zoom images, and I is a natural number;

所述 said

其中,所述i、k、M、N为自然数,所述x满足1≤x≤M,所述y满足1≤y≤N,所述Ri(x,y)、Gi(x,y)、Bi(x,y)分别为像素的RGB值;所述为子区域Jk内R像素平均值,所述为子区域Jk内G像素平均值,所述为子区域Jk内B像素平均值。Wherein, the i, k, M, and N are natural numbers, the x satisfies 1≤x≤M, the y satisfies 1≤y≤N, and the R i (x, y), G i (x, y ), B i (x, y) are the RGB values of the pixel respectively; is the average value of R pixels in the sub-region J k , the is the average value of G pixels in the sub-region J k , the is the average value of B pixels in the sub-region J k .

在本实施例中,所述系统还包括:子区域比例放大模块;所述子区域比例放大模块被配置为:根据所述物距或焦距,生成子区域图像放大倍率,修正各个所述子区域的尺寸。In this embodiment, the system further includes: a sub-region scaling module; the sub-region scaling module is configured to: generate a sub-region image magnification according to the object distance or focal length, and correct each of the sub-regions size of.

在本实施例中,通过焦距获得三维模型的深度信息,而三维模型在X-Y面上的尺寸数据,则是由各个子区域大小尺寸决定的。实际上,根据近大远小法则,拍摄物体距离镜头越远,成像大小越小。故而,在本实施例中,根据物距或焦距对各个子区域的尺寸进行比例放大。In this embodiment, the depth information of the 3D model is obtained through the focal length, while the size data of the 3D model on the X-Y plane is determined by the size of each sub-region. In fact, according to the near-large-far-small rule, the farther the subject is from the lens, the smaller the image size will be. Therefore, in this embodiment, the size of each sub-region is scaled up according to the object distance or the focal length.

可选地,所述步骤S3,还包括:根据所述物距或焦距,生成子区域图像放大倍率,修正各个所述子区域的尺寸。Optionally, the step S3 further includes: generating sub-region image magnifications according to the object distance or focal length, and correcting the size of each sub-region.

在另一可选的实施例中,子区域图像放大倍率β与焦距f成正比,子区域图像放大倍率所述f0为放大倍率为1所对应的焦距。在另一可选的实施例中,子区域图像放大倍率与物距成正比。In another optional embodiment, the sub-region image magnification β is proportional to the focal length f, and the sub-region image magnification The f 0 is the focal length corresponding to a magnification of 1. In another optional embodiment, the sub-region image magnification is proportional to the object distance.

在本实施例中,将拍摄设备对准目标物体,图像采集模块获得目标物体影像,子区域划分模块将该目标物体的影响划分为多个子区域,依次选取各个子区域进行变焦采集图像;每当采集完一张变焦图像,便同时通过拍摄焦距采集模块采集并记录该图像的拍摄焦距。每当采集完一个子区域的全部变焦图像, 则子区域正焦图像识别模块选取对焦评价函数值最高的变焦图像作为正焦图像,并截取图像上与子区域相对应的区域图像。然后,子区域比例放大模块根据正焦图像的焦距,对图像进行比例放大获得X-Y面尺寸。通过焦距、物距或深度信息以及X-Y面尺寸对目标物体进行三维重建。In this embodiment, the shooting device is aimed at the target object, the image acquisition module obtains the image of the target object, and the sub-region division module divides the influence of the target object into multiple sub-regions, and each sub-region is sequentially selected for zooming to collect images; After collecting a zoom image, the focal length of the image is collected and recorded by the focal length acquisition module at the same time. Whenever all the zoom images of a sub-region are collected, the sub-region positive-focus image recognition module selects the zoom image with the highest value of the focus evaluation function as the positive-focus image, and intercepts the region image corresponding to the sub-region on the image. Then, the sub-area scaling module scales up the image according to the focal length of the front-focus image to obtain the X-Y plane size. Perform 3D reconstruction of the target object through focal length, object distance or depth information and X-Y plane size.

以上详细描述了本发明的较佳具体实施例。应当理解,本领域的普通技术人员无需创造性劳动就可以根据本发明的构思作出诸多修改和变化。因此,凡本技术领域中技术人员依本发明的构思在现有技术的基础上通过逻辑分析、推理或者有限的实验可以得到的技术方案,皆应在由权利要求书所确定的保护范围内。The preferred specific embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make many modifications and changes according to the concept of the present invention without creative efforts. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning or limited experiments on the basis of the prior art shall be within the scope of protection defined by the claims.

Claims (3)

1. a kind of three-dimensional modeling method based on zoom ranging, it is characterised in that methods described includes:
Step S1, target object is divided into some subregions;
Step S2, the image of each subregion is gathered in same position zoom, according to focusing evaluation function value, described in acquisition The positive burnt image of subregion, and gather the focal length or object distance of the subregion;The zoom evaluation function value is described for weighing Whether subregion accurately focuses, and the just burnt image is the image that the subregion is accurately focused;
Step S3, according to the positive burnt image of each subregion and the focal length or object distance of each subregion, establish three-dimensional Model;
The step S2, is specifically included:
Gather k-th of subregion JkI-th zoom image in the M × N number of pixel corresponding with the subregion rgb value;
Calculate the subregion JkI-th zoom image focusing evaluation function value
Obtain the subregion JkFocusing evaluation function maximum in the I zoom imagesThe focusing evaluation Function maximaCorresponding zoom image is the positive burnt image of the subregion;It is describedIt is described I is zoom image sum, and I is natural number;
It is described
Wherein, described i, k, M, N are natural number, and the x meets that 1≤x≤M, the y meet 1≤y≤N, the Ri(x,y)、Gi (x,y)、Bi(x, y) is respectively the rgb value of pixel;It is describedFor subregion JkInterior R pixel averages, it is describedFor subregion JkIt is interior G pixel averages, it is describedFor subregion JkInterior B pixel averages.
A kind of 2. three-dimensional modeling method based on zoom ranging as claimed in claim 1, it is characterised in that the step S3, Also include:According to the object distance or focal length, sub-district area image enlargement ratio is generated, corrects the size of each subregion.
A kind of 3. 3 d modeling system based on zoom ranging, it is characterised in that including:
Sub-zone dividing module, for target object to be divided into some subregions;
Image capture module, for gathering the image of each subregion in same position zoom;
Zoom drive module, for driving described image acquisition module continuous vari-focus;
Shooting focal length acquisition module, for gathering the focal length or object distance of the subregion;
The just burnt picture recognition module of subregion, for obtaining the positive burnt image of the subregion according to focusing evaluation function value;Its In, the zoom evaluation function value is used to weigh whether the subregion accurately focuses, and the just burnt image is the subregion The image accurately focused;
Three-dimensional reconstruction module, for the positive burnt image and the focal length or thing of each subregion according to each subregion Away from, and establish threedimensional model;
The just burnt picture recognition module of the subregion, is configured as:
Gather k-th of subregion JkI-th zoom image in the M × N number of pixel corresponding with the subregion rgb value;
Calculate the subregion JkI-th zoom image focusing evaluation function value
Obtain the subregion JkFocusing evaluation function maximum in the I zoom imagesThe focusing evaluation Function maximaCorresponding zoom image is the positive burnt image of the subregion;It is describedIt is described I is zoom image sum, and I is natural number;
It is described
Wherein, described i, k, M, N are natural number, and the x meets that 1≤x≤M, the y meet 1≤y≤N, the Ri(x,y)、Gi (x,y)、Bi(x, y) is respectively the rgb value of pixel;It is describedFor subregion JkInterior R pixel averages, it is describedFor subregion JkIt is interior G pixel averages, it is describedFor subregion JkInterior B pixel averages.
CN201610723110.XA 2016-08-25 2016-08-25 A kind of three-dimensional modeling method and system based on zoom ranging Expired - Fee Related CN106254855B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610723110.XA CN106254855B (en) 2016-08-25 2016-08-25 A kind of three-dimensional modeling method and system based on zoom ranging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610723110.XA CN106254855B (en) 2016-08-25 2016-08-25 A kind of three-dimensional modeling method and system based on zoom ranging

Publications (2)

Publication Number Publication Date
CN106254855A CN106254855A (en) 2016-12-21
CN106254855B true CN106254855B (en) 2017-12-05

Family

ID=57595805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610723110.XA Expired - Fee Related CN106254855B (en) 2016-08-25 2016-08-25 A kind of three-dimensional modeling method and system based on zoom ranging

Country Status (1)

Country Link
CN (1) CN106254855B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106998459A (en) * 2017-03-15 2017-08-01 河南师范大学 A kind of single camera stereoscopic image generation method of continuous vari-focus technology
CN107613204B (en) * 2017-09-28 2020-08-28 努比亚技术有限公司 Focusing area adjusting method, terminal and computer storage medium
CN108550182B (en) * 2018-03-15 2022-10-18 维沃移动通信有限公司 Three-dimensional modeling method and terminal
CN113838150B (en) * 2021-08-30 2024-03-19 上海大学 A three-dimensional trajectory tracking method of moving targets based on electro-hydraulic adjustable focus lens

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1180368C (en) * 2003-05-22 2004-12-15 上海交通大学 Image Quality Evaluation Method for Iris Recognition System
US8436893B2 (en) * 2009-07-31 2013-05-07 3Dmedia Corporation Methods, systems, and computer-readable storage media for selecting image capture positions to generate three-dimensional (3D) images
CN101858741A (en) * 2010-05-26 2010-10-13 沈阳理工大学 A method of zoom distance measurement based on single camera
TWI435593B (en) * 2010-12-30 2014-04-21 Altek Corp Method for capturing three-dimensional image
CN102314683B (en) * 2011-07-15 2013-01-16 清华大学 Computational imaging method and imaging system based on nonplanar image sensor
CN103049933A (en) * 2011-10-17 2013-04-17 联咏科技股份有限公司 Image processing apparatus and method thereof
CN102903098A (en) * 2012-08-28 2013-01-30 四川虹微技术有限公司 Depth estimation method based on image definition difference
CN102980561B (en) * 2012-11-30 2015-10-07 广东欧珀移动通信有限公司 A kind of mobile terminal distance-finding method and device
CN104102068B (en) * 2013-04-11 2017-06-30 聚晶半导体股份有限公司 Autofocus method and autofocus device
CN103335593A (en) * 2013-05-20 2013-10-02 李雄 Mobile phone using laser multipoint ranging data to resolve optical imaging image size
TW201518847A (en) * 2013-11-11 2015-05-16 Inst Information Industry Method and electrical device for taking 3D image and computer readable storage medium for storing the method
CN104301601B (en) * 2013-11-27 2017-11-03 中国航空工业集团公司洛阳电光设备研究所 The infrared image automatic focusing method that a kind of coarse-fine tune is combined
CN104833342B (en) * 2015-03-09 2017-04-19 深圳市魔眼科技有限公司 Mobile terminal and method of establishing stereoscopic model through multipoint distance measurement

Also Published As

Publication number Publication date
CN106254855A (en) 2016-12-21

Similar Documents

Publication Publication Date Title
CN106331683B (en) A kind of object dimensional method for reconstructing and its system
CN104038690B (en) Image processing device, image capturing device, and image processing method
TWI441095B (en) Distance evaluation methods and apparatuses, and machine readable medium thereof
CN105657237B (en) Image acquisition device and digital zooming method thereof
CN106254855B (en) A kind of three-dimensional modeling method and system based on zoom ranging
EP2367352B1 (en) Imaging apparatus and method
CN112367474B (en) Self-adaptive light field imaging method, device and equipment
CN104867125B (en) Obtain the method and device of image
CN104603796A (en) Systems, methods and media for interactively adjusting focus in an image
WO2014044126A1 (en) Coordinate acquisition device, system and method for real-time 3d reconstruction, and stereoscopic interactive device
CN109255810A (en) Image processing apparatus and image processing method
CN104639927A (en) Method for shooting stereoscopic image and electronic device
CN106031155A (en) Autofocus system and method based on statistical data
CN110662014B (en) A method for 3D display of 4D data of light field camera with large depth of field
CN113538545B (en) Monocular depth estimation method based on electro-hydraulic adjustable-focus lens and corresponding camera and storage medium
CN114913171A (en) Image out-of-focus detection method and device, electronic equipment and storage medium
CN112261292A (en) Image acquisition method, terminal, chip and storage medium
CN109001902B (en) Microscope focusing method based on image fusion
JP2015188251A (en) Image processing apparatus, imaging apparatus, image processing method, and program
CN108513057A (en) Image processing method and device
CN111105370A (en) Image processing method, image processing apparatus, electronic device, and readable storage medium
CN102506745A (en) Corrosion pit three-dimensional information measuring method based on single microscopic image
CN119011796A (en) Processing method of environment image data in camera perspective VST, head display device and storage medium
TWI697846B (en) Objective identification method and device thereof
CN107360412A (en) 3D image creation method, photographing apparatus, and readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20171205