CN104850633B - A kind of three-dimensional model searching system and method based on the segmentation of cartographical sketching component - Google Patents
A kind of three-dimensional model searching system and method based on the segmentation of cartographical sketching component Download PDFInfo
- Publication number
- CN104850633B CN104850633B CN201510267873.3A CN201510267873A CN104850633B CN 104850633 B CN104850633 B CN 104850633B CN 201510267873 A CN201510267873 A CN 201510267873A CN 104850633 B CN104850633 B CN 104850633B
- Authority
- CN
- China
- Prior art keywords
- image
- sampling points
- segmentation
- hand
- drawn
- 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
Links
- 230000011218 segmentation Effects 0.000 title claims abstract description 75
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000005070 sampling Methods 0.000 claims abstract description 171
- 238000012545 processing Methods 0.000 claims abstract description 84
- 238000000605 extraction Methods 0.000 claims abstract description 45
- 239000013598 vector Substances 0.000 claims abstract description 26
- 238000012549 training Methods 0.000 claims abstract description 21
- 238000004364 calculation method Methods 0.000 claims abstract description 19
- 238000007781 pre-processing Methods 0.000 claims abstract description 11
- 238000002372 labelling Methods 0.000 claims description 12
- 238000010586 diagram Methods 0.000 description 8
- 239000011159 matrix material Substances 0.000 description 5
- 230000006870 function Effects 0.000 description 4
- 241000238631 Hexapoda Species 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 230000002452 interceptive effect Effects 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 238000009826 distribution Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 238000010200 validation analysis Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 1
- 238000011960 computer-aided design Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000003064 k means clustering Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 102000004169 proteins and genes Human genes 0.000 description 1
- 108090000623 proteins and genes Proteins 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/951—Indexing; Web crawling techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Image Analysis (AREA)
Abstract
本发明实施例公开了一种基于手绘草图部件分割的三维模型检索系统及方法,其中,该系统包括:预处理模块,用于对手绘查询草图进行去噪处理获得灰度图,并对所述灰度图进行二值化处理、边界扩展处理、图像孔洞填充处理,获得处理后的图像;部件标记模块,用于对处理后的图像进行等间隔采样,并对采样点添加部件标签;采样点特征提取模块,用于提取采样点的各种特征向量;部件分割模块,用于根据添加部件标签后的采样点的各种特征向量进行分割模型训练;相似度计算与总评分排序模块,用于进行部件局部相似度计算,按照总评分进行排序,并将排序结果返回给客户端。实施本发明实施例,可以使得基于手绘草图的三维模型检索更加精准有效。
The embodiment of the present invention discloses a three-dimensional model retrieval system and method based on hand-drawn sketch part segmentation, wherein the system includes: a preprocessing module, which is used to denoise the hand-drawn query sketch to obtain a grayscale image, and Binary processing, boundary expansion processing, and image hole filling processing are performed on the grayscale image to obtain the processed image; the component marking module is used to sample the processed image at equal intervals, and add component labels to the sampling points; sampling points The feature extraction module is used to extract various feature vectors of sampling points; the component segmentation module is used to perform segmentation model training according to various feature vectors of sampling points after adding component labels; the similarity calculation and total score sorting module is used for Calculate the partial similarity of parts, sort according to the total score, and return the sorting results to the client. The implementation of the embodiments of the present invention can make the retrieval of 3D models based on hand-drawn sketches more accurate and effective.
Description
技术领域technical field
本发明涉及计算机图像处理技术领域,尤其涉及一种基于手绘草图部件分割的三维模型检索系统及方法。The invention relates to the technical field of computer image processing, in particular to a three-dimensional model retrieval system and method based on hand-drawn sketch component segmentation.
背景技术Background technique
近年来,伴随着计算机辅助设计、计算机辅助制造、虚拟现实、三维动画和三维游戏等领域的快速发展,互联网上的三维模型数量急剧增长。然而,三维模型不同于传统的图片、音频或视频等多媒体信息,它本身包含了许多细节信息难以用文字表达出来。In recent years, with the rapid development of computer-aided design, computer-aided manufacturing, virtual reality, 3D animation and 3D games, the number of 3D models on the Internet has increased dramatically. However, the 3D model is different from traditional multimedia information such as pictures, audio or video, and it contains many detailed information that is difficult to express in words.
然而,目前的三维模型检索方法在应用上仍不尽如人意。一方面,当用户需要某种三维模型资源时,往往手边并没有现成的模型文件;另一方面,随着触摸屏和电子笔的快速普及,用户能轻松地通过手绘草图的方式勾勒出模型的轮廓。三维模型的手绘草图,可以视为是从某个视角投影视图的轮廓线。手绘草图可以是简单的外轮廓线,也可以包含内轮廓线的细节信息。由于手绘草图的用户美术基础不同,输入设备不同,描绘模型的详细程度自然也不尽相同。而三维模型的手绘草图通常包含重叠的、分离的或不闭合的部件轮廓线,现有的相关研究通常基于对手绘草图进行的手工分割或标记,虽然这些手工指定的信息有助于计算机对手绘草图进行分析,但是它通常要求用户手绘草图时遵循一定的规则约束,这在某种程度上限制了用户手绘的自由程度,或者说对用户的绘画基础提出了要求。However, current 3D model retrieval methods are still unsatisfactory in application. On the one hand, when users need some kind of 3D model resources, they often do not have ready-made model files at hand; on the other hand, with the rapid popularization of touch screens and electronic pens, users can easily outline the model by hand sketching . A hand-drawn sketch of a 3D model that can be thought of as the outline of a projected view from a certain perspective. Freehand sketches can be simple outlines or include detailed information on inner outlines. Due to the different artistic foundations of users of hand-drawn sketches and different input devices, the degree of detail of the drawn models is naturally different. However, the hand-drawn sketches of 3D models usually contain overlapping, separated or unclosed component outlines. Existing related research is usually based on manual segmentation or labeling of hand-drawn sketches, although these manually specified information is helpful for computers to analyze hand-drawn sketches. Sketches are analyzed, but it usually requires users to follow certain rules and constraints when drawing sketches, which limits the freedom of users' drawing to some extent, or puts forward requirements on the user's drawing foundation.
按照检索方式分类,目前的三维模型的检索主要分为两大类,分别是传统的基于文本的检索(Text-based Retrieval)方法和基于内容的检索(Content-based Retrieval)方法。According to the classification of retrieval methods, the current retrieval of 3D models is mainly divided into two categories, namely the traditional text-based retrieval (Text-based Retrieval) method and the content-based retrieval (Content-based Retrieval) method.
(1)基于文本的三维模型检索方法(1) Text-based 3D model retrieval method
基于文本的三维模型检索方法是基于关键词的,是目前最为普遍的检索方式。这需要对数据库中的三维模型人为地添加用以描述它的关键词,比如SketchUp的3D模型库(3D Warehouse)、TurboSquid的专业模型库和中国台湾大学的3D蛋白质检索系统(3DProtein Retrieval System)等,现在能够在网上找到一些大型的商用的模型检索平台,它们大多是这类基于关键词的三维模型检索方式。The text-based 3D model retrieval method is based on keywords and is currently the most common retrieval method. This requires artificially adding keywords to describe the 3D model in the database, such as SketchUp's 3D model library (3D Warehouse), TurboSquid's professional model library, and China National Taiwan University's 3D protein retrieval system (3DProtein Retrieval System), etc. Now, some large-scale commercial model retrieval platforms can be found on the Internet, most of which are keyword-based 3D model retrieval methods.
(2)基于内容的三维模型检索方法(2) Content-based 3D model retrieval method
基于内容的检索方法是三维模型检索的研究热点。如图1所示为基于内容的三维模型检索的基本框架,框架整体分为离线部分和在线部分。对于离线部分,每个3D模型都需要用形状描述符标示。为了提升检索效率,通常对数据库中各模型特征描述符建立索引。对于在线部分,进行查询表达的输入主要可分为两种方式:一种是提供一个与目标模型同类的三维模型;另一种是手绘目标模型的草图。在计算特征描述符后,将用户检索输入数据的描述符与数据库中模型特征描述符进行相似度比较,然后按照相似度大小递减的顺序将结果返回,并可视化地呈现给用户。Content-based retrieval is a research hotspot in 3D model retrieval. As shown in Figure 1, the basic framework of content-based 3D model retrieval is divided into an offline part and an online part. For the offline part, each 3D model needs to be labeled with a shape descriptor. In order to improve retrieval efficiency, an index is usually established for each model feature descriptor in the database. For the online part, there are two main ways to input the query expression: one is to provide a 3D model similar to the target model; the other is to draw a sketch of the target model. After calculating the feature descriptors, compare the similarity between the descriptors retrieved by the user and the model feature descriptors in the database, and then return the results in descending order of similarity and present them visually to the user.
现有技术中存在的缺点:Shortcomings existing in the prior art:
(1)基于文本的三维模型检索方法(1) Text-based 3D model retrieval method
传统的基于文本关键词的方式并不能很好地适用在三维模型检索的场景里,其主要原因有三点:第一,三维模型具有复杂的拓扑结构、形状特征,且种类繁多,其本身蕴含很多细节信息难以用几个关键词来表达清楚。第二,给三维模型添加文本关键词的加标签过程需要手工完成,而互联网上三维模型数量快速增长,手工添加的方式较为繁琐,工作量也很大。第三,由于不同人对种类繁多的三维模型的理解不同,所想到的描述它的关键词也有较大差异,容易导致检索关键词与目标模型的标签不一致,且手工加关键词标签的方式受限于标签语言种类,也不便于进行国际化推广。正是基于这些原因,仅采用简单的关键词进行检索,成功率会很低,许多时候得不到想要的结果。比如,用户想要检索某种特定外形和图案的轿车,那么仅仅依靠关键词难以搜索到准确的、满意的结果。The traditional method based on text keywords cannot be well applied in the scene of 3D model retrieval. There are three main reasons for this: First, 3D models have complex topological structures and shape features, and there are many kinds of them. Detailed information is difficult to express clearly with a few keywords. Second, the tagging process of adding text keywords to 3D models needs to be done manually, and the number of 3D models on the Internet is increasing rapidly, and the manual adding method is cumbersome and the workload is also heavy. Third, because different people have different understandings of various 3D models, the keywords they think of to describe them are also quite different, which may easily lead to inconsistencies between the search keywords and the labels of the target model, and the way of manually adding keyword labels is affected It is limited to the types of label languages, and it is not convenient for international promotion. It is for these reasons that if only simple keywords are used for retrieval, the success rate will be very low, and the desired results will not be obtained in many cases. For example, if a user wants to search for a car with a specific shape and pattern, it is difficult to search for accurate and satisfactory results only by keywords.
(2)基于内容的三维模型检索方法(2) Content-based 3D model retrieval method
对于基于三维模型实例的模型检索,其缺点是用户在发起检索时,通常很难找到一个非常合适的模型实例作为输入,因为假如用户手头有非常合适的目标模型的话,那么也就没必要进行检索了。For model retrieval based on 3D model instances, the disadvantage is that it is usually difficult for the user to find a very suitable model instance as input when the user initiates the retrieval, because if the user has a very suitable target model at hand, then there is no need for retrieval up.
对于基于手绘草图的三维模型检索,其缺点在于它通常没有考虑草图整体的结构,它只是基于区域局部来考虑的;它的另一个缺点就是对用户草图的风格比较敏感,如果用户在局部的轮廓线绘制风格差异较大,那么它提取的结果差异就会放大,这势必会影响最终的检索结果。For 3D model retrieval based on hand-drawn sketches, its disadvantage is that it usually does not consider the overall structure of the sketch, it is only considered based on the local area; another disadvantage is that it is sensitive to the style of the user's sketch, if the user is in the local outline If the line drawing style is quite different, the difference in the extracted results will be enlarged, which will inevitably affect the final retrieval results.
发明内容Contents of the invention
本发明的目的在于克服现有技术的不足,本发明提供了一种基于手绘草图部件分割的三维模型检索系统及方法,可以使得基于手绘草图的三维模型检索更加精准有效。The purpose of the present invention is to overcome the deficiencies of the prior art. The present invention provides a 3D model retrieval system and method based on hand-drawn sketch parts segmentation, which can make the 3D model retrieval based on hand-drawn sketches more accurate and effective.
为了解决上述问题,本发明提出了一种基于手绘草图部件分割的三维模型检索系统,所述系统包括:In order to solve the above problems, the present invention proposes a three-dimensional model retrieval system based on hand-drawn sketch parts segmentation, the system includes:
预处理模块,用于接收手绘查询草图,对所述手绘查询草图进行去噪处理获得灰度图,并对所述灰度图进行二值化处理、边界扩展处理、图像孔洞填充处理,获得处理后的图像;A preprocessing module, configured to receive a hand-drawn query sketch, perform denoising processing on the hand-drawn query sketch to obtain a grayscale image, and perform binarization processing, boundary extension processing, and image hole filling processing on the grayscale image to obtain a processed after the image;
部件标记模块,用于对所述处理后的图像进行等间隔采样,获得采样点,并对所述采样点添加部件标签;A component labeling module, configured to sample the processed images at equal intervals, obtain sampling points, and add component labels to the sampling points;
采样点特征提取模块,用于提取所述采样点的各种特征向量;Sampling point feature extraction module, used to extract various feature vectors of the sampling point;
部件分割模块,用于根据添加部件标签后的采样点的各种特征向量进行分割模型训练;The component segmentation module is used to perform segmentation model training according to various feature vectors of the sampling points after adding component labels;
相似度计算与总评分排序模块,用于基于分割模型进行部件局部特征提取以及部件局部相似度计算,并对所述处理后的图像进行视图全局特征提取及视图全局相似度计算,按照总评分进行排序,并将排序结果返回给客户端。The similarity calculation and total score sorting module is used to extract local features of parts and calculate local similarity of parts based on the segmentation model, and perform view global feature extraction and view global similarity calculation on the processed image, according to the total score Sort and return the sorted results to the client.
优选地,所述预处理模块包括:Preferably, the preprocessing module includes:
草图去噪处理单元,用于对所述手绘查询草图进行去噪处理获得灰度图;A sketch denoising processing unit, configured to perform denoising processing on the hand-drawn query sketch to obtain a grayscale image;
二值化处理单元,用于对所述灰度图进行二值化处理;a binarization processing unit, configured to perform binarization processing on the grayscale image;
边界扩展处理单元,用于对二值化处理后的图像四周进行空白填充处理;The boundary extension processing unit is used to perform blank filling processing around the binarized image;
图像孔洞填充处理单元,用于对空白填充处理后的图像进行图像孔洞填充处理。The image hole filling processing unit is configured to perform image hole filling processing on the image after blank filling processing.
优选地,所述部件标记模块包括:Preferably, the component marking module includes:
轮廓线提取单元,用于对所述处理后的图像进行轮廓线提取;A contour extraction unit, configured to extract contours from the processed image;
采样单元,用于对提取轮廓线后的图像进行等间隔采样,获得采样点;The sampling unit is used to sample the image at equal intervals after the contour line is extracted to obtain sampling points;
部件标记单元,用于对所述采样点添加部件标签。The component labeling unit is used for adding component labels to the sampling points.
优选地,所述采样点特征提取模块包括:Preferably, the sampling point feature extraction module includes:
一元特征提取单元,用于对添加部件标签后的采样点进行一元特征提取;A unitary feature extraction unit, which is used to extract a unitary feature from the sampling point after adding the component label;
二元特征提取单元,用于对添加部件标签后的采样点进行二元特征提取。The binary feature extraction unit is used to perform binary feature extraction on the sampling points after adding component labels.
优选地,所述部件分割模块包括:Preferably, the component segmentation module includes:
分割模型训练单元,用于根据添加部件标签后的采样点的各种特征向量进行分割模型训练;The segmentation model training unit is used to perform segmentation model training according to various feature vectors of the sampling points after adding the part label;
部件分割单元,用于根据分割模型对添加部件标签后的采样点进行部件分割。The component segmentation unit is configured to perform component segmentation on the sampling points after adding component labels according to the segmentation model.
相应地,本发明还提供一种基于手绘草图部件分割的三维模型检索方法,所述方法包括:Correspondingly, the present invention also provides a 3D model retrieval method based on hand-drawn sketch component segmentation, the method comprising:
接收手绘查询草图,对所述手绘查询草图进行去噪处理获得灰度图,并对所述灰度图进行二值化处理、边界扩展处理、图像孔洞填充处理,获得处理后的图像;receiving a hand-drawn query sketch, performing denoising processing on the hand-drawn query sketch to obtain a grayscale image, and performing binarization processing, boundary extension processing, and image hole filling processing on the grayscale image to obtain a processed image;
对所述处理后的图像进行等间隔采样,获得采样点,并对所述采样点添加部件标签;Sampling the processed image at equal intervals to obtain sampling points, and adding component labels to the sampling points;
提取所述采样点的各种特征向量;Extracting various feature vectors of the sampling points;
根据添加部件标签后的采样点的各种特征向量进行分割模型训练;Carry out segmentation model training according to various feature vectors of sampling points after adding component labels;
基于分割模型进行部件局部特征提取以及部件局部相似度计算,并对所述处理后的图像进行视图全局特征提取及视图全局相似度计算,按照总评分进行排序,并将排序结果返回给客户端。Based on the segmentation model, extract local features of parts and calculate local similarity of parts, and perform global view feature extraction and global view similarity calculation on the processed images, sort according to the total score, and return the sorting results to the client.
优选地,所述对所述手绘查询草图进行去噪处理获得灰度图,并对所述灰度图进行二值化处理、边界扩展处理、图像孔洞填充处理,获得处理后的图像的步骤,包括:Preferably, the step of performing denoising processing on the hand-drawn query sketch to obtain a grayscale image, and performing binarization processing, boundary extension processing, and image hole filling processing on the grayscale image to obtain a processed image, include:
对所述手绘查询草图进行去噪处理获得灰度图;Denoising the hand-drawn query sketch to obtain a grayscale image;
对所述灰度图进行二值化处理;Perform binarization processing on the grayscale image;
对二值化处理后的图像四周进行空白填充处理;Perform blank filling processing around the binarized image;
对空白填充处理后的图像进行图像孔洞填充处理。Carry out image hole filling processing on the image after blank filling processing.
优选地,所述对所述处理后的图像进行等间隔采样,获得采样点,并对所述采样点添加部件标签的步骤,包括:Preferably, the step of sampling the processed images at equal intervals to obtain sampling points, and adding component labels to the sampling points includes:
对所述处理后的图像进行轮廓线提取;Contour extraction is performed on the processed image;
对提取轮廓线后的图像进行等间隔采样,获得采样点;Sampling at equal intervals on the image after extracting the contour line to obtain sampling points;
对所述采样点添加部件标签。Add component labels to the sampling points.
优选地,所述提取所述采样点的各种特征向量的步骤,包括:Preferably, the step of extracting various feature vectors of the sampling points includes:
对添加部件标签后的采样点进行一元特征提取;Perform unary feature extraction on the sampling points after adding component labels;
对添加部件标签后的采样点进行二元特征提取。Binary feature extraction is performed on the sampling points after adding part labels.
优选地,所述根据添加部件标签后的采样点的各种特征向量进行分割模型训练的步骤,包括:Preferably, the step of performing segmentation model training according to various feature vectors of sampling points after adding part labels includes:
根据添加部件标签后的采样点的各种特征向量进行分割模型训练;Carry out segmentation model training according to various feature vectors of sampling points after adding component labels;
根据分割模型对添加部件标签后的采样点进行部件分割。Segment the sampling points after adding component labels according to the segmentation model.
在本发明实施例中,综合利用手绘草图部件的几何信息、部件间的拓扑结构信息以及整幅视图的全局信息,并设置了三视图动态赋权的机制,放大重要视角在总评分中的影响,从而使得基于手绘草图的三维模型检索更加精准有效;另外,可单独用于草图理解、草图归类等手绘图部件分割的应用场景中。In the embodiment of the present invention, the geometric information of the hand-drawn sketch components, the topology information between the components and the global information of the entire view are comprehensively used, and a dynamic weighting mechanism for three views is set up to amplify the impact of important perspectives on the total score , so that the retrieval of 3D models based on hand-drawn sketches is more accurate and effective; in addition, it can be used alone in the application scenarios of hand-drawn drawing parts segmentation such as sketch understanding and sketch classification.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1是现有技术中基于内容的三维模型检索的基本框架示意图;FIG. 1 is a schematic diagram of a basic framework of content-based 3D model retrieval in the prior art;
图2是本发明实施例的基于手绘草图部件分割的三维模型检索系统的结构组成示意图;2 is a schematic diagram of the structural composition of a three-dimensional model retrieval system based on hand-drawn sketch parts segmentation according to an embodiment of the present invention;
图3是本发明实施例的基于手绘草图部件分割的三维模型检索系统的内部处理过程示意图;3 is a schematic diagram of the internal processing process of the three-dimensional model retrieval system based on hand-drawn sketch parts segmentation according to an embodiment of the present invention;
图4是本发明实施例中添加标签的效果示意图;Fig. 4 is a schematic diagram of the effect of adding labels in the embodiment of the present invention;
图5是本发明实施例的基于手绘草图部件分割的三维模型检索方法的流程示意图。FIG. 5 is a schematic flowchart of a three-dimensional model retrieval method based on hand-drawn sketch component segmentation according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
图2是本发明实施例的基于手绘草图部件分割的三维模型检索系统的结构组成示意图,如图2所示,该系统包括:Fig. 2 is a schematic diagram of the structural composition of a three-dimensional model retrieval system based on hand-drawn sketch parts segmentation according to an embodiment of the present invention. As shown in Fig. 2, the system includes:
预处理模块1,用于接收手绘查询草图,对手绘查询草图进行去噪处理获得灰度图,并对灰度图进行二值化处理、边界扩展处理、图像孔洞填充处理,获得处理后的图像;The preprocessing module 1 is used to receive the hand-drawn query sketch, perform denoising processing on the hand-drawn query sketch to obtain a grayscale image, and perform binarization processing, boundary expansion processing, and image hole filling processing on the grayscale image to obtain a processed image ;
部件标记模块2,用于对预处理模块1处理后的图像进行等间隔采样,获得采样点,并对采样点添加部件标签;The component labeling module 2 is used to sample the images processed by the preprocessing module 1 at equal intervals, obtain sampling points, and add component labels to the sampling points;
采样点特征提取模块3,用于提取部件标记模块2所获得的采样点的各种特征向量;The sampling point feature extraction module 3 is used to extract various feature vectors of the sampling points obtained by the part marking module 2;
部件分割模块4,用于根据添加部件标签后的采样点的各种特征向量进行分割模型训练;Part segmentation module 4, for performing segmentation model training according to various feature vectors of sampling points after adding part labels;
相似度计算与总评分排序模块5,用于基于分割模型进行部件局部特征提取以及部件局部相似度计算,并对处理后的图像进行视图全局特征提取及视图全局相似度计算,按照总评分进行排序,并将排序结果返回给客户端。Similarity Calculation and Total Score Sorting Module 5, which is used to extract local features of parts and calculate local similarity of parts based on the segmentation model, and perform view global feature extraction and view global similarity calculation on processed images, and sort according to the total score , and returns the sorted results to the client.
图3为本发明实施例的基于手绘草图部件分割的三维模型检索系统的内部处理过程,下面结合图2、图3对本发明实施例的系统进行详细说明。Fig. 3 is the internal processing process of the 3D model retrieval system based on hand-drawn sketch parts segmentation according to the embodiment of the present invention. The system according to the embodiment of the present invention will be described in detail below in conjunction with Fig. 2 and Fig. 3 .
用户在检索时输入的手绘草图不同于三维模型的投影视图。由于用户通过鼠标、触摸屏或触控笔绘制草图,手绘草图往往不够精确,其轮廓线往往包含噪声,因此需要对用户手绘草图进行必要的预处理,才能进行接下来的处理程序。The hand-drawn sketch entered by the user at the time of retrieval differs from the projected view of the 3D model. Since users draw sketches through mouse, touch screen or stylus, hand-drawn sketches are often not precise enough, and their contours often contain noise. Therefore, necessary preprocessing is required for user-drawn sketches before subsequent processing procedures can be performed.
其中,预处理模块1包括:Wherein, the preprocessing module 1 includes:
草图去噪处理单元,用于对手绘查询草图进行去噪处理获得灰度图;A sketch denoising processing unit, configured to denoise the hand-drawn query sketch to obtain a grayscale image;
二值化处理单元,用于对灰度图进行二值化处理;A binarization processing unit, configured to binarize the grayscale image;
边界扩展处理单元,用于对二值化处理后的图像四周进行空白填充处理;The boundary extension processing unit is used to perform blank filling processing around the binarized image;
图像孔洞填充处理单元,用于对空白填充处理后的图像进行图像孔洞填充处理。The image hole filling processing unit is configured to perform image hole filling processing on the image after blank filling processing.
草图去噪处理:由于手绘草图末端不闭合会对接下来特征提取产生影响,本发明实施例中进行预处理,记录用户绘图时每一笔画的起点和终点坐标,如果某一笔画的端点坐标与其他笔画的端点坐标间的欧氏距离小于30个像素的阈值,那么就在这两个点之间连线。Sketch denoising processing: Since the end of the hand-drawn sketch is not closed, it will affect the subsequent feature extraction. In the embodiment of the present invention, preprocessing is performed to record the starting and ending coordinates of each stroke when the user draws. If the endpoint coordinates of a certain stroke are different from other If the Euclidean distance between the coordinates of the endpoints of the stroke is less than the threshold of 30 pixels, then a line is connected between these two points.
包围盒处理:由于不同草图的绘制部分大小不一,为了有效地、一致地进行后续的特征提取和机器学习,需要对视图进行包围盒处理,获取原始图像中有草图线条的局部区域。Bounding box processing: Due to the different sizes of the drawn parts of different sketches, in order to effectively and consistently perform subsequent feature extraction and machine learning, it is necessary to perform bounding box processing on the view to obtain the local area with sketch lines in the original image.
保持比例缩放处理:为了满足图像尺度不变性,尽可能地让所有图的空白边界都最小化,需要进行保持比例缩放处理。用180除以包围盒最长边的长度作为缩放的比例因子,从而进行图像缩放。Maintain scaling processing: In order to satisfy image scale invariance and minimize the blank borders of all images as much as possible, scaling processing is required. Image scaling is performed by dividing 180 by the length of the longest side of the bounding box as the scale factor for scaling.
二值化处理:手绘草图在缩放后变为了灰度图,需要进行二值化处理,以便于模型检索流程中的全局特征提取。Binarization processing: After zooming, the hand-drawn sketch becomes a grayscale image, which needs to be binarized to facilitate global feature extraction in the model retrieval process.
边界扩展处理:为了使得草图绘制区域居中,需要进行边界扩展处理,将图像四周填充空白,使得图像大小统一为200*200像素。Boundary extension processing: In order to center the sketch drawing area, boundary extension processing is required to fill in blanks around the image so that the image size is unified to 200*200 pixels.
图像孔洞填充处理:由于草图的轮廓线包括外轮廓线和内轮廓线,对于模型检索场景,通常外轮廓线足够区分不同类别的模型,所以为使得手绘草图与投影视图在相似的细节展现程度情况下进行比较,需要先对其进行填充预处理。Image hole filling processing: Since the contour line of the sketch includes the outer contour line and the inner contour line, for the model retrieval scene, the outer contour line is usually enough to distinguish different types of models, so in order to make the hand-drawn sketch and the projected view show similar details For comparison, it needs to be filled and preprocessed first.
进一步地,部件标记模块2包括:Further, the component marking module 2 includes:
轮廓线提取单元,用于对处理后的图像进行轮廓线提取;Contour line extracting unit, is used for carrying out contour line extraction to processed image;
采样单元,用于对提取轮廓线后的图像进行等间隔采样,获得采样点;The sampling unit is used to sample the image at equal intervals after the contour line is extracted to obtain sampling points;
部件标记单元,用于对采样点添加部件标签。The component labeling unit is used to add component labels to the sampling points.
(1)大类划分(1) Classification
数据库中的模型类别众多,拓扑结构千差万别,因此在部件标记前进行大类划分是必要的。大类划分的标准在于两个方面:一方面,应使得尽可能多的相似拓扑结构的模型归入同一个大类,一起进行部件分割的训练学习;另一方面,应使得数据库中所有模型划分出的大类数尽可能少,从而降低在线部分手绘草图按各个大类分割的总次数。There are many types of models in the database, and the topological structure varies greatly, so it is necessary to classify the models before part marking. The criteria for class division lie in two aspects: on the one hand, as many models with similar topological structures as possible should be classified into the same class, and the training and learning of component segmentation should be performed together; on the other hand, all models in the database should be divided The number of major categories should be as few as possible, so as to reduce the total number of divisions of online hand-drawn sketches according to each major category.
(2)基于等间隔的采样点设计和部件标签(2) Based on equally spaced sampling point design and component labeling
考虑到后续对各个采样点的特征提取,要求采样点大小必须保证以下三个方面:采样点要足够密集,以免不同部件落入同一个采样点中,造成部件标签的不准确;采样点不宜过于密集,以免提取特征的总运算成本过高,导致在检索时无法实时响应;采样点的大小确定要考虑到多种一元特征在提取时的采样点大小,使得提取不同特征的采样点边长之间呈整数倍的关系,从而保证每个采样点能获得合理的、有效的特征组合。Considering the subsequent feature extraction of each sampling point, the size of the sampling point must ensure the following three aspects: the sampling point should be dense enough to prevent different components from falling into the same sampling point, resulting in inaccurate component labels; the sampling point should not be too large Intensive, in order to avoid the high total operation cost of feature extraction, resulting in the inability to respond in real time during retrieval; the size of sampling points should take into account the size of sampling points during extraction of various unary features, so that the difference between the side lengths of sampling points for extracting different features There is an integer multiple relationship between them, so as to ensure that each sampling point can obtain a reasonable and effective combination of features.
基于上述这些原因,经过大量实验尝试,最终采用等间隔采样的方式,对每幅轮廓线沿轮廓线距离每10个像素提取1个采样点。对采样点添加部件标签,如头、躯体、四肢、尾巴等,用于对大类模型的视图做部件分割,用当前大类里各个视图采样点的局部特征向量进行训练。Based on the above reasons, after a lot of experimental attempts, the method of equal interval sampling is finally adopted, and one sampling point is extracted for every 10 pixels along the contour line distance of each contour line. Add part labels to the sampling points, such as head, body, limbs, tail, etc., to segment the views of the large class model, and use the local feature vectors of each view sampling point in the current class for training.
(3)基于离散曲线演化模型和骨架信息的自动预分割(3) Automatic pre-segmentation based on discrete curve evolution model and skeleton information
在基于视图进行部件分割的研究中,一个直观的想法就是基于视图轮廓线的几何特征进行分析,从而确定相邻部件之间的分割线,进而进行部件的分割。为了提高添加标签的效率,在本发明实施例中,采用基于离散曲线演化模型和骨架的视图部件自动分割方式,自动地进行部件的预分割。In the research of part segmentation based on view, an intuitive idea is to analyze the geometric features of the view contour line to determine the dividing line between adjacent parts, and then perform part segmentation. In order to improve the efficiency of adding labels, in the embodiment of the present invention, the automatic segmentation of view components based on the discrete curve evolution model and the skeleton is used to automatically perform pre-segmentation of components.
由离散曲线演化模型的简化多边形的端点集合与骨架末端点集合的差集,并上以该集合中每一元素为切点的、以中轴为圆心的内切圆的其他所有切点,从而构成预分割点集。通过实验发现,该集合都是大多数模型的潜在分割点构成的集合,因此采用该集合作为轮廓线分段依据,按照轮廓线采样点顺序分段添加标记,免去了每个部件圈选多边形包围盒的过程,从而有效提升标记效率。The difference between the end point set of the simplified polygon and the end point set of the skeleton of the discrete curve evolution model, and all other tangent points of the inscribed circle with the central axis as the center of the inscribed circle with each element in the set as the tangent point, so that Constitute the pre-segmentation point set. Through experiments, it is found that this set is a set of potential segmentation points of most models, so this set is used as the basis for contour segmentation, and marks are added in segments in the order of contour sampling points, eliminating the need to circle polygons for each part The bounding box process can effectively improve the marking efficiency.
(4)部件标记小工具的设计(4) Design of component marking widget
为了方便对采样点数据添加部件标签,采用了交互式添加与修改标记的方式。如图4所示是添加标签的示意图,采用鼠标点击划定部件多边形包围盒的方式,即可很方便地对部件所在的采样点进行标记。In order to add component labels to the sampling point data conveniently, an interactive way of adding and modifying labels is adopted. As shown in Figure 4, it is a schematic diagram of adding labels. The sampling point where the component is located can be easily marked by clicking the mouse to delineate the polygonal bounding box of the component.
在输出文件里不添加大类标签以及模型类的标签,主要是考虑在后期方便不断调整特征提取方式和参数,而只要包围盒和采样点的处理方式不变,采样点的部件标签就不受调整特征提取方法的影响。因此尽可能降低标签与特征提取部分的耦合度,把这两部分剥离开来,遵照统一的文件命名规则,分别写入同目录下的两个文件中,方便后期处理。加标签的工作完全地在交互式小工具里完成,与自动的特征提取过程互不干扰。In the output file, no category labels and model labels are added. The main reason is to continuously adjust the feature extraction method and parameters in the later stage. As long as the processing methods of the bounding boxes and sampling points remain unchanged, the component labels of the sampling points will not be affected. Adjust the effect of the feature extraction method. Therefore, reduce the coupling degree between the label and the feature extraction part as much as possible, separate the two parts, follow the unified file naming rules, and write them into two files in the same directory to facilitate post-processing. The labeling work is completely done in the interactive widget without interfering with the automatic feature extraction process.
进一步地,采样点特征提取模块3包括:Further, sampling point feature extraction module 3 includes:
一元特征提取单元,用于对添加部件标签后的采样点进行一元特征提取;A unitary feature extraction unit, which is used to extract a unitary feature from the sampling point after adding the component label;
二元特征提取单元,用于对添加部件标签后的采样点进行二元特征提取。The binary feature extraction unit is used to perform binary feature extraction on the sampling points after adding component labels.
(1)单个采样点自身的一元特征(1) The unary feature of a single sampling point itself
一元特征用于表征每个采样点内部的特征。本发明实施例中所采用的一元特征都是基于采样点的,计算得到每个采样点的各种特征向量。下面将分别阐述本特征提取过程的细节。Unary features are used to characterize the features inside each sampling point. The unary features used in the embodiments of the present invention are all based on sampling points, and various feature vectors of each sampling point are calculated. The details of this feature extraction process will be described separately below.
2D形状直径特征:对每个采样点的计算依照其与相邻采样点之间连线的夹角,计算该点的切线方向,然后沿着与该切线垂直的方向,在图像mask内发出射线,交于图像另一侧的边缘点,计算在形状内部射线部分的长度。同样地,计算与垂线两侧成30°、60°夹角的方向引出的射线交于图像另一侧的边缘点,也同样计算长度值,最后求取这些距离值的平均值,作为该采样点处的2D形状直径特征,共1维。2D shape diameter feature: the calculation of each sampling point is based on the angle between it and the line between adjacent sampling points, calculate the tangent direction of the point, and then emit rays in the image mask along the direction perpendicular to the tangent , intersect at the edge point on the other side of the image, and calculate the length of the ray part inside the shape. Similarly, calculate the edge point where the ray drawn from the direction with the angle of 30° and 60° on both sides of the vertical line intersects the edge point on the other side of the image, also calculate the length value, and finally calculate the average value of these distance values as the The 2D shape diameter feature at the sampling point, with a total of 1 dimension.
采样点到图像中心点的距离特征:把采样点到图像中心点之间的欧氏距离作为一元特征的一部分。The distance feature from the sampling point to the center point of the image: the Euclidean distance between the sampling point and the center point of the image is used as a part of the unary feature.
平均欧氏距离特征:把基于采样点的平均欧氏距离度量,用来表征每个采样点距离其它采样点的远离程度。比如在一幅昆虫的视图中,昆虫腿的平均欧氏距离通常比其它部件更远。每个采样点的平均欧氏距离通过SC采样点的距离矩阵求得,若每个采样点内有多个采样点则采用样本点欧氏距离平均值。欧氏距离通过计算每个样本点到其它各个样本点的欧氏距离平均值来得到。同时计算了均值的平方以及第10、第20、第30直至第90分位点的数据,然后将这11个统计度量统一除以当前图像所有采样点欧氏距离中的最大值,从而进行归一化,构成11维向量。Average Euclidean distance feature: The average Euclidean distance metric based on sampling points is used to characterize how far each sampling point is from other sampling points. For example, in a view of an insect, the average Euclidean distance of the insect's legs is usually farther than other parts. The average Euclidean distance of each sampling point is obtained through the distance matrix of SC sampling points. If there are multiple sampling points in each sampling point, the average Euclidean distance of the sampling points is used. The Euclidean distance is obtained by calculating the average Euclidean distance from each sample point to other sample points. At the same time, the square of the mean value and the data of the 10th, 20th, 30th, and 90th percentiles are calculated, and then these 11 statistical measures are uniformly divided by the maximum value of the Euclidean distance of all sampling points in the current image to perform normalization. Unified to form an 11-dimensional vector.
形状上下文直方图特征:形状上下文算法在物体边缘线上等间隔地取采样点,计算每个采样点相对于其它各个采样点的欧氏距离和角度。Shape context histogram feature: The shape context algorithm takes sampling points at equal intervals on the edge line of the object, and calculates the Euclidean distance and angle of each sampling point relative to other sampling points.
所在连通分支比重特征:由于有些手绘图和视图是由多个轮廓线构成,各个轮廓线段通常表征语义上独立的部件。本发明实施例中采用一个1维向量,用于表征当前采样点所在的连通分支占整幅图像的比例。首先,在提取轮廓线并下采样的阶段分别记录各段轮廓线的采样点数,然后通过判断当前采样点所在的轮廓线的采样点数占总采样点数的比例,从而得出一个与采样步长无关的比例特征,用以表征当前采样点所在的轮廓线在总轮廓线中的比重。在对昆虫类的实验中发现,具有较小连通分支比重特征的采样点通常是腿、触角等处在物体周边较为狭长的部件。Proportion feature of connected branches: Since some hand-drawn drawings and views are composed of multiple contour lines, each contour line segment usually represents a semantically independent component. In the embodiment of the present invention, a 1-dimensional vector is used to represent the proportion of the connected branch where the current sampling point is located in the entire image. First, record the number of sampling points of each contour line in the stage of extracting the contour line and down-sampling, and then determine the proportion of the sampling points of the contour line where the current sampling point is located in the total sampling points, so as to obtain a sampling point independent of the sampling step size The proportional feature of is used to represent the proportion of the contour line where the current sampling point is located in the total contour line. In the experiments on insects, it is found that the sampling points with the proportion characteristics of smaller connected branches are usually narrow and long parts such as legs and antennae around the object.
(2)邻接采样点之间的二元特征(2) Binary features between adjacent sampling points
二元特征是衡量每个采样点与邻接采样点之间的标签一致性的。因此,在计算二元特征前,需要先获取每个采样点在轮廓线上邻接点信息。由于采样点序列是有序的,所以邻接关系可以通过对采样点序列中相邻点的欧氏距离是否大于采样步长阈值来判定,若大于阈值则不为邻接点,反之则为邻接点。此外,考虑到一些模型具有多条轮廓线段,所以还需判断每段轮廓线的起始采样点与终止采样点之间是否邻接。二元特征需要有足够的区分度,即要求部件交界处采样点的二元特征和非部件交界处采样点的二元特征应当有较大差异。2D形状直径之差的绝对值以及切线方向之差的绝对值,作为二元特征。部件交汇处采样点的二元特征向量各分量值的数值较大;而不在部件交界点附近的采样点的二元特征各分量数值较小,故对部件的交界处有显著的区分度。Binary features measure the label consistency between each sampling point and adjacent sampling points. Therefore, before calculating the binary features, it is necessary to obtain the adjacent point information of each sampling point on the contour line. Since the sampling point sequence is ordered, the adjacency relationship can be determined by checking whether the Euclidean distance of adjacent points in the sampling point sequence is greater than the sampling step threshold. If it is greater than the threshold, it is not an adjacent point, otherwise it is an adjacent point. In addition, considering that some models have multiple contour line segments, it is also necessary to determine whether the start sampling point and the end sampling point of each contour line are adjacent. The binary features need to have sufficient discrimination, that is, the binary features of the sampling points at the component junction and the binary features of the sampling points at the non-component junction should be quite different. The absolute value of the difference between the diameters of the 2D shape and the absolute value of the difference between the tangent directions, as a binary feature. The value of each component of the binary eigenvector of the sampling point at the intersection of components is larger; the value of each component of the binary feature vector of the sampling point not near the intersection of components is smaller, so there is a significant degree of discrimination for the intersection of components.
进一步地,部件分割模块4包括:Further, the component segmentation module 4 includes:
分割模型训练单元,用于根据添加部件标签后的采样点的各种特征向量进行分割模型训练;The segmentation model training unit is used to perform segmentation model training according to various feature vectors of the sampling points after adding the part label;
部件分割单元,用于根据分割模型对添加部件标签后的采样点进行部件分割。The component segmentation unit is configured to perform component segmentation on the sampling points after adding component labels according to the segmentation model.
具体实施中,在添加部件标签后,采用条件随机场(CRF)模型,进行分割模型的训练。In a specific implementation, after adding component labels, a conditional random field (CRF) model is used to train the segmentation model.
(1)条件随机场模型(1) Conditional random field model
CRF模型的目标能量函数由一元项和二元项构成。其中一元项衡量采样点的一元特征及其标签的一致性;而二元项则由二元特征衡量采样点与邻接点之间的标签兼容性。The target energy function of the CRF model is composed of unary and binary terms. The unary item measures the unary feature of the sampling point and the consistency of its label; the binary item measures the label compatibility between the sampling point and its neighbors by the binary feature.
这里采用基于CRF模型的部件分割和标记方法,分别用于各个大类内部模型视图的部件分割的训练学习。计算所有采样点的最佳标签即要求最小化目标函数,如公式(1)所示:Here, the component segmentation and labeling methods based on the CRF model are used to train and learn the component segmentation of the internal model views of each category. Calculating the best labels for all sampling points requires minimizing the objective function, as shown in formula (1):
目标函数包含两大部分,其中E1为一元能量项,E2为二元能量项。The objective function consists of two parts, where E 1 is the unary energy item, and E 2 is the binary energy item.
一元能量项E1:用以评估一个分类器。分类器以采样点的特征向量x作为输入,输出在该特征条件下,采样点标签的概率分布P(c|x,θ1)。采用JointBoost分类器进行机器学习。如公式(2)所示为一元能量项的计算方式:Unary energy term E 1 : used to evaluate a classifier. The classifier takes the feature vector x of the sampling point as input, and outputs the probability distribution P(c|x,θ 1 ) of the label of the sampling point under the characteristic condition. Machine learning with JointBoost classifier. The calculation method of the unary energy item is shown in formula (2):
E1(c;x,θ1)=-logP(c|x,θ1) (2)E 1 (c; x,θ 1 )=-logP(c|x,θ 1 ) (2)
在公式(2)中,x即为一元特征,每个标签c的一元能量项等于在该特征向量条件下,采样点标签概率分布的负对数。In formula (2), x is a unary feature, and the unary energy item of each label c is equal to the negative logarithm of the probability distribution of the label of the sampling point under the condition of the feature vector.
二元能量项E2:用来表征每个采样点与轮廓线上相邻采样点之间标记为不同标签的概率,其定义如公式(3)所示:Binary energy item E 2 : used to characterize the probability that each sampling point is labeled as a different label from adjacent sampling points on the contour line, and its definition is shown in formula (3):
E2(c,c';y,θ2)=W(c,c')·[-κlogP(c≠c'|y,ξ)+μ] (3)E 2 (c,c'; y,θ 2 )=W(c,c')·[-κlogP(c≠c'|y,ξ)+μ] (3)
在公式(3)中,y即为二元特征。P(c≠c'|y,ξ)表征标签不同的可能性大小,它是一个几何特征的函数。标签惩罚矩阵W(c,c')表示标签c与c'之间的兼容程度。它是对称矩阵,矩阵中每个元素都被初始化为9999,通过迭代地学习过程来获得每对标签间的惩罚值。In formula (3), y is a binary feature. P(c≠c'|y,ξ) characterizes the different likelihood of labels, which is a function of geometric features. The label penalty matrix W(c,c') represents the degree of compatibility between labels c and c'. It is a symmetric matrix, each element in the matrix is initialized to 9999, and the penalty value between each pair of labels is obtained through an iterative learning process.
(2)条件随机场模型参数的迭代最优化学习方法(2) Iterative optimization learning method of conditional random field model parameters
在提取到采样点的一元、二元特征后,采用迭代最优化的方式学习CRF模型的参数,将标记好的训练采样点集合随机地分为5等份,其中4份作为训练集,1份作为验证集。首先,用样本集训练JointBoost分类器,学习一元项和二元项的部分参数。然后,用验证集以迭代的方式优化分割结果,从而学习CRF模型二元项中剩余的参数。After extracting the unary and binary features of the sampling points, the parameters of the CRF model are learned by iterative optimization, and the set of marked training sampling points is randomly divided into 5 equal parts, of which 4 parts are used as training sets and 1 part is used as the training set. as a validation set. First, the JointBoost classifier is trained with the sample set, and some parameters of the unary and binary items are learned. Then, the segmentation results are iteratively optimized with the validation set to learn the remaining parameters in the binary term of the CRF model.
将每个模型三个投影视图分割出的部件分别进行分类器的训练,在检索时也是三个视图分别计算落在相应类别中的投票数。这样比将视图部件特征全部放在一起进行训练的精度更高,且减小在线部分的计算量,从而提高检索效率。The parts divided by the three projection views of each model are trained separately for the classifier, and the three views respectively calculate the number of votes falling in the corresponding category during retrieval. In this way, the accuracy of training is higher than that of putting all the features of the view components together, and it reduces the calculation amount of the online part, thereby improving the retrieval efficiency.
采用部件分割可得到采样点部件标记序列。该序列记录了每个采样点的部件标签及其在图像中的坐标位置。Parts segmentation can be used to obtain the part label sequence of sampling points. The sequence records the part label for each sampling point and its coordinate position in the image.
由于采样点标记结果是沿着轮廓线有序排列的,本发明实施例基于这个特点设计部件图生成算法,顺次读入每个采样点标记及其图像坐标点,记录每种部件标签的上一个采样点坐标位置,并基于此计算相邻同标签采样点之间的欧氏距离,如果距离小于轮廓线等间距采样步长,则在这两点间连接线段。若读入未生成部件图的新部件标签则相应新建该部件图矩阵。在读入采样点标记的同时也记录各个部件采样点数。迭代地进行该过程,直至采样点标记序列读取完。最后,对各部件的图像分别计算包围盒和扩展边界,使得部件居中,从而生成尺寸为100*100像素的部件图。各部件的权重即为该部件采样点数占总采样点数的比例。Since the sampling point marking results are arranged in an orderly manner along the contour line, the embodiment of the present invention designs a part map generation algorithm based on this feature, reads each sampling point mark and its image coordinate point in sequence, and records the upper part of each part label. A sampling point coordinate position, based on which the Euclidean distance between adjacent sampling points with the same label is calculated. If the distance is less than the contour line equidistant sampling step, a line segment is connected between the two points. If a new component label that has not generated a component diagram is read in, the component diagram matrix is created accordingly. While reading the sampling point marks, the number of sampling points of each component is also recorded. This process is carried out iteratively until the sequence of sampling point markers is read. Finally, the bounding box and extended boundary are calculated for the image of each part, so that the part is centered, thereby generating a part map with a size of 100*100 pixels. The weight of each component is the proportion of the sampling points of the component to the total sampling points.
采用的Zernike矩特征描述符,构成视图的全局特征。Zernike矩满足旋转不变性,对不同形状轮廓具有较好的区分度。Zernike矩有两个参数,即n和m,n表示Zernike矩的阶,m表示Zernike矩的重复数。每组n和m的组合可得到一个复数Zernike矩值,采用Zernike矩的幅度作为全局特征向量的分量。这种特征描述符选用的分量越多结果越精确,但分量越多计算耗时也随之增加。兼顾检索准确度和计算耗时两方面,选用10维的Zernike矩,其n和m值组合如表1所示。The Zernike moment feature descriptor used constitutes the global feature of the view. The Zernike moment satisfies the invariance of rotation and has a good degree of discrimination for different shape contours. The Zernike moment has two parameters, namely n and m, n represents the order of the Zernike moment, and m represents the repetition number of the Zernike moment. The combination of each group of n and m can obtain a complex Zernike moment value, and the magnitude of the Zernike moment is used as the component of the global eigenvector. The more components selected for this kind of feature descriptor, the more accurate the result, but the more components, the more time-consuming calculation will increase. Considering both retrieval accuracy and calculation time consumption, a 10-dimensional Zernike moment is selected, and its n and m value combinations are shown in Table 1.
表1 Zernike矩全局特征的n和m值组合Table 1 The combination of n and m values of Zernike moment global features
对图像横向、纵向等分为32份,依次以200/32像素为步长移动块。在移动块的过程中,如果遇到块内无任何轮廓线的情形,则直接丢弃对该块的统计数据,从而避免由于图像局部空白而导致的特征分量大量为0的情况。The image is divided into 32 parts horizontally and vertically, and the blocks are moved in steps of 200/32 pixels. In the process of moving the block, if there is no contour line in the block, the statistical data of the block will be discarded directly, so as to avoid the situation that a large number of feature components are 0 due to the local blank of the image.
在离线部分,用K-means聚类算法对Gabor特征进行聚类,形成128个簇,将各个簇中心保存下来,构成词典。最后,统计距离各个簇中心最近的各个Gabor特征向量的个数。In the offline part, the K-means clustering algorithm is used to cluster the Gabor features to form 128 clusters, and the centers of each cluster are saved to form a dictionary. Finally, count the number of Gabor eigenvectors closest to the center of each cluster.
部件标签直接的邻接关系提供了部件之间的拓扑结构,而拓扑结构特征对于部件的扭转具有很强的鲁棒性。比如,一匹奔跑的马的腿部和站立的马的腿部的几何特征差异较大,但不论是否是奔跑状态,腿部都与身体部件是邻接的。基于这一点特性建立部件之间拓扑结构的图模型,将部件作为图的节点,相邻部件之间连接边,用邻接表来实现。如果手绘草图该部件与投影视图相应部件的邻接部件不同,则对两图拓扑层面的差异进行惩罚,即减小相似度评分。The direct adjacency of part labels provides the topology between parts, and the topological features are robust to part twisting. For example, the geometry of the legs of a running horse is quite different from that of a standing horse, but the legs are contiguous to the body parts regardless of whether they are running or not. Based on this feature, a graph model of the topological structure between components is established, and components are used as nodes of the graph, and adjacent components are connected by edges, which is realized by an adjacency list. If the part in the hand-drawn sketch is different from the adjacent part of the corresponding part in the projected view, the difference in the topological level of the two graphs is penalized, that is, the similarity score is reduced.
综合考虑底层几何信息以及部件间拓扑结构信息,按照该部件采样点数占所有部件总采样点数的比例,以及该部件在所有模型库中出现的比例确定该部件的权重值。公式(4)所示为部件权重的计算公式:Considering the underlying geometric information and topological structure information between components, the weight value of the component is determined according to the proportion of the sampling points of the component to the total sampling points of all components and the proportion of the component in all model libraries. Equation (4) shows the calculation formula of component weight:
公式(5)所示为草图与模型之间view视角的相似度评分的计算公式:Formula (5) shows the calculation formula of the similarity score of the view angle between the sketch and the model:
草图的部件拓扑结构可能与投影视图的拓扑结构不符合,这里采用合理的惩罚项,从而考量了拓扑结构差异。将拓扑结构邻接表中相应部件间进行比较,如果出现拓扑结构不一致的情形,则依照投影视图该部件的权重对相似度评分进行惩罚。The component topology of the sketch may not match the topology of the projected view, and a reasonable penalty is used here to account for the topology difference. Comparing the corresponding components in the topology adjacency list, if there is an inconsistency in the topology, the similarity score is punished according to the weight of the component in the projection view.
三维模型不同视角的投影视图所提供的信息量是不同的。比如,几乎无法从人的顶视图中获得部件信息,也无法看出其属于人的模型投影,而人的正视图则清晰地展现的头、躯体、四肢等语义部件。仅视图分割出的部件数客观地反映了投影视图所能提供的信息量。基于这个特点,如公式(6)所示分别计算正视图、侧视图和俯视图中分割出的部件数占三视图分割出总部件数的比例,分别作为正视图权重wi,front、侧视图权重wi,side和俯视图权重wi,top,用公式(7)所示为当前大类中各模型整体相似度评分的计算公式:The amount of information provided by the projection views of different viewing angles of the 3D model is different. For example, it is almost impossible to obtain component information from the top view of a person, and it is impossible to see that it belongs to the model projection of a person, while the front view of a person clearly shows semantic components such as head, body, and limbs. Only the number of parts divided by the view objectively reflects the amount of information that the projected view can provide. Based on this feature, as shown in formula (6), calculate the proportion of the number of parts segmented in the front view, side view, and top view to the total number of parts segmented in the three views, and use them as the front view weight w i,front and the side view weight w i,side and top view weight w i,top , using the formula (7) to show the calculation formula of the overall similarity score of each model in the current category:
最后,按照总评分升序排序,将前200个模型返回给用户,分页将相应缩略图呈现在浏览器中,即完成了一次检索过程。Finally, the top 200 models are returned to the user according to the ascending order of the total score, and the corresponding thumbnails are displayed in the browser by paging, which completes a retrieval process.
相应地,本发明实施例还提供一种基于手绘草图部件分割的三维模型检索方法,如图5所示,该方法包括:Correspondingly, the embodiment of the present invention also provides a 3D model retrieval method based on hand-drawn sketch component segmentation, as shown in FIG. 5 , the method includes:
S501,接收手绘查询草图,对手绘查询草图进行去噪处理获得灰度图,并对灰度图进行二值化处理、边界扩展处理、图像孔洞填充处理,获得处理后的图像;S501. Receive a hand-drawn query sketch, perform denoising processing on the hand-drawn query sketch to obtain a grayscale image, and perform binarization processing, boundary extension processing, and image hole filling processing on the grayscale image to obtain a processed image;
S502,对处理后的图像进行等间隔采样,获得采样点,并对采样点添加部件标签;S502. Sampling the processed images at equal intervals to obtain sampling points, and adding component labels to the sampling points;
S503,提取采样点的各种特征向量;S503, extracting various feature vectors of sampling points;
S504,根据添加部件标签后的采样点的各种特征向量进行分割模型训练;S504, perform segmentation model training according to various feature vectors of the sampling points after adding component labels;
S505,基于分割模型进行部件局部特征提取以及部件局部相似度计算,并对处理后的图像进行视图全局特征提取及视图全局相似度计算,按照总评分进行排序,并将排序结果返回给客户端。S505. Extract local features of components and calculate local similarity of components based on the segmentation model, and perform global view feature extraction and global view similarity calculation on the processed images, sort according to the total score, and return the sorting results to the client.
其中,S501进一步包括:Among them, S501 further includes:
对手绘查询草图进行去噪处理获得灰度图;Denoise the hand-drawn query sketch to obtain a grayscale image;
对灰度图进行二值化处理;Binarize the grayscale image;
对二值化处理后的图像四周进行空白填充处理;Perform blank filling processing around the binarized image;
对空白填充处理后的图像进行图像孔洞填充处理。Carry out image hole filling processing on the image after blank filling processing.
S502进一步包括:S502 further includes:
对处理后的图像进行轮廓线提取;Extract the outline of the processed image;
对提取轮廓线后的图像进行等间隔采样,获得采样点;Sampling at equal intervals on the image after extracting the contour line to obtain sampling points;
对采样点添加部件标签。Add part labels to sampling points.
S503进一步包括:S503 further includes:
对添加部件标签后的采样点进行一元特征提取;Perform unary feature extraction on the sampling points after adding component labels;
对添加部件标签后的采样点进行二元特征提取。Binary feature extraction is performed on the sampling points after adding part labels.
S504进一步包括:S504 further includes:
根据添加部件标签后的采样点的各种特征向量进行分割模型训练;Carry out segmentation model training according to various feature vectors of sampling points after adding component labels;
根据分割模型对添加部件标签后的采样点进行部件分割。Segment the sampling points after adding component labels according to the segmentation model.
具体地,本发明方法实施例的实现过程可参见系统相关功能模块的工作原理的相关描述,这里不再赘述。Specifically, for the implementation process of the method embodiment of the present invention, reference may be made to the relevant description of the working principle of the system-related functional modules, which will not be repeated here.
在本发明实施例中,综合利用手绘草图部件的几何信息、部件间的拓扑结构信息以及整幅视图的全局信息,并设置了三视图动态赋权的机制,放大重要视角在总评分中的影响,从而使得基于手绘草图的三维模型检索更加精准有效;另外,可单独用于草图理解、草图归类等手绘图部件分割的应用场景中。In the embodiment of the present invention, the geometric information of the hand-drawn sketch components, the topology information between the components and the global information of the entire view are comprehensively used, and a dynamic weighting mechanism for three views is set up to amplify the impact of important perspectives on the total score , so that the retrieval of 3D models based on hand-drawn sketches is more accurate and effective; in addition, it can be used alone in the application scenarios of hand-drawn drawing parts segmentation such as sketch understanding and sketch classification.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: Read Only Memory (ROM, Read Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
另外,以上对本发明实施例所提供的基于手绘草图部件分割的三维模型检索系统及方法进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。In addition, the 3D model retrieval system and method based on hand-drawn sketch parts segmentation provided by the embodiments of the present invention have been introduced in detail above. In this paper, specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments It is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, The contents of this description should not be construed as limiting the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510267873.3A CN104850633B (en) | 2015-05-22 | 2015-05-22 | A kind of three-dimensional model searching system and method based on the segmentation of cartographical sketching component |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510267873.3A CN104850633B (en) | 2015-05-22 | 2015-05-22 | A kind of three-dimensional model searching system and method based on the segmentation of cartographical sketching component |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104850633A CN104850633A (en) | 2015-08-19 |
CN104850633B true CN104850633B (en) | 2018-10-12 |
Family
ID=53850277
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510267873.3A Active CN104850633B (en) | 2015-05-22 | 2015-05-22 | A kind of three-dimensional model searching system and method based on the segmentation of cartographical sketching component |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104850633B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107122396A (en) * | 2017-03-13 | 2017-09-01 | 西北大学 | Three-dimensional model searching algorithm based on depth convolutional neural networks |
Families Citing this family (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105243137B (en) * | 2015-09-30 | 2018-12-11 | 华南理工大学 | A kind of three-dimensional model search viewpoint selection method based on sketch |
CN106126581B (en) * | 2016-06-20 | 2019-07-05 | 复旦大学 | Cartographical sketching image search method based on deep learning |
CN106530397B (en) * | 2016-10-13 | 2019-06-11 | 成都希盟泰克科技发展有限公司 | A 3D reconstruction method of geological plane based on sparse profile geological contour line |
CN106874350B (en) * | 2016-12-27 | 2020-09-25 | 合肥阿巴赛信息科技有限公司 | Diamond ring retrieval method and system based on sketch and distance field |
CN107220277A (en) * | 2017-04-14 | 2017-09-29 | 西北大学 | Image retrieval algorithm based on cartographical sketching |
JP6659641B2 (en) * | 2017-09-13 | 2020-03-04 | ファナック株式会社 | 3D model creation device |
CN108109205B (en) * | 2017-12-08 | 2019-12-20 | 山东师范大学 | Incomplete model retrieval and reconstruction method based on hole filling |
US10521700B2 (en) | 2017-12-14 | 2019-12-31 | Honda Motor Co., Ltd. | Methods and systems for converting a line drawing to a rendered image |
CN108170823B (en) * | 2018-01-04 | 2021-10-15 | 江西师范大学 | A hand-drawn interactive 3D model retrieval method based on high-level semantic attribute understanding |
CN110019914B (en) * | 2018-07-18 | 2023-06-30 | 王斌 | Three-dimensional model database retrieval method supporting three-dimensional scene interaction |
CN109325529B (en) * | 2018-09-06 | 2021-07-30 | 安徽大学 | A sketch recognition method and its application in commodity retrieval |
CN109308324A (en) * | 2018-09-08 | 2019-02-05 | 中山大学 | An image retrieval method and system based on hand-drawn style recommendation |
CN109741454A (en) * | 2018-11-20 | 2019-05-10 | 浙江大学 | A Sketch-based 3D Cartoon Model Modeling Method Based on Component Combination and Deformation |
CN110544300B (en) * | 2019-09-05 | 2021-06-29 | 佛山市玖章智能科技有限公司 | Method for automatically generating three-dimensional model based on two-dimensional hand-drawn image characteristics |
CN110598634B (en) * | 2019-09-12 | 2020-08-07 | 山东文多网络科技有限公司 | Machine room sketch identification method and device based on graph example library |
CN110889854B (en) * | 2019-10-16 | 2023-12-05 | 深圳信息职业技术学院 | Sketch part segmentation method, system, device and storage medium based on multi-scale deep learning |
CN112102284B (en) * | 2020-09-14 | 2024-05-28 | 推想医疗科技股份有限公司 | Marking method, training method and device for training sample of image segmentation model |
CN112764538A (en) * | 2021-01-13 | 2021-05-07 | 杭州师范大学 | Gesture interaction based space capacity improving method in VR environment |
CN112966138B (en) * | 2021-02-22 | 2022-04-12 | 济南大学 | Two-dimensional shape retrieval method and system based on contour feature point matching |
CN113093904A (en) * | 2021-03-26 | 2021-07-09 | 河北建筑工程学院 | Method, system, medium and device for obtaining image based on somatosensory device |
CN114241128A (en) * | 2021-12-10 | 2022-03-25 | 深圳市优必选科技股份有限公司 | File generation method and device of three-dimensional model and terminal equipment |
CN115080778B (en) * | 2022-05-31 | 2024-07-23 | 同济大学 | A cross-modal 3D model retrieval method based on noisy data cleaning |
CN114913330B (en) * | 2022-07-18 | 2022-12-06 | 中科视语(北京)科技有限公司 | Point cloud component segmentation method and device, electronic equipment and storage medium |
CN116597163A (en) * | 2023-05-18 | 2023-08-15 | 广东省旭晟半导体股份有限公司 | Infrared optical lens and its preparation method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103942795A (en) * | 2014-04-22 | 2014-07-23 | 浙江大学 | Structural synthesis method of image object |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7729531B2 (en) * | 2006-09-19 | 2010-06-01 | Microsoft Corporation | Identifying repeated-structure elements in images |
-
2015
- 2015-05-22 CN CN201510267873.3A patent/CN104850633B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103942795A (en) * | 2014-04-22 | 2014-07-23 | 浙江大学 | Structural synthesis method of image object |
Non-Patent Citations (2)
Title |
---|
一种基于部件空间分布的三维模型检索方法;万丽莉等;《软件学报》;20071130;第18卷(第11期);第2902-2913页 * |
基于手绘草图的三维模型检索系统;张必欢;《中国优秀硕士学位论文全文库》;20111215(第S2期);第12、15、20、27、49-50页 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107122396A (en) * | 2017-03-13 | 2017-09-01 | 西北大学 | Three-dimensional model searching algorithm based on depth convolutional neural networks |
CN107122396B (en) * | 2017-03-13 | 2019-10-29 | 西北大学 | Method for searching three-dimension model based on depth convolutional neural networks |
Also Published As
Publication number | Publication date |
---|---|
CN104850633A (en) | 2015-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104850633B (en) | A kind of three-dimensional model searching system and method based on the segmentation of cartographical sketching component | |
Russell et al. | LabelMe: a database and web-based tool for image annotation | |
CN108038122B (en) | A method of trademark image retrieval | |
CN104200240B (en) | A kind of Sketch Searching method based on content-adaptive Hash coding | |
CN106327506B (en) | A 3D Model Segmentation Method Based on Probability Partition Merging | |
US20180129658A1 (en) | Color sketch image searching | |
US20190251744A1 (en) | System and method for searching 3d models using 2d images | |
CN102508923A (en) | Automatic video annotation method based on automatic classification and keyword marking | |
CN104834693A (en) | Depth-search-based visual image searching method and system thereof | |
Willems et al. | Exemplar-based Action Recognition in Video. | |
Seidl et al. | Automated classification of petroglyphs | |
CN105868706A (en) | Method for identifying 3D model based on sparse coding | |
CN102073713A (en) | Optimal bag-of-words (BoW) model based three-dimensional model searching method | |
CN104751463B (en) | A kind of threedimensional model optimal viewing angle choosing method based on sketch outline feature | |
CN105678244B (en) | A kind of near video search method based on improved edit-distance | |
CN102831239A (en) | Method and system for building image database | |
CN102360436B (en) | Identification method for on-line handwritten Tibetan characters based on components | |
CN107730553A (en) | A kind of Weakly supervised object detecting method based on pseudo- true value search method | |
Zhang et al. | Topological spatial verification for instance search | |
CN108170823A (en) | Hand-drawn interactive three-dimensional model retrieval method based on high-level semantic attribute understanding | |
Kuric et al. | ANNOR: Efficient image annotation based on combining local and global features | |
JP2013246732A (en) | Handwritten character retrieval apparatus, method and program | |
CN111309956B (en) | An extraction method for image retrieval | |
CN104965928B (en) | A Chinese character image retrieval method based on shape matching | |
CN108170729A (en) | Utilize the image search method of hypergraph fusion multi-modal information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |