WO2017032190A1 - 图像识别的方法及装置 - Google Patents
图像识别的方法及装置 Download PDFInfo
- Publication number
- WO2017032190A1 WO2017032190A1 PCT/CN2016/090712 CN2016090712W WO2017032190A1 WO 2017032190 A1 WO2017032190 A1 WO 2017032190A1 CN 2016090712 W CN2016090712 W CN 2016090712W WO 2017032190 A1 WO2017032190 A1 WO 2017032190A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- shape
- image
- feature
- target geometry
- geometric
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/255—Detecting or recognising potential candidate objects based on visual cues, e.g. shapes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/24—Aligning, centring, orientation detection or correction of the image
- G06V10/245—Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
Definitions
- the present invention relates to the field of image recognition technologies, and in particular, to a method and apparatus for shape recognition in an image.
- the present invention provides a method and device for image recognition, which can identify different kinds of geometric figures contained in objects in an image, and abstract and simplify the real objects to a certain extent.
- An aspect of the present invention provides a method for image recognition, including:
- the target geometry is marked for display.
- the identifying the geometric shape included in the image includes:
- a closed shape formed by the lines is identified, the closed shape being determined as a geometric shape included in the image.
- comparing the geometric shape with the set reference shape, determining a target geometry that matches the reference feature comprises:
- the method further includes:
- the comparing the geometric shape with the set reference shape, determining the target geometry matching the reference feature comprises: setting a reference shape;
- the reference shape includes: a circle, a rectangle, a triangle, or a star;
- the reference features include: distance information from each point to the center point, number of vertices, angle of vertex information, and/or side length information.
- Another aspect of the present invention provides an apparatus for image recognition, including:
- An image acquisition module configured to acquire an image to be analyzed
- a first identification module configured to identify a geometric shape included in the image
- a second identification module configured to compare the geometric shape with the set reference shape, and determine a target geometry that matches the reference shape
- a display module is configured to display the target geometry.
- the first identification module includes:
- a pixel point analyzing unit configured to acquire a gray value of each pixel in the image
- a line identifying unit configured to determine adjacent pixels whose gray values differ by less than or equal to a set tolerance, and identify lines formed by the adjacent pixels
- a shape recognition unit for identifying a closed shape formed by the line, the closed shape being determined as a geometric shape included in the image.
- the second identification module includes:
- a feature extraction unit configured to extract a reference feature of the reference shape, and extract feature information of the geometric shape
- the feature comparison unit calculates the approximation degree of the feature information and the reference feature, and if the approximation is greater than or equal to the set threshold, determining that the corresponding geometry is the target geometry.
- the method further includes: a correction module, configured to modify the target geometry according to the reference feature, so that the corrected target geometry has all reference features corresponding to the reference shape.
- the method further includes: a setting module, configured to set a reference shape;
- the reference shape includes: a circle, a rectangle, a triangle, or a star;
- the reference features include: distance information from each point to the center point, number of vertices, angle of vertex information, and/or side length information.
- the beneficial effects of implementing the above technical solution of the present invention include: identifying, based on the set reference shape, whether there is a target geometric shape matching the reference shape in the image to be analyzed, and marking the existing target geometric shape in the image; According to different reference shapes, different types of geometric shapes in the image can be identified, and the objects in the image can be more abstracted and simplified, and the students (users) can intuitively recognize the geometric figures in natural life.
- FIG. 1 is a schematic flowchart of a method for image recognition according to an embodiment of the present invention
- 3 is a schematic diagram of another image recognition effect
- FIG. 4 is a schematic flowchart of a method for image recognition according to another embodiment of the present invention.
- FIG. 5 is a schematic diagram of another image recognition effect
- Figure 6 is a schematic diagram of an image correction effect
- FIG. 7 is a schematic structural diagram of an apparatus for image recognition according to an embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of an apparatus for image recognition according to another embodiment of the present invention.
- the invention provides a method for image recognition, which is especially suitable for abstracting and simplifying processing of objects in an image in the teaching field, identifying different types of geometric shapes in the image, and assisting students (users) to intuitively construct geometric figures in natural life. Cognition.
- Embodiments of the present invention also provide corresponding apparatus for image recognition. The details are described below separately.
- FIG. 1 is a schematic flowchart of a method for image recognition according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps S101 to S104, which are described in detail as follows:
- Step S101 acquiring an image to be analyzed
- the image to be analyzed may be a locally stored image, an imported external image, or an image taken instantaneously by a camera. Preferably, only one image is acquired at a time as an image to be analyzed.
- Step S102 identifying a geometric shape included in the image
- the manner of identifying the geometric shape included in the image may be: first processing the image into a gray image, and acquiring gray values of each pixel in the image; determining that the gray value is less than or equal to the set capacity. Poor adjacent pixels, then identifying lines formed by the adjacent pixels; further identifying a closed shape formed by the lines, the closed shape being determined as the geometric shape contained in the image.
- the tolerance setting has a key influence on the recognition accuracy and the recognition strength.
- the smaller the tolerance setting the higher the recognition accuracy, but the smaller the recognition strength (that is, the possible lines cannot be recognized. Come out); the larger the tolerance setting, the lower the recognition accuracy, but the higher the recognition strength. Therefore, it is necessary to adjust the tolerance according to the actual situation.
- Step S103 comparing the geometric shape with the set reference shape, determining a target geometry matching the reference shape
- the specific manner of step S103 may be: firstly, extracting reference features of the set reference shape, and separately extracting feature information of the geometric shape identified by the above steps; and then separately calculating feature information of each geometric shape and the reference
- the approximation of the feature can be expressed as a percentage. The higher the degree of approximation, the more similar the corresponding geometric shape is to the reference shape, and the more features satisfying the reference shape, when the degree of approximation is 100%, the corresponding geometric shape has all the references corresponding to the reference shape.
- the feature conversely, the lower the degree of approximation, the greater the difference between the corresponding geometric shape and the reference shape, and the fewer features corresponding to the reference shape.
- the set matching determination threshold if the approximation is greater than or equal to the threshold, it is determined that the corresponding geometry is the target geometry.
- the reference shape such as a circle, a rectangle, a triangle, or a star
- the above reference features include, but are not limited to, distance information from each point to the center point, the number of vertices, the angle of the vertex, and / or side length information.
- a circular reference feature includes lines that are smooth and continuous, and each point-to-center distance is the same;
- a reference feature of a triangle includes a closed figure composed of three sides and three vertices;
- a rectangular reference feature includes four sides, four vertices, And all the apex angles are right angles and so on.
- Step S104 displaying the target geometry.
- a specific color may be filled in a corresponding area of the target geometric shape in the image, or a new layer may be created on the image, and a corresponding geometric line drawing may be drawn on the newly created layer, that is, in the layer.
- the position of the geometric line map is aligned with the position of the corresponding target geometry in the image, and then the new layer is derived to clearly show the target geometry contained in the image.
- the image to be analyzed is a photo of a bicycle
- the reference shape is set to a triangle
- the feature information of the triangle is extracted, for example, three vertices, and the three vertices are not on the same straight line, and the sum of the vertices is 180 degrees, the sum of the lengths of any two sides is greater than the third side, and the like. It then begins to identify the lines in the bicycle image, resulting in a closed shape of lines, determining whether the features satisfy the characteristics of the triangle, and if so, marking the triangle at the corresponding position in the bicycle image.
- the tripod of the bicycle body and the triangle formed by the spokes in the wheel are identified (all triangles are not shown in the figure, just an example), or the identified triangles may be derived, and the identified multiples will be identified.
- the triangles are displayed separately.
- the image to be analyzed is a photograph of a bicycle, and the reference shape is reset to a circular shape, and the circular features can be extracted: a continuous smooth closed curve, and the distance from each point to the center point is equal. Start recognition, it can be recognized that the two wheels of the bicycle are round, and then the indicator display, or two rounds Export is displayed separately.
- FIG. 4 is a schematic flowchart of a method for image recognition according to another embodiment of the present invention. As shown in FIG. 4, the method includes:
- Step S201 acquiring an image to be analyzed
- Step S202 setting a reference shape
- Step S203 identifying a geometric shape included in the image
- Step S204 determining whether the approximate degree of the geometric shape and the reference shape meets the set condition. If yes, go to the next step, otherwise, go back to the previous step.
- the setting condition is a threshold of the set approximation, and the threshold is less than 100%, for example, 80%;
- Step S205 displaying the identified target geometry in the image.
- a transparent layer is newly created on the image, and a corresponding geometric line drawing is drawn on the transparent layer, that is, the position of the geometric line drawing in the transparent layer and the corresponding target geometric shape in the image.
- the positions are aligned to clearly show the target geometry contained in the image.
- Step S206 does the identified target geometry have all the reference features corresponding to the reference shape? If yes, go to step S208, if no, go to the next step.
- Step S207 correcting the target geometry according to the reference feature, so that the corrected target geometry has all the reference features corresponding to the reference shape;
- a certain fault tolerance range may be set, that is, the threshold is set to be less than 100%, and the approximate degree is greater than or equal to
- the geometry of the threshold can be confirmed as the target geometry.
- the ellipse can also be recognized as a circle, the trapezoid is also recognized as the target geometry of the rectangular reference shape, or the diamond is also recognized as the target geometry of the square reference shape; in addition, if there are some unexpected protrusions, turns in the line If it is not smooth, it can also be recognized as a smooth line.
- step S208 the corrected geometry is derived and displayed.
- the image to be analyzed is an image of a fence, and the reference shape is set to a rectangle.
- the two quadrilaterals shown in the figure can be identified through the above steps 201-204. However, the two quadrilaterals are not standard rectangles, and after the quadrilateral is subjected to a certain correction/deformation by the step S207, the four apex angles of the quadrilateral are at right angles, and the standard rectangle can be changed. At the same time, the correction process can be dynamically displayed to further help students understand the deformation between various geometric shapes.
- correction/deformation rule is not arbitrary, but based on the reference feature information of the reference shape, and follows the regular change of the depth of field transformation in the three-dimensional figure.
- the circular shape is set as the reference shape, and the graphic on the left side is a geometric shape close to a circle, because although one of the points is recessed inward, most of the points satisfy the characteristics of the circle, and a certain fault tolerance.
- This graphic can be recognized as a circle within the range.
- the standard circular shape information may be modified according to the standard circular information, including removing the inwardly recessed points in the left geometry, connecting the notched portions so as to satisfy all the features of the standard circle, and correcting the right
- the side is regular in a circle.
- the set reference shape based on the set reference shape (geometry)
- different reference shapes different geometric shapes in the image can be identified, and the objects in the image can be more abstracted and simplified, which is convenient for the students (users) to intuitively recognize the geometric figures in natural life.
- the characteristics of the graphics it can be automatically corrected to a more standard graphics, which is conducive to students to distinguish and contrast different geometric shapes.
- FIG. 7 is a schematic structural diagram of an apparatus for image recognition according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of an apparatus for image recognition according to an embodiment of the present invention.
- Only parts related to the embodiment of the present invention are shown in the figure, and those skilled in the art can understand the structure of the apparatus shown in the figure.
- FIG. 7 is a schematic structural diagram of an apparatus for image recognition according to an embodiment of the present invention. As shown in Figure 7, the device comprises:
- An image obtaining module 710 configured to acquire an image to be analyzed
- a first identification module 720 configured to identify a geometric shape included in the image
- a second identification module 730 configured to compare the geometric shape with the set reference shape, and determine a target geometry that matches the reference shape
- the display module 740 is configured to display the target geometry.
- the apparatus for image recognition of the embodiment further includes a setting module 750, configured to set a reference shape;
- the above reference shapes include, but are not limited to, a circle, a rectangle, a triangle, or a star; the above reference features include, but are not limited to, distance information from each point to a center point, number of vertices, angle of vertex information, and/or side length information.
- the first identification module 720 illustrated in FIG. 7 may specifically include:
- a pixel point analyzing unit 721, configured to acquire a gray value of each pixel in the image
- a line identifying unit 722 configured to determine adjacent pixel points whose gray value differences are less than or equal to a set tolerance, and identify a line formed by the adjacent pixel points;
- the shape recognition unit 723 is configured to identify a closed shape formed by the line, and determine the closed shape as a geometric shape included in the image.
- the second identification module 730 illustrated in FIG. 7 may specifically include:
- a feature extraction unit 731 configured to extract a reference feature of the reference shape, and extract feature information of the geometric shape
- the feature comparison unit 732 calculates the approximation degree of the feature information and the reference feature, and if the approximation is greater than or equal to the set threshold, determines that the corresponding geometry is the target geometry.
- FIG. 8 is a schematic structural diagram of an apparatus for image recognition according to another embodiment of the present invention.
- the apparatus for image recognition of the embodiment further includes a correction module 760, configured to correct the target geometry according to the reference feature, so that the corrected target geometry has the reference shape corresponding to All reference features.
- each functional module is merely an example, and may be used in an actual application, for example, according to configuration requirements of the corresponding hardware or software.
- the above-mentioned function allocation is completed by different functional modules, that is, the internal structure of the device for image recognition is divided into different functional modules to complete all or part of the functions described above.
- the user can set a reference shape (geometry), and the apparatus based on the image recognition can automatically recognize whether there is a target geometry matching the reference shape in the input image, and
- the existing target geometry is marked in the image; according to different reference shapes, different geometric shapes in the image can be identified, and the objects in the image are more abstracted and simplified, which is beneficial to the students (users) to nature.
- the geometry in life has an intuitive perception.
- any embodiment of the present invention can be accomplished by the program instructing the associated hardware (personal computer, server, or network device, etc.).
- the program can be stored in a computer readable storage medium.
- the program when executed, may perform all or part of the steps of the method specified in any of the above embodiments.
- the foregoing storage medium may include any medium that can store program code, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
一种图像识别的方法和装置。所述方法包括:获取待分析的图像(S101,S201);识别所述图像中包含的几何形状(S102,S203);比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状(S103);对所述目标几何形状进行标示显示(S104)。该方案根据不同的参考形状,可识别出图像中不同的几何形状,更为灵活对图像中物体进行抽象和简化处理,有利于让学生对自然生活中的几何图形有直观的认知。
Description
本发明涉及图像识别技术领域,特别是涉及一种图像中形状识别的方法及装置。
几何学中常用点、线等要素来描述物体,然而通常人们肉眼看物体时,并不能直观地感受到物体中包含哪些几何形状。
在教学领域,现有设备或分析软件可通过分析图像中包含像素点,将图像中包含的线条识别出来。但这种识别通常也只到线条的层面,并没有考虑图像中可能包含的几何形状,更无法将线条构成的不同几何图形分别进行区别识别。
因此,教学领域现有技术对真实物体进行抽象和简化的程度不够理想,无法让学生对自然生活中的几何图形有直观的感受。
发明内容
基于此,本发明提供一种图像识别的方法及装置,能够识别图像中物体包含的不同种类的几何图形,将真实物体进行一定程度的抽象和简化。
本发明采用以下技术方案:
本发明一方面提供一种图像识别的方法,包括:
获取待分析的图像;
识别所述图像中包含的几何形状;
比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状;
对所述目标几何形状进行标示显示。
作为一优选方式,所述识别所述图像中包含的几何形状,包括:
获取所述图像中各像素点的灰度值;
确定出灰度值相差小于等于设定容差的相邻像素点,识别由所述相邻像素点构成的线条;
识别由所述线条构成的封闭形状,将所述封闭形状确定为所述图像中包含的几何形状。
作为一优选方式,比对所述几何形状与设定的参考形状,确定出与所述参考特征匹配的目标几何形状,包括:
提取所述参考形状的参考特征,提取所述几何形状的特征信息;
计算所述特征信息、所述参考特征的近似度,若所述近似度大于等于设定阈值,则确定对应的几何形状为目标几何形状。
作为一优选方式,所述确定对应的几何形状为目标几何形状之后还包括:
根据所述参考特征对所述目标几何形状进行修正,使修正后的目标几何形状具备所述参考形状对应的全部参考特征。
作为一优选方式,所述比对所述几何形状与设定的参考形状,确定出与所述参考特征匹配的目标几何形状之前包括:设置参考形状;
所述参考形状包括:圆形、矩形、三角形或星形;
所述参考特征包括:各点到中心点的距离信息、顶点数量、顶点夹角信息和/或边长信息。
本发明另一方面提供一种图像识别的装置,包括:
图像获取模块,用于获取待分析的图像;
第一识别模块,用于识别所述图像中包含的几何形状;
第二识别模块,用于比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状;
显示模块,用于对所述目标几何形状进行标示显示。
作为一优选方式,所述第一识别模块包括:
像素点分析单元,用于获取所述图像中各像素点的灰度值;
线条识别单元,用于确定出灰度值相差小于等于设定容差的相邻像素点,识别由所述相邻像素点构成的线条;
以及,形状识别单元,用于识别由所述线条构成的封闭形状,将所述封闭形状确定为所述图像中包含的几何形状。
作为一优选方式,所述第二识别模块包括:
特征提取单元,用于提取所述参考形状的参考特征,提取所述几何形状的特征信息;
以及,特征比对单元,计算所述特征信息、所述参考特征的近似度,若所述近似度大于等于设定阈值,则确定对应的几何形状为目标几何形状。
作为一优选方式,还包括:修正模块,用于根据所述参考特征对所述目标几何形状进行修正,使修正后的目标几何形状具备所述参考形状对应的全部参考特征。
作为一优选方式,还包括:设置模块,用于设置参考形状;
所述参考形状包括:圆形、矩形、三角形或星形;
所述参考特征包括:各点到中心点的距离信息、顶点数量、顶点夹角信息和/或边长信息。
实施本发明的上述技术方案的有益效果包括:基于设定的参考形状,识别待分析图像中是否有与所述参考形状匹配的目标几何形状,并在图像中将存在的目标几何形状标示出来;根据不同的参考形状,可识别出图像中不同类型的几何形状,更灵活对图像中物体进行抽象和简化处理,有利于让学生(用户)对自然生活中的几何图形建立直观的认知。
图1为本发明一实施例图像识别的方法示意性流程图;
图2为一图像识别效果示意图;
图3为另一图像识别效果示意图;
图4为本发明另一实施例图像识别的方法示意性流程图;
图5为另一图像识别效果示意图;
图6为一图像修正效果示意图;
图7为本发明一实施例图像识别的装置示意性结构图;
图8为本发明另一实施例图像识别的装置示意性结构图。
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而非全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明提供一种图像识别的方法,尤其适用于教学领域对图像中物体进行抽象和简化处理,识别出图像中不同类型的几何形状,辅助让学生(用户)对自然生活中的几何图形建立直观的认知。本发明实施例还提供相应的图像识别的装置。以下分别进行详细说明。
图1为本发明一实施例图像识别的方法的示意性流程图。如图1中所示,所述方法包含以下步骤S101至步骤S104,详细说明如下:
步骤S101,获取待分析的图像;
所述待分析的图像可为本地存储的图像、导入的外部图像、或者通过摄像头即时拍摄的图像。优选地,一次仅获取一张图像作为待分析的图像。
步骤S102,识别所述图像中包含的几何形状;
本实施例中,识别所述图像中包含的几何形状的方式可为:先将图像处理为灰度图像,获取图像中各像素点的灰度值;确定出灰度值相差小于等于设定容差的相邻像素点,然后识别由所述相邻像素点构成的线条;进一步地识别由所述线条构成的封闭形状,将所述封闭形状确定为所述图像中包含的几何形状。
需要说明的是,容差的设定对于识别精确度和识别力度有关键的影响,通常容差设定越小,识别精确度越高,但识别力度越小(即可能有的线条无法被识别出来);容差设定越大,识别精确度越低,但识别力度越高。因此,需根据实际情况适应性调整容差。
步骤S103,比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状;
优选地,步骤S103的具体方式可为:首先需提取设置的参考形状的参考特征,还需分别提取上述步骤识别出的几何形状的特征信息;然后分别计算各几何形状的特征信息与所述参考特征的近似度。所述近似度可采用百分比表示,
且近似度越高,表明对应的几何形状与所述参考形状越相似,满足所述参考形状的特征越多,当近似度为100%时,对应的几何形状具备所述参考形状对应的全部参考特征;反之,近似度越低,表明对应的几何形状与所述参考形状相差越大,具备的所述参考形状对应的特征越少。
本实施例中,根据设定的匹配判定阈值,若所述近似度大于等于所述阈值,则确定对应的几何形状为目标几何形状。
需要说明的是,需在识别之前预先设置参考形状,例如圆形、矩形、三角形或星形等,上述参考特征包括但不限于各点到中心点的距离信息、顶点数量、顶点夹角信息和/或边长信息。例如圆形的参考特征包括线条为光滑连续的、各点到中心的距离相同;三角形的参考特征包括由三边组成有三个顶点的封闭图形;矩形的参考特征包括有四条边、四个顶点、且所有顶角都是直角等。
步骤S104,对所述目标几何形状进行标示显示。
优选地,可在所述图像中目标几何形状对应区域绘制填充特定颜色,或者在所述图像上新建一图层,在新建图层上绘制出对应的几何线条图,即所述图层中所述几何线条图的位置与所述图像中对应的目标几何形状的位置对齐,然后导出所述新建图层,以清楚显示所述图像中包含的目标几何形状。
下面以两个具体实例对上述实施例进行说明。
如图2所示,待分析的图像为一张自行车的照片,设定参考形状为三角形,提取三角形的特征信息例如:三个顶点、且三个顶点不在同一直线上、顶点夹角之和为180度、任意两边边长之和大于第三边等。然后开始识别自行车图像中的线条,得到由线条构成的封闭形状,判断其特征是否满足三角形的特征,如果满足就在自行车图像中对应位置标示出三角形。如图2中识别出自行车车身的三脚架和车轮中辐条构成的三角形(图中并没有将所有三角形全部显示出来,只是一个示例),或者还可将识别出的三角形导出,将识别出来的多个三角形单独进行显示。
如图3所示,待分析的图像为一张自行车的照片,重新设定参考形状为圆形,可提取圆形的特征:连续光滑的封闭曲线、各点到中心点的距离相等。开始识别,可识别出自行车两个车轮为圆形,然后进行标示显示,或将两个圆形
导出单独显示。
通过上述描述识别过程,学生可以清楚地看到自行车中不同的几何形状,提高对自然生活中的几何图形的认知。
图4为本发明另一实施例图像识别的方法的示意性流程图;如图4所示,包括:
步骤S201,获取待分析的图像;
步骤S202,设置参考形状;
步骤S203,识别所述图像中包含的几何形状;
步骤S204,判断所述几何形状与所述参考形状的近似度是否满足设定条件?若是,执行下一步骤,否则,返回上一步骤。
本实施例中设定条件为设定的近似度的阈值,该阈值小于100%,例如80%;
需要说明的是,上述步骤S201~S204的具体实施方式可参考上述实施例所述,不赘述。
步骤S205,在所述图像中对识别出的目标几何形状进行标示显示。
例如在所述图像上新建一透明图层,在透明图层上绘制出对应的几何线条图,即所述透明图层中所述几何线条图的位置与所述图像中对应的目标几何形状的位置对齐,以清楚显示所述图像中包含的目标几何形状。
步骤S206,识别出的目标几何形状是否具备所述参考形状对应的全部参考特征?若是,执行步骤S208,若否,执行下一步骤。
步骤S207,根据所述参考特征对所述目标几何形状进行修正,使修正后的目标几何形状具备所述参考形状对应的全部参考特征;
需要说明的是,本实施例中,比对几何形状的特征信息与参考形状的参考特征确定目标几何形状时,可设置一定的容错范围,即设定所述阈值小于100%,近似度大于等于所述阈值的几何形状均可确认为目标几何形状。例如:可将椭圆也识别为圆形,将梯形也识别为矩形参考形状的目标几何形状,或者将菱形也识别为正方形参考形状的目标几何形状;另外,如果线条中出现一些意外的突起、转折等不平滑,也可以将其识别为平滑线条。
步骤S208,导出显示修正后的几何形状。
下面以两个具体实例本实施例进一步说明。
如图5所示,待分析的图像为一围栏的图像,设定参考形状为矩形,通过上述步骤201~204可以识别出图示的两个四边形。可是这两个四边形并非标准矩形,通过步骤S207将上述四边形经过一定的修正/变形之后,使四边形的四个顶角为直角,就可以变成标准的矩形。同时,还可对该修正过程进行动态显示,进一步帮助学生理解各种几何形状之间的变形。
需要说明的是,上述修正/变形的规则并不是随意的,而是基于参考形状的参考特征信息,并遵循三维图形中的景深变换等有规律的变化。
如图6所示,设定圆形为参考形状,左侧的图形是一个接近圆形的几何形状,因为虽然其中有一块向内凹陷,但大多数点都满足圆的特征,在一定的容错范围内可将此图形识别为一个圆形。进一步的,可根据标准圆形的特征信息对其进行修正,包括将左侧几何形状中构成向内凹陷的点去除,连接缺口部分,以使其满足标准圆形的全部特征,修正后得到右侧规则的圆形。
需要说明的是,对于前述的各方法实施例,为了简便描述,将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本发明所必须的。
根据本发明的上述实施例,基于设定的参考形状(几何形状),识别输入的图像中是否有与所述参考形状的参考特征匹配的目标几何形状,并在图像中将存在的目标几何形状标示出来;根据不同的参考形状,可识别出图像中不同的几何形状,更为灵活对图像中物体进行抽象和简化处理,有利于让学生(用户)对自然生活中的几何图形有直观的认知;另外,并可以根据图形的特征,自动矫正成更加标准的图形,有利于学生对不同几何形状进行区分对比。
以下对可用于执行上述图像识别的方法的本发明实施例的图像识别的装置进行说明。图7为本发明实施例图像识别的装置的示意性结构图,为了便于说明,图中仅仅示出了与本发明实施例相关的部分,本领域技术人员可以理解,图中示出的装置结构并不构成对装置的限定,可以包括比图示更多或更少的部
件,或者组合某些部件,或者不同的部件布置。
图7为本发明实施例图像识别的装置的示意性结构图。如图7所示,所述装置包含:
图像获取模块710,用于获取待分析的图像;
第一识别模块720,用于识别所述图像中包含的几何形状;
第二识别模块730,用于比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状;
显示模块740,用于对所述目标几何形状进行标示显示。
优选的,本实施例的图像识别的装置还包括设置模块750,用于设置参考形状;
上述参考形状包括但不限于圆形、矩形、三角形或星形;上述参考特征包括但不限于:各点到中心点的距离信息、顶点数量、顶点夹角信息和/或边长信息。
作为一优选实施方式,图7中示例的第一识别模块720可具体包括:
像素点分析单元721,用于获取所述图像中各像素点的灰度值;
线条识别单元722,用于确定出灰度值相差小于等于设定容差的相邻像素点,识别由所述相邻像素点构成的线条;
以及,形状识别单元723,用于识别由所述线条构成的封闭形状,将所述封闭形状确定为所述图像中包含的几何形状。
作为一优选实施方式,图7中示例的第二识别模块730可具体包括:
特征提取单元731,用于提取所述参考形状的参考特征,以及提取所述几何形状的特征信息;
以及,特征比对单元732,计算所述特征信息、所述参考特征的近似度,若所述近似度大于等于设定阈值,则确定对应的几何形状为目标几何形状。
图8为本发明另一实施例图像识别的装置的示意性结构图。如图8所示,本实施例的图像识别的装置还包括修正模块760,用于根据所述参考特征对所述目标几何形状进行修正,使修正后的目标几何形状具备所述参考形状对应的全部参考特征。
需要说明的是,上述装置实施例中各模块/单元之间的信息交互、执行过程等内容,由于与本发明前述方法实施例基于同一构思,其带来的技术效果与本发明前述方法实施例相同,具体内容可参见本发明方法实施例中的叙述,此处不再赘述。
此外,上述图7、图8任一示例的图像识别的装置的实施方式中,各功能模块的逻辑划分仅是举例说明,实际应用中可以根据需要,例如出于相应硬件的配置要求或者软件的实现的便利考虑,将上述功能分配由不同的功能模块完成,即将所述图像识别的装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
根据在上述实施例的图像识别的装置,用户可设定的参考形状(几何形状),基于此图像识别的装置可自动识别输入的图像中是否有与所述参考形状匹配的目标几何形状,并在图像中将存在的目标几何形状标示出来;根据不同的参考形状,可识别出图像中不同的几何形状,更为灵活对图像中物体进行抽象和简化处理,有利于让学生(用户)对自然生活中的几何图形有直观的认知。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。
另外,本领域普通技术人员可以理解本发明的任意实施例指定的方法的全部或部分步骤是可以通过程序来指令相关的硬件(个人计算机、服务器、或者网络设备等)来完成。该程序可以存储于一计算机可读存储介质中。该程序在执行时,可执行上述任意实施例指定的方法的全部或部分步骤。前述存储介质可以包括任何可以存储程序代码的介质,例如只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
以上为对本发明所提供的图像识别的方法及装置的描述,对于本领域的一般技术人员,依据本发明实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。
Claims (10)
- 一种图像识别的方法,其特征在于,包括:获取待分析的图像;识别所述图像中包含的几何形状;比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状;对所述目标几何形状进行标示显示。
- 如权利要求1所述图像识别的方法,其特征在于,所述识别所述图像中包含的几何形状,包括:获取所述图像中各像素点的灰度值;确定出灰度值相差小于等于设定容差的相邻像素点,识别由所述相邻像素点构成的线条;识别由所述线条构成的封闭形状,将所述封闭形状确定为所述图像中包含的几何形状。
- 如权利要求1所述图像识别的方法,其特征在于,所述比对所述几何形状与设定的参考形状,确定出与所述参考特征匹配的目标几何形状,包括:提取所述参考形状的参考特征,提取所述几何形状的特征信息;计算所述特征信息、所述参考特征的近似度,若所述近似度大于等于设定阈值,则确定对应的几何形状为目标几何形状。
- 如权利要求3所述图像识别的方法,其特征在于,所述确定对应的几何形状为目标几何形状之后还包括:根据所述参考特征对所述目标几何形状进行修正,使修正后的目标几何形状具备所述参考形状对应的全部参考特征。
- 如权利要求3所述图像识别的方法,其特征在于,所述比对所述几何形状与设定的参考形状,确定出与所述参考特征匹配的目标几何形状之前包括:设置参考形状;所述参考形状包括:圆形、矩形、三角形或星形;所述参考特征包括:各点到中心点的距离信息、顶点数量、顶点夹角信息 和/或边长信息。
- 一种图像识别的装置,其特征在于,包括:图像获取模块,用于获取待分析的图像;第一识别模块,用于识别所述图像中包含的几何形状;第二识别模块,用于比对所述几何形状与设定的参考形状,确定出与所述参考形状匹配的目标几何形状;显示模块,用于对所述目标几何形状进行标示显示。
- 如权利要求6所述图像识别的装置,其特征在于,所述第一识别模块包括:像素点分析单元,用于获取所述图像中各像素点的灰度值;线条识别单元,用于确定出灰度值相差小于等于设定容差的相邻像素点,识别由所述相邻像素点构成的线条;以及,形状识别单元,用于识别由所述线条构成的封闭形状,将所述封闭形状确定为所述图像中包含的几何形状。
- 如权利要求6所述图像识别的装置,其特征在于,所述第二识别模块包括:特征提取单元,用于提取所述参考形状的参考特征,以及提取所述几何形状的特征信息;以及,特征比对单元,计算所述特征信息、所述参考特征的近似度,若所述近似度大于等于设定阈值,则确定对应的几何形状为目标几何形状。
- 如权利要求8所述图像识别的装置,其特征在于,还包括:修正模块,用于根据所述参考特征对所述目标几何形状进行修正,使修正后的目标几何形状具备所述参考形状对应的全部参考特征。
- 如权利要求8所述图像识别的装置,其特征在于,还包括:设置模块,用于设置参考形状;其中,所述参考形状包括:圆形、矩形、三角形或星形;所述参考特征包括:各点到中心点的距离信息、顶点数量、顶点夹角信息和/或边长信息。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510528250.7A CN105069454A (zh) | 2015-08-24 | 2015-08-24 | 图像识别的方法及装置 |
| CN201510528250.7 | 2015-08-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017032190A1 true WO2017032190A1 (zh) | 2017-03-02 |
Family
ID=54498815
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/090712 Ceased WO2017032190A1 (zh) | 2015-08-24 | 2016-07-20 | 图像识别的方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105069454A (zh) |
| WO (1) | WO2017032190A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113343324A (zh) * | 2021-06-09 | 2021-09-03 | 徐琳 | 液压式机械产品外形分析系统 |
| CN114037639A (zh) * | 2021-11-26 | 2022-02-11 | 天翼数字生活科技有限公司 | 一种几何图像识别方法、装置、设备及可读存储介质 |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105069454A (zh) * | 2015-08-24 | 2015-11-18 | 广州视睿电子科技有限公司 | 图像识别的方法及装置 |
| CN105763812B (zh) * | 2016-03-31 | 2019-02-19 | 北京小米移动软件有限公司 | 智能拍照方法及装置 |
| CN106874845B (zh) * | 2016-12-30 | 2021-03-26 | 东软集团股份有限公司 | 图像识别的方法和装置 |
| CN106778441A (zh) * | 2017-01-12 | 2017-05-31 | 西安科技大学 | 一种图形图像智能识别系统及其识别方法 |
| CN109255807B (zh) * | 2017-07-13 | 2023-02-03 | 腾讯科技(深圳)有限公司 | 一种图像信息处理方法及服务器、计算机存储介质 |
| CN109740614B (zh) * | 2018-11-20 | 2024-01-23 | 广东智媒云图科技股份有限公司 | 一种获取用于叶雕的叶片背景图的方法及装置 |
| CN110738712B (zh) * | 2019-10-24 | 2023-07-25 | 广东智媒云图科技股份有限公司 | 一种几何图案重构方法、装置、设备及存储介质 |
| CN112102435B (zh) * | 2020-09-24 | 2023-08-01 | 安徽文香科技股份有限公司 | 一种几何图形绘制的方法、装置、设备及存储介质 |
| CN115393200B (zh) * | 2021-05-24 | 2026-01-02 | 北京三快在线科技有限公司 | 图形修正方法、装置、电子设备及存储介质 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101110100A (zh) * | 2006-07-17 | 2008-01-23 | 松下电器产业株式会社 | 检测图像的几何形状的方法和装置 |
| CN101388077A (zh) * | 2007-09-11 | 2009-03-18 | 松下电器产业株式会社 | 目标形状检测方法及装置 |
| CN103295008A (zh) * | 2013-05-22 | 2013-09-11 | 华为终端有限公司 | 一种文字识别方法及用户终端 |
| US8712163B1 (en) * | 2012-12-14 | 2014-04-29 | EyeNode, LLC | Pill identification and counterfeit detection method |
| CN104680519A (zh) * | 2015-02-06 | 2015-06-03 | 四川长虹电器股份有限公司 | 基于轮廓和颜色的七巧板识别方法 |
| CN105069454A (zh) * | 2015-08-24 | 2015-11-18 | 广州视睿电子科技有限公司 | 图像识别的方法及装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102156869B (zh) * | 2006-07-17 | 2012-10-17 | 松下电器产业株式会社 | 检测由任意线段组合的形状的方法及装置 |
| CN101593270B (zh) * | 2008-05-29 | 2012-01-25 | 汉王科技股份有限公司 | 一种手绘形状识别的方法及装置 |
| CN104408427A (zh) * | 2014-12-01 | 2015-03-11 | 上海合合信息科技发展有限公司 | 图像四边形识别的方法和装置 |
-
2015
- 2015-08-24 CN CN201510528250.7A patent/CN105069454A/zh active Pending
-
2016
- 2016-07-20 WO PCT/CN2016/090712 patent/WO2017032190A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101110100A (zh) * | 2006-07-17 | 2008-01-23 | 松下电器产业株式会社 | 检测图像的几何形状的方法和装置 |
| CN101388077A (zh) * | 2007-09-11 | 2009-03-18 | 松下电器产业株式会社 | 目标形状检测方法及装置 |
| US8712163B1 (en) * | 2012-12-14 | 2014-04-29 | EyeNode, LLC | Pill identification and counterfeit detection method |
| CN103295008A (zh) * | 2013-05-22 | 2013-09-11 | 华为终端有限公司 | 一种文字识别方法及用户终端 |
| CN104680519A (zh) * | 2015-02-06 | 2015-06-03 | 四川长虹电器股份有限公司 | 基于轮廓和颜色的七巧板识别方法 |
| CN105069454A (zh) * | 2015-08-24 | 2015-11-18 | 广州视睿电子科技有限公司 | 图像识别的方法及装置 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113343324A (zh) * | 2021-06-09 | 2021-09-03 | 徐琳 | 液压式机械产品外形分析系统 |
| CN114037639A (zh) * | 2021-11-26 | 2022-02-11 | 天翼数字生活科技有限公司 | 一种几何图像识别方法、装置、设备及可读存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105069454A (zh) | 2015-11-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2017032190A1 (zh) | 图像识别的方法及装置 | |
| CN111667520B (zh) | 红外图像和可见光图像的配准方法、装置及可读存储介质 | |
| EP3916627A1 (en) | Living body detection method based on facial recognition, and electronic device and storage medium | |
| US10083366B2 (en) | Edge-based recognition, systems and methods | |
| US20200258206A1 (en) | Image fusion method and device, storage medium and terminal | |
| CN104331682B (zh) | 一种基于傅里叶描述子的建筑物自动识别方法 | |
| CN109543701A (zh) | 视觉显著性区域检测方法及装置 | |
| CN109741438B (zh) | 三维人脸建模方法、装置、设备及介质 | |
| CN105046213A (zh) | 一种增强现实的方法 | |
| CN107203742B (zh) | 一种基于显著特征点提取的手势识别方法及装置 | |
| CN112802081A (zh) | 一种深度检测方法、装置、电子设备及存储介质 | |
| JP2010205067A (ja) | 領域抽出装置、領域抽出方法及び領域抽出プログラム | |
| WO2021169257A1 (zh) | 人脸识别 | |
| CN112699857A (zh) | 基于人脸姿态的活体验证方法、装置及电子设备 | |
| CN103955889B (zh) | 一种基于增强现实技术的制图类作业评阅方法 | |
| CN109979013A (zh) | 三维人脸贴图方法及终端设备 | |
| CN111815782A (zh) | Ar场景内容的显示方法、装置、设备及计算机存储介质 | |
| CN115228092B (zh) | 游戏战力评估方法、装置以及计算机可读存储介质 | |
| JP2021114313A (ja) | 顔合成画像検出方法、顔合成画像検出装置、電子機器、記憶媒体及びコンピュータプログラム | |
| WO2017143852A1 (zh) | 一种图片处理方法、装置及电子设备 | |
| EP4303815A1 (en) | Image processing method, electronic device, storage medium, and program product | |
| CN108256520B (zh) | 一种识别硬币年份的方法、终端设备及计算机可读存储介质 | |
| Suryawibawa et al. | Herbs recognition based on Android using OpenCV | |
| CN105335685A (zh) | 图像识别方法和装置 | |
| CN104700384B (zh) | 基于增强现实技术的展示系统及展示方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16838450 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16838450 Country of ref document: EP Kind code of ref document: A1 |