CN108234868B - Intelligent shooting system and method based on case reasoning - Google Patents
Intelligent shooting system and method based on case reasoning Download PDFInfo
- Publication number
- CN108234868B CN108234868B CN201711435295.5A CN201711435295A CN108234868B CN 108234868 B CN108234868 B CN 108234868B CN 201711435295 A CN201711435295 A CN 201711435295A CN 108234868 B CN108234868 B CN 108234868B
- Authority
- CN
- China
- Prior art keywords
- case
- image
- target
- feature
- main body
- 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
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000013507 mapping Methods 0.000 claims abstract description 132
- 238000004458 analytical method Methods 0.000 claims abstract description 33
- 238000004364 calculation method Methods 0.000 claims description 37
- 238000003708 edge detection Methods 0.000 claims description 6
- 238000001914 filtration Methods 0.000 claims description 3
- 230000007547 defect Effects 0.000 abstract description 3
- 230000003139 buffering effect Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000003796 beauty Effects 0.000 description 1
- 125000004122 cyclic group Chemical class 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/62—Control of parameters via user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/46—Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
- G06V10/462—Salient features, e.g. scale invariant feature transforms [SIFT]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/63—Control of cameras or camera modules by using electronic viewfinders
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Signal Processing (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Human Computer Interaction (AREA)
- Studio Devices (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种基于案例推理的智能拍摄系统及方法,包括有图像获取模块、RAM模块、分析处理模块以及案例库模块;所述图像获取模块获取目标预览图并缓存在RAM模块中,然后所述分析处理模块调取目标预览图并进行目标主体特征编码以及目标映射关系编码,最后所述案例库模块计算目标主体特征编码与源案例主体特征编码的相似度以及计算目标映射关系编码与源案例映射关系编码的相似度,并选择相似度最高的拍摄角度用于智能拍摄构图。本发明利用分析处理模块中的算法智能得出目标图像的相关特征信息,基于案例推理,利用案例库模块中的算法智能为用户推荐最佳拍摄角度,解决了现有技术中手机拍摄系统无法指导用户进行拍摄角度调整的缺陷。
The invention discloses an intelligent shooting system and method based on case reasoning, including an image acquisition module, a RAM module, an analysis processing module and a case library module; the image acquisition module acquires a target preview image and caches it in the RAM module, and then The analysis and processing module retrieves the target preview image and performs target subject feature encoding and target mapping relationship encoding. Finally, the case library module calculates the similarity between the target subject feature encoding and the source case subject feature encoding, and calculates the target mapping relationship encoding and source code. The similarity of the case mapping relationship is encoded, and the shooting angle with the highest similarity is selected for intelligent shooting composition. The invention uses the algorithm intelligence in the analysis processing module to obtain the relevant feature information of the target image, and based on the case reasoning, uses the algorithm intelligence in the case library module to recommend the best shooting angle for the user, and solves the problem that the mobile phone shooting system in the prior art cannot guide the The defect of the user's adjustment of the shooting angle.
Description
技术领域technical field
本发明涉及手机拍摄技术领域,更具体地说,涉及一种基于案例推理的智能拍摄系统及方法。The present invention relates to the technical field of mobile phone shooting, and more particularly, to an intelligent shooting system and method based on case reasoning.
背景技术Background technique
手机拍摄已有人脸识别、对焦、场景选择、美颜等功能,而且像素也越来越高,目前手机拍摄系统还可以设置拍摄参考线以帮助用户拍摄。但是,要拍出高质量照片,需要用户懂专业摄影技术,而大部分用户并不懂这些技巧;目前手机拍摄系统都是根据预览照片来自动识别人物与背景的位置关系,但是,具体人物与背景的相对拍摄角度往往是由用户凭借自身经验来确定的,而用户因经验不足而造成拍摄出来的照片质量不高,因此,需要一款可以指导用户进行拍摄角度调整的系统以便利于用户拍摄出高质量照片。Mobile phone shooting has functions such as face recognition, focusing, scene selection, and beauty, and the pixel is getting higher and higher. At present, the mobile phone shooting system can also set shooting reference lines to help users shoot. However, in order to take high-quality photos, users need to understand professional photography techniques, and most users do not understand these skills; at present, the mobile phone shooting system automatically recognizes the positional relationship between the characters and the background based on the preview photos. The relative shooting angle of the background is often determined by the user based on his own experience, and the quality of the photos taken by the user is not high due to the lack of experience. Therefore, a system that can guide the user to adjust the shooting angle is needed to facilitate the user to shoot High quality photos.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明提供了一种基于案例推理的智能拍摄系统及方法,解决现有技术中手机拍摄系统无法指导用户进行拍摄角度调整的缺陷。In view of this, the present invention provides an intelligent shooting system and method based on case reasoning, which solves the defect in the prior art that the mobile phone shooting system cannot guide the user to adjust the shooting angle.
为实现上述目的,本发明提供了如下技术方案:For achieving the above object, the present invention provides the following technical solutions:
一种基于案例推理的智能拍摄系统,包括有图像获取模块、RAM模块、分析处理模块以及案例库模块;其中,所述图像获取模块,用于获取相机预览图;所述RAM模块,用于缓存预览图;所述分析处理模块,对预览图背景进行分析,确定图像主体和背景及它们的映射关系、主体的相关属性;所述的分析处理模块具体包括有焦点获取单元、特征分析单元、映射关系单元以及特征编码单元;所述焦点获取单元,获取焦点位置,确定图像主体;所述特征分析单元,获取图像主体特征;所述映射关系单元,确定图像背景和拍摄主体的映射关系;所述特征编码单元,对图像主体特征和映射关系进行编码。An intelligent shooting system based on case reasoning includes an image acquisition module, a RAM module, an analysis processing module and a case library module; wherein, the image acquisition module is used for acquiring a camera preview image; the RAM module is used for caching The preview image; the analysis and processing module analyzes the background of the preview image, determines the image subject and the background, their mapping relationship, and the relevant attributes of the subject; the analysis and processing module specifically includes a focus acquisition unit, a feature analysis unit, a mapping a relationship unit and a feature encoding unit; the focus acquisition unit, which acquires the focus position and determines the image subject; the feature analysis unit, which acquires the characteristics of the image subject; the mapping relationship unit, which determines the mapping relationship between the image background and the shooting subject; the The feature encoding unit encodes the main features of the image and the mapping relationship.
所述案例库模块,用于储存图像主体属性信息以及构图信息,还用于属性相似度匹配;所述案例库模块具体包括有编码获取单元、相似度匹配单元以及源案例储存单元;所述编码获取单元,用于获取特征编码和映射关系编码;所述相似度匹配单元,将目标案例主体特征与源案例主体特征进行相似度匹配计算,然后进行映射关系相似度匹配计算,最后输出拍摄角度,以指导用户调整拍摄角度;所述源案例储存单元,用于储存源案例,包括系统设定的源案例和用户增加的源案例;The case library module is used for storing image subject attribute information and composition information, and also for attribute similarity matching; the case library module specifically includes a coding acquisition unit, a similarity matching unit and a source case storage unit; the coding The acquisition unit is used to obtain the feature code and the mapping relationship code; the similarity matching unit performs similarity matching calculation on the subject feature of the target case and the subject feature of the source case, then performs the similarity matching calculation on the mapping relationship, and finally outputs the shooting angle, To guide the user to adjust the shooting angle; the source case storage unit is used to store the source case, including the source case set by the system and the source case added by the user;
所述图像获取模块获取预览照片,并将预览照片存储在所述RAM模块中;然后通过所述焦点获取单元调取存储在所述RAM模块中的预览照片并确定图像主体;然后所述特征分析单元调取所述焦点获取单元中的图像主体信息并根据图像主体确定图像主体特征;然后所述映射关系单元调取所述特征分析单元的图像主体特征信息确定图像背景和图像主体之间的映射关系;然后所述特征编码单元一方面调取所述特征分析单元的图像主体特征信息进行编码,另一方面调取所述映射关系单元的图像背景和图像主体之间的映射关系信息进行编码;然后所述编码获取单元调取所述特征编码单元中的目标特征编码和目标映射关系编码并将特征编码和映射关系编码传输到所述相似度匹配单元中;然后所述相似度匹配单元调取源案例储存单元中储存的源案例主体特征编码以及源案例映射关系编码,将目标案例主体特征编码与源案例主体特征编码进行主体特征相似度匹配计算,并对目标案例映射关系编码与源案例映射关系编码进行映射关系相似度匹配计算,根据主体特征相似度匹配计算结果和映射关系相似度匹配计算结果调取输出所述源案例储存单元中最相近的源案例主体特征信息和映射关系信息,并将源案例主体特征信息替换整合到源案例映射关系信息中,从而得到最相近的源案例拍摄角度,并将新整合的最相近的源案例调取输出,以指导用户调整拍摄角度;最后,所述源案例储存单元调取所述编码获取单元中的目标特征编码和目标映射关系编码,并将保存目标特征编码和目标映射关系编码,以作为新增源案例的特征编码和映射关系编码。The image acquisition module acquires a preview photo, and stores the preview photo in the RAM module; then the focus acquisition unit retrieves the preview photo stored in the RAM module and determines the main body of the image; then the feature analysis The unit retrieves the image subject information in the focus acquisition unit and determines the image subject feature according to the image subject; then the mapping relationship unit retrieves the image subject feature information of the feature analysis unit to determine the mapping between the image background and the image subject Then the feature encoding unit calls the image subject feature information of the feature analysis unit on the one hand for encoding, and on the other hand calls the mapping relationship information between the image background of the mapping relationship unit and the image subject for encoding; Then the code acquisition unit calls the target feature code and the target mapping relationship code in the feature encoding unit and transmits the feature code and the mapping relationship code to the similarity matching unit; then the similarity matching unit calls The source case subject feature code and the source case mapping relationship code stored in the source case storage unit, the target case subject feature code and the source case subject feature code are subjected to subject feature similarity matching calculation, and the target case mapping relationship code is mapped to the source case. The relationship coding performs mapping relationship similarity matching calculation, and retrieves and outputs the most similar source case subject feature information and mapping relationship information in the source case storage unit according to the subject feature similarity matching calculation result and the mapping relationship similarity matching calculation result, and The main feature information of the source case is replaced and integrated into the mapping relationship information of the source case, so as to obtain the closest shooting angle of the source case, and the newly integrated closest source case is retrieved and output to guide the user to adjust the shooting angle. The source case storage unit retrieves the target feature code and the target mapping relationship code in the code acquisition unit, and saves the target feature code and the target mapping relationship code as the feature code and the mapping relationship code of the newly added source case.
优选地,该焦点获取单元所用算法为g(i,j)=sqrt((f(i,j)-f(i+1,j))^2+(f(i+1,j)-f(i,j+1))^2),其中,f(i-1,j-1)、f(i-1,j)、f(i-1,j+1)、f(i,j-1)、f(i,j)、f(i,j+1)、f(i+1,j-1)、f(i+1,j)、f(i+1,j+1)均为待处理图像像素,g(i,j)为处理后的像素。Preferably, the algorithm used by the focus acquisition unit is g(i,j)=sqrt((f(i,j)-f(i+1,j))^2+(f(i+1,j)-f (i,j+1))^2), where f(i-1,j-1), f(i-1,j), f(i-1,j+1), f(i,j -1), f(i,j), f(i,j+1), f(i+1,j-1), f(i+1,j), f(i+1,j+1) All are image pixels to be processed, and g(i, j) is the processed pixel.
优选地,该相似度匹配单元的算法为其中,X为目标主体,Y为源案例主体,目标主体X和源案例主体Y均包含了N维特征,即X=(x1,x2,x3,……,xn),Y=(y1,y2,y3,……,yn),算法中的余弦值越小则相似度越高。Preferably, the algorithm of the similarity matching unit is Among them, X is the target subject, Y is the source case subject, and both the target subject X and the source case subject Y contain N-dimensional features, that is, X=(x1,x2,x3,...,xn), Y=(y1,y2 ,y3,...,yn), the smaller the cosine value in the algorithm, the higher the similarity.
一种基于案例推理的智能拍摄方法,其特征在于:包括有以下步骤:步骤1,获取相机预览图,用户执行对焦操作后,截取并缓存此预览图;步骤2,对预览图背景进行分析,确定图像主体和背景及它们的映射关系、主体的属性特征并进行编码;步骤3,提示用户是否需要源案例:若用户需要源案例,则进入步骤4;若用户不需要源案例,点击界面中显示的取消案例按钮,自行完成构图,进入步骤8;步骤4,搜索案例库,与目标案例进行匹配,分别匹配输出最佳源案例主体特征信息以及最佳源案例主体与背景之间的映射关系信息;步骤5,将最佳源案例主体特征信息替换整合到最佳源案例主体与背景之间的映射关系信息中形成新的最佳的源案例;步骤6,在拍摄界面上显示新的最佳的源案例主体轮廓;步骤7,根据源案例主体轮廓,用户手动调整角度尽可能使得目标主体轮廓与源案例主体轮廓重合;步骤8,触发拍摄按钮完成拍摄,储存图像并提示用户是否储存此主体属性特征以及主体和背景映射关系作为源案例。An intelligent shooting method based on case reasoning is characterized in that: it includes the following steps: step 1, obtaining a camera preview image, after a user performs a focusing operation, intercepting and buffering the preview image; step 2, analyzing the background of the preview image, Determine the image subject and background, their mapping relationship, the attributes of the subject, and encode them; Step 3, prompt the user whether the source case is needed: if the user needs the source case, go to step 4; if the user does not need the source case, click in the interface Display the cancel case button, complete the composition by yourself, and go to step 8; step 4, search the case library, match with the target case, and output the best source case subject feature information and the mapping relationship between the best source case subject and the background respectively. information; step 5, replace and integrate the feature information of the best source case subject into the mapping relationship information between the best source case subject and the background to form a new best source case; step 6, display the new best source case on the shooting interface The best source case body contour; Step 7, according to the source case body contour, the user manually adjusts the angle as much as possible to make the target body contour coincide with the source case body contour; Step 8, trigger the shooting button to complete the shooting, save the image and prompt the user whether to save this Subject attribute features and subject and background mapping relationships are used as source cases.
优选地,该步骤2中包括有以下执行过程:a.通过对焦操作,确定目标图像主体基本位置,使用边缘检测法确定目标主体轮廓;b.使用SIFT算法提取目标图像主体特征属性;c.确定目标图像背景和目标拍摄主体的映射关系;d.对目标主体特征和目标映射关系进行编码,以便进行案例相似度计算。Preferably, this step 2 includes the following execution process: a. Determine the basic position of the target image subject through the focusing operation, and use the edge detection method to determine the outline of the target subject; b. Use the SIFT algorithm to extract the feature attributes of the target image subject; c. Determine The mapping relationship between the target image background and the target shooting subject; d. Encoding the target subject feature and the target mapping relationship for case similarity calculation.
优选地,该边缘检测法的算法公式为g(i,j)=sqrt((f(i,j)-f(i+1,j))^2+(f(i+1,j)-f(i,j+1))^2),其中,f(i-1,j-1)、f(i-1,j)、f(i-1,j+1)、f(i,j-1)、f(i,j)、f(i,j+1)、f(i+1,j-1)、f(i+1,j)、f(i+1,j+1)均为待处理图像像素,g(i,j)为处理后的像素。Preferably, the algorithm formula of the edge detection method is g(i,j)=sqrt((f(i,j)-f(i+1,j))^2+(f(i+1,j)- f(i,j+1))^2), where f(i-1,j-1), f(i-1,j), f(i-1,j+1), f(i, j-1), f(i,j), f(i,j+1), f(i+1,j-1), f(i+1,j), f(i+1,j+1 ) are the image pixels to be processed, and g(i, j) are the processed pixels.
优选地,该SIFT算法步骤包括有:a.先构建尺度空间,检测极值点,获得尺度不变性;b.然后进行极值特征点过滤并进行精确定位;c.然后为极值特征点分配方向值;d.最后生成特征描述子。Preferably, the steps of the SIFT algorithm include: a. first constructing a scale space, detecting extreme points, and obtaining scale invariance; b. then filtering extreme value feature points and performing precise positioning; c. then assigning extreme value feature points Direction value; d. Finally generate a feature descriptor.
优选地,该步骤4中包括有以下执行过程:a.获取特征编码和映射关系编码;b.计算目标案例主体特征编码与源案例主体特征编码的相似度,根据设定阈值,预存相似度高的多个源案例;c.对特征相似度高的源案例进行映射关系相似度计算,输出映射关系相似度最高的所对应的拍摄角度。Preferably, this step 4 includes the following execution processes: a. obtaining the feature code and the mapping relationship code; b. calculating the similarity between the target case subject feature code and the source case subject feature code, according to the set threshold, the pre-stored similarity is high c. Calculate the similarity of the mapping relationship for the source cases with high feature similarity, and output the shooting angle corresponding to the highest similarity of the mapping relationship.
从上述的技术方案可以看出,一方面,本发明利用焦点获取单元调取预览目标图像信息,然后利用特征分析单元分析过滤出目标案例主体特征信息,利用映射关系单元分析过滤目标主体与背景之间的映射关系信息,然后利用特征编码单元对目标案例主体特征信息和映射关系信息进行编码,便于进行系统记录识别,然后利用案例库模块中的相似度匹配单元调取源案例储存单元中的存储信息,将目标案例主体特征编码与源案例主体特征编码进行主体特征相似度匹配计算,并对目标案例映射关系编码与源案例映射关系编码进行映射关系相似度匹配计算,根据主体特征相似度匹配计算结果和映射关系相似度匹配计算结果调取输出所述源案例储存单元中最相近的源案例主体特征信息和映射关系信息,并将源案例主体特征信息替换整合到源案例映射关系信息中,从而得到最相近的源案例拍摄角度,并将源案例中的拍摄角度输出到界面上用于指导用户及时调整拍摄角度,使得目标主体轮廓与源案例主体轮廓基本重合,从而达到智能指导用户调整拍摄角度的目的;另一方面,本发明利用特征分析单元分析过滤出目标案例主体特征信息,利用映射关系单元分析过滤目标主体与背景之间的映射关系信息,使得目标图像中的特征信息被过滤出主体特征以及主体与背景映射关系特征,基于案例推理,通过案例库模块分别进行主体特征相似度匹配计算和主体与背景映射关系特征相似度匹配计算,克服了整体图像进行特征相似度匹配计算而造成的匹配准确率低,匹配误差大的缺陷,从而提高了目标案例与源案例的匹配精确度。It can be seen from the above technical solutions that, on the one hand, the present invention uses the focus acquisition unit to retrieve the preview target image information, then uses the feature analysis unit to analyze and filter out the feature information of the target case subject, and uses the mapping relationship unit to analyze and filter the relationship between the target subject and the background. Then use the feature coding unit to encode the target case subject feature information and mapping relationship information, which is convenient for system record identification, and then use the similarity matching unit in the case library module to call the source case storage unit. information, perform subject feature similarity matching calculation between the target case subject feature coding and the source case subject feature coding, and perform the mapping relationship similarity matching calculation between the target case mapping relationship coding and the source case mapping relationship coding, and calculate based on the subject feature similarity matching calculation. The result and the mapping relationship similarity matching calculation result retrieve and output the most similar source case subject feature information and mapping relationship information in the source case storage unit, and replace and integrate the source case subject feature information into the source case mapping relationship information, thereby Obtain the most similar shooting angle of the source case, and output the shooting angle in the source case to the interface to guide the user to adjust the shooting angle in time, so that the contour of the target subject and the subject contour of the source case basically coincide, so as to intelligently guide the user to adjust the shooting angle On the other hand, the present invention uses the feature analysis unit to analyze and filter out the feature information of the target case subject, and uses the mapping relationship unit to analyze and filter the mapping relationship information between the target subject and the background, so that the feature information in the target image is filtered out of the subject. Based on case reasoning, the main feature similarity matching calculation and the subject and background mapping relationship feature similarity matching calculation are carried out respectively through the case library module, which overcomes the problem caused by the feature similarity matching calculation of the overall image. The matching accuracy is low and the matching error is large, thereby improving the matching accuracy between the target case and the source case.
附图说明Description of drawings
图1为本发明实施例提供的一种基于案例推理的智能拍摄系统及方法的系统示意图。FIG. 1 is a system schematic diagram of an intelligent shooting system and method based on case reasoning provided by an embodiment of the present invention.
图2为本发明实施例提供的一种基于案例推理的智能拍摄系统及方法的方法示意图。FIG. 2 is a schematic diagram of a case-based reasoning-based intelligent shooting system and method according to an embodiment of the present invention.
附图标识说明:Description of drawings:
10-图像获取模块;20-RAM模块;30-分析处理模块;40-案例库模块;31-焦点获取单元;32-特征分析单元;33-映射关系单元;34-特征编码单元;41-特征获取单元;42-相似度匹配单元;43-源案例储存单元。10-image acquisition module; 20-RAM module; 30-analysis processing module; 40-case library module; 31-focus acquisition unit; 32-feature analysis unit; 33-mapping relationship unit; 34-feature encoding unit; 41-feature acquisition unit; 42-similarity matching unit; 43-source case storage unit.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所述的附图作简单地介绍,显而易见,下面的描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only For some embodiments of the present invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
具体实施方式Detailed ways
本发明实施例提供了一种基于案例推理的智能拍摄系统及方法。Embodiments of the present invention provide an intelligent shooting system and method based on case reasoning.
如图1-2所示,一种基于案例推理的智能拍摄系统,包括有图像获取模块10、RAM模块20、分析处理模块30以及案例库模块40;其中,所述图像获取模块10,用于获取相机预览图;所述RAM模块20,用于缓存预览图;所述分析处理模块30,对预览图背景进行分析,确定图像主体和背景及它们的映射关系、主体的相关属性;所述的分析处理模块30具体包括有焦点获取单元31、特征分析单元32、映射关系单元33以及特征编码单元34;所述焦点获取单元31,获取焦点位置,确定图像主体;所述特征分析单元32,获取图像主体特征;所述映射关系单元33,确定图像背景和拍摄主体的映射关系;所述特征编码单元34,对图像主体特征和映射关系进行编码。所述案例库模块40,用于储存图像主体属性信息以及构图信息,还用于属性相似度匹配;所述案例库模块40具体包括有编码获取单元、相似度匹配单元42以及源案例储存单元43;所述编码获取单元,用于获取特征编码和映射关系编码;所述相似度匹配单元42,将目标案例主体特征与源案例主体特征进行相似度匹配计算,然后进行映射关系相似度匹配计算,最后输出拍摄角度,以指导用户调整拍摄角度;所述源案例储存单元43,用于储存源案例,包括系统设定的源案例和用户增加的源案例;在本发明实施例中,所述图像获取模块10为现有集成摄像组件,其目的是为了获取目标图像,用户可根据实际需求选择不同像素的图像获取模块10,主要能保证顺利获取目标图像即可;同理,所述RAM模块20的目的是缓存目标图像信息,因此,所述RAM模块20可以包括有现有技术中的内存条,也可以包括其他储存电子装置,主要能实现目标图像的缓存目的即可。并且,所述源案例储存单元43可以包括有数据库或云平台,也可以是其他可移动储存设备,其目的是保存源案例文件信息。As shown in Figures 1-2, an intelligent shooting system based on case reasoning includes an image acquisition module 10, a
本发明的整体工作原理是:先通过图像获取模块10获取目标图像,然后通过分析处理模块30获取目标图像的目标图像主体特征编码以及目标图像主体与背景之间的映射关系编码;然后基于案例推理,通过相似度匹配单元42一方面调取目标图像主体特征编码信息以及源案例储存单元43中的源案例图像主体特征编码信息并进行相似度匹配,从源案例中找出最相似的源案例图像主体特征编码信息并显示出来;另一方面调取目标图像主体与背景之间的映射关系编码信息以及源案例主体与背景之间的映射关系编码信息并进行相似度匹配,从源案例中找出最相似的源案例主体与背景之间的映射关系编码信息并显示出来,最后指导用户调整拍摄角度,从而拍摄出高质量照片。The overall working principle of the present invention is: first obtain the target image through the image acquisition module 10, and then obtain the target image subject feature encoding of the target image and the mapping relationship encoding between the target image subject and the background through the analysis processing module 30; , through the similarity matching unit 42, on the one hand, the target image subject feature encoding information and the source case image subject feature encoding information in the source case storage unit 43 are retrieved and the similarity matching is performed, and the most similar source case image is found from the source case. On the other hand, the coding information of the mapping relationship between the subject of the target image and the background and the coding information of the mapping relationship between the subject and the background of the source case are retrieved, and the similarity matching is performed to find out from the source case. The mapping relationship between the most similar source case subject and the background encodes the information and displays it, and finally guides the user to adjust the shooting angle to take high-quality photos.
相应地,该焦点获取单元31所用算法为g(i,j)=sqrt((f(i,j)-f(i+1,j))^2+(f(i+1,j)-f(i,j+1))^2),其中,f(i-1,j-1)、f(i-1,j)、f(i-1,j+1)、f(i,j-1)、f(i,j)、f(i,j+1)、f(i+1,j-1)、f(i+1,j)、f(i+1,j+1)均为待处理图像像素,g(i,j)为处理后的像素。在焦点获取单元31的算法中,常使用N*N的像素块,例如3*3或者4*4。3*3的像素块如下,f(i-1,j-1)、f(i-1,j)、f(i-1,j+1)、f(i,j-1)、f(i,j)、f(i,j+1)、f(i+1,j-1)f(i+1,j)以及f(i+1,j+1),利用各个像素块的像素信息取其相对阈值,由于图像主体轮廓与图像背景之间的轮廓处往往存在较大差值,通过阵列扫描方式扫描出图像中的各个像素点,并与相对阈值进行比较,若两者的存在较大,则判断此处为轮廓点,通过这种循环阵列扫描的方式,可以快速得到目标图像轮廓信息并提取出目标图像轮廓,此处的目的在于一方面提取目标图像的主体轮廓特征信息,另一方面还可以提取出目标图像中的背景像素点信息,从而可以达到目标图像的主体轮廓与背景之间的映射关系特征信息。Correspondingly, the algorithm used by the
在本发明实施例中,该相似度匹配单元42的算法为其中,X为目标主体,Y为源案例主体,目标主体X和源案例主体Y均包含了N维特征,即X=(x1,x2,x3,……,xn),Y=(y1,y2,y3,……,yn),算法中的余弦值越小则相似度越高。由于在焦点获取单元31中已提取出目标图像的主体轮廓特征信息以及目标图像的主体轮廓与背景之间的映射关系特征信息,通过整合目标图像的主体轮廓特征信息,利用相似度匹配单元42中的算法,对目标图像主体轮廓特征信息与源案例主体轮廓特征信息进行一一相似度匹配,从源案例储存单元43中找出相似度最高的源案例主体轮廓;然后整合目标图像的主体轮廓与背景之间的映射关系特征信息,利用相似度匹配单元42中的算法,对目标图像映射关系息与源案例映射关系特征信息进行一一相似度匹配,从源案例储存单元43中找出相似度最高的源案例映射关系信息,然后相似度匹配单元42再将匹配出来的源案例主体轮廓整合到源案例中映射关系最强的背景源图像中并将整合后的源图像作为指导图像,用于指导用户调整拍摄角度。In this embodiment of the present invention, the algorithm of the similarity matching unit 42 is: Among them, X is the target subject, Y is the source case subject, and both the target subject X and the source case subject Y contain N-dimensional features, that is, X=(x1,x2,x3,...,xn), Y=(y1,y2 ,y3,...,yn), the smaller the cosine value in the algorithm, the higher the similarity. Since the subject contour feature information of the target image and the mapping relationship feature information between the subject contour and the background of the target image have been extracted in the
本发明实施例的工作过程为:所述图像获取模块10获取预览照片,并将预览照片存储在所述RAM模块20中;然后通过所述焦点获取单元31调取存储在所述RAM模块20中的预览照片并确定图像主体;然后所述特征分析单元32调取所述焦点获取单元31中的图像主体信息并根据图像主体确定图像主体特征;然后所述映射关系单元33调取所述特征分析单元32的图像主体特征信息确定图像背景和图像主体之间的映射关系;然后所述特征编码单元34一方面调取所述特征分析单元32的图像主体特征信息进行编码,另一方面调取所述映射关系单元33的图像背景和图像主体之间的映射关系信息进行编码;然后所述编码获取单元调取所述特征编码单元34中的目标特征编码和目标映射关系编码并将特征编码和映射关系编码传输到所述相似度匹配单元42中;然后所述相似度匹配单元42调取源案例储存单元43中储存的源案例主体特征编码以及源案例映射关系编码,将目标案例主体特征编码与源案例主体特征编码进行主体特征相似度匹配计算,并对目标案例映射关系编码与源案例映射关系编码进行映射关系相似度匹配计算,根据主体特征相似度匹配计算结果和映射关系相似度匹配计算结果调取输出所述源案例储存单元43中最相近的源案例拍摄角度,以指导用户调整拍摄角度;最后,所述源案例储存单元43调取所述编码获取单元中的目标特征编码和目标映射关系编码,并将保存目标特征编码和目标映射关系编码,以作为新增源案例的特征编码和映射关系编码。The working process of the embodiment of the present invention is as follows: the image acquisition module 10 acquires a preview photo, and stores the preview photo in the
一种基于案例推理的智能拍摄方法,其特征在于:包括有以下步骤:步骤1,获取相机预览图,用户执行对焦操作后,截取并缓存此预览图;步骤2,对预览图背景进行分析,确定图像主体和背景及它们的映射关系、主体的属性特征并进行编码;步骤3,提示用户是否需要源案例:若用户需要源案例,则进入步骤4;若用户不需要源案例,点击界面中显示的取消案例按钮,自行完成构图,进入步骤8;步骤4,搜索案例库,与目标案例进行匹配,分别匹配输出最佳源案例主体特征信息以及最佳源案例主体与背景之间的映射关系信息;步骤5,将最佳源案例主体特征信息替换整合到最佳源案例主体与背景之间的映射关系信息中形成新的最佳的源案例;步骤6,在拍摄界面上显示新的最佳的源案例主体轮廓;步骤7,根据源案例主体轮廓,用户手动调整角度尽可能使得目标主体轮廓与源案例主体轮廓重合;步骤8,触发拍摄按钮完成拍摄,储存图像并提示用户是否储存此主体属性特征以及主体和背景映射关系作为源案例。An intelligent shooting method based on case reasoning is characterized in that: it includes the following steps: step 1, obtaining a camera preview image, after a user performs a focusing operation, intercepting and buffering the preview image; step 2, analyzing the background of the preview image, Determine the image subject and background, their mapping relationship, the attributes of the subject, and encode them; Step 3, prompt the user whether the source case is needed: if the user needs the source case, go to step 4; if the user does not need the source case, click in the interface Display the cancel case button, complete the composition by yourself, and go to step 8; step 4, search the case library, match with the target case, and output the best source case subject feature information and the mapping relationship between the best source case subject and the background respectively. information; step 5, replace and integrate the feature information of the best source case subject into the mapping relationship information between the best source case subject and the background to form a new best source case; step 6, display the new best source case on the shooting interface The best source case body contour; Step 7, according to the source case body contour, the user manually adjusts the angle as much as possible to make the target body contour coincide with the source case body contour; Step 8, trigger the shooting button to complete the shooting, save the image and prompt the user whether to save this Subject attribute features and subject and background mapping relationships are used as source cases.
具体地,该步骤2中包括有以下执行过程:a.通过对焦操作,确定目标图像主体基本位置,使用边缘检测法确定目标主体轮廓;b.使用SIFT算法提取目标图像主体特征属性;c.确定目标图像背景和目标拍摄主体的映射关系;d.对目标主体特征和目标映射关系进行编码,以便进行案例相似度计算;该边缘检测法的算法公式为g(i,j)=sqrt((f(i,j)-f(i+1,j))^2+(f(i+1,j)-f(i,j+1))^2),其中,f(i-1,j-1)、f(i-1,j)、f(i-1,j+1)、f(i,j-1)、f(i,j)、f(i,j+1)、f(i+1,j-1)、f(i+1,j)、f(i+1,j+1)均为待处理图像像素,g(i,j)为处理后的像素;该SIFT算法步骤包括有:a.先构建尺度空间,检测极值点,获得尺度不变性;b.然后进行极值特征点过滤并进行精确定位;c.然后为极值特征点分配方向值;d.最后生成特征描述子;该步骤4中包括有以下执行过程:a.获取特征编码和映射关系编码;b.计算目标案例主体特征编码与源案例主体特征编码的相似度,根据设定阈值,预存相似度高的多个源案例;c.对特征相似度高的源案例进行映射关系相似度计算,输出映射关系相似度最高的所对应的拍摄角度。Specifically, this step 2 includes the following execution process: a. Determine the basic position of the target image subject through the focusing operation, and use the edge detection method to determine the outline of the target subject; b. Use the SIFT algorithm to extract the feature attributes of the target image subject; c. Determine The mapping relationship between the target image background and the target shooting subject; d. Encode the target subject feature and the target mapping relationship for case similarity calculation; the algorithm formula of the edge detection method is g(i,j)=sqrt((f (i,j)-f(i+1,j))^2+(f(i+1,j)-f(i,j+1))^2), where f(i-1,j -1), f(i-1,j), f(i-1,j+1), f(i,j-1), f(i,j), f(i,j+1), f (i+1,j-1), f(i+1,j), f(i+1,j+1) are all image pixels to be processed, and g(i,j) is the processed pixel; the SIFT The algorithm steps include: a. firstly constructing a scale space, detecting extreme point points, and obtaining scale invariance; b. then filtering extreme value feature points and performing precise positioning; c. then assigning direction values to extreme value feature points; d. Finally, a feature descriptor is generated; this step 4 includes the following execution processes: a. Obtaining the feature code and the mapping relationship code; b. Calculating the similarity between the target case subject feature code and the source case subject feature code, and pre-stored according to the set threshold Multiple source cases with high similarity; c. Perform mapping relationship similarity calculation on source cases with high feature similarity, and output the shooting angle corresponding to the highest mapping relationship similarity.
从上述的技术方案可以看出,一方面,本发明利用焦点获取单元31调取预览目标图像信息,然后利用特征分析单元32分析过滤出目标案例主体特征信息,利用映射关系单元33分析过滤目标主体与背景之间的映射关系信息,然后利用特征编码单元34对目标案例主体特征信息和映射关系信息进行编码,便于进行系统记录识别,然后利用案例库模块40中的相似度匹配单元42调取源案例储存单元43中的存储信息,将目标案例主体特征编码与源案例主体特征编码进行主体特征相似度匹配计算,并对目标案例映射关系编码与源案例映射关系编码进行映射关系相似度匹配计算,根据主体特征相似度匹配计算结果和映射关系相似度匹配计算结果调取输出所述源案例储存单元43中最相近的源案例拍摄角度,并将源案例中的拍摄角度输出到界面上用于指导用户及时调整拍摄角度,使得目标主体轮廓与源案例主体轮廓基本重合,从而达到智能指导用户调整拍摄角度的目的;另一方面,本发明利用特征分析单元32分析过滤出目标案例主体特征信息,利用映射关系单元33分析过滤目标主体与背景之间的映射关系信息,使得目标图像中的特征信息被过滤出主体特征以及主体与背景映射关系特征,通过案例库模块40分别进行主体特征相似度匹配计算和主体与背景映射关系特征相似度匹配计算,克服了整体图像进行特征相似度匹配计算而造成的匹配准确率低,匹配误差大的缺陷,从而提高了目标案例与源案例的匹配精确度。因此,本发明的优点在于:1、通过提取预览图像的主体特征,分析主体特征与背景之间的映射关系,使匹配精度更高;2、基于案例推理原理,匹配主体特征相似性和映射关系相似性,进而提供最优匹配源案例;3、基于用户拍摄位置,系统给用户提供最优的拍摄角度,不需用户大范围调整拍摄角度与位置;4、系统同屏显示源案例主体轮廓线,用户使主体重合便可完成拍摄角度的调整,同时显示重合度(及相似度),使得拍摄角度的调整更方便快捷;5、用户可新增源案例,使源案例资源更加完善,使得主体适应更多的拍摄调整角度。As can be seen from the above technical solutions, on the one hand, the present invention uses the focus acquisition unit 31 to retrieve the preview target image information, then uses the feature analysis unit 32 to analyze and filter out the feature information of the target case subject, and uses the mapping relationship unit 33 to analyze and filter the target subject and the mapping relationship information between the background, and then use the feature encoding unit 34 to encode the target case subject feature information and the mapping relationship information, so as to facilitate the identification of system records, and then use the similarity matching unit 42 in the case library module 40 to retrieve the source For the storage information in the case storage unit 43, the subject feature similarity matching calculation is performed on the target case subject feature coding and the source case subject feature coding, and the mapping relationship similarity matching calculation is performed on the target case mapping relationship coding and the source case mapping relationship coding, The closest source case shooting angle in the source case storage unit 43 is retrieved and output according to the subject feature similarity matching calculation result and the mapping relationship similarity matching calculation result, and the shooting angle in the source case is output to the interface for guidance The user adjusts the shooting angle in time, so that the contour of the target subject and the subject contour of the source case basically overlap, so as to achieve the purpose of intelligently guiding the user to adjust the shooting angle; The mapping relationship unit 33 analyzes and filters the mapping relationship information between the target subject and the background, so that the feature information in the target image is filtered out the subject feature and the subject and the background mapping relationship feature, and the case library module 40 respectively performs the subject feature similarity matching calculation. The feature similarity matching calculation of the mapping relationship between the subject and the background overcomes the defects of low matching accuracy and large matching error caused by the feature similarity matching calculation of the overall image, thereby improving the matching accuracy between the target case and the source case. Therefore, the advantages of the present invention are: 1. By extracting the subject feature of the preview image, the mapping relationship between the subject feature and the background is analyzed, so that the matching accuracy is higher; 2. Based on the principle of case reasoning, the similarity and mapping relationship of the subject feature are matched 3. Based on the user's shooting position, the system provides the user with the optimal shooting angle, without requiring the user to adjust the shooting angle and position in a large range; 4. The system displays the main outline of the source case on the same screen , the user can complete the adjustment of the shooting angle by making the subject overlap, and at the same time display the degree of coincidence (and similarity), making the adjustment of the shooting angle more convenient and quick; 5. The user can add a source case to make the source case resources more complete, making the subject Adapt to more shooting adjustment angles.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分相互参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其它实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables those skilled in the art to practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711435295.5A CN108234868B (en) | 2017-12-26 | 2017-12-26 | Intelligent shooting system and method based on case reasoning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711435295.5A CN108234868B (en) | 2017-12-26 | 2017-12-26 | Intelligent shooting system and method based on case reasoning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108234868A CN108234868A (en) | 2018-06-29 |
CN108234868B true CN108234868B (en) | 2020-10-16 |
Family
ID=62648956
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711435295.5A Active CN108234868B (en) | 2017-12-26 | 2017-12-26 | Intelligent shooting system and method based on case reasoning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108234868B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111898416A (en) * | 2020-06-17 | 2020-11-06 | 绍兴埃瓦科技有限公司 | Video stream processing method and device, computer equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101174316A (en) * | 2006-11-02 | 2008-05-07 | 中国移动通信集团公司 | A device and method for case reasoning based on case tree |
CN105279751A (en) * | 2014-07-17 | 2016-01-27 | 腾讯科技(深圳)有限公司 | Picture processing method and device |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101866352B (en) * | 2010-05-28 | 2012-05-30 | 广东工业大学 | A Design Patent Retrieval Method Based on Image Content Analysis |
JP5013282B2 (en) * | 2010-08-31 | 2012-08-29 | カシオ計算機株式会社 | Imaging apparatus and program |
CN103077529B (en) * | 2013-02-27 | 2016-04-06 | 电子科技大学 | Based on the plant leaf blade characteristic analysis system of image scanning |
CN103632626B (en) * | 2013-12-03 | 2016-06-29 | 四川省计算机研究院 | A kind of intelligent guide implementation method based on mobile Internet, device and mobile client |
CN107025437A (en) * | 2017-03-16 | 2017-08-08 | 南京邮电大学 | Intelligent photographing method and device based on intelligent composition and micro- Expression analysis |
-
2017
- 2017-12-26 CN CN201711435295.5A patent/CN108234868B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101174316A (en) * | 2006-11-02 | 2008-05-07 | 中国移动通信集团公司 | A device and method for case reasoning based on case tree |
CN105279751A (en) * | 2014-07-17 | 2016-01-27 | 腾讯科技(深圳)有限公司 | Picture processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN108234868A (en) | 2018-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10979624B2 (en) | Methods and devices for establishing photographing template database and providing photographing recommendation information | |
JP5159515B2 (en) | Image processing apparatus and control method thereof | |
US10146992B2 (en) | Image processing apparatus, image processing method, and storage medium that recognize an image based on a designated object type | |
WO2024131693A1 (en) | Bird identification method, device and system | |
JP6456031B2 (en) | Image recognition apparatus, image recognition method, and program | |
CN108810406B (en) | Portrait light effect processing method, device, terminal and computer readable storage medium | |
US10291838B2 (en) | Focusing point determining method and apparatus | |
JP6098318B2 (en) | Image processing apparatus, image processing method, image processing program, and recording medium | |
WO2021136386A1 (en) | Data processing method, terminal, and server | |
US10594930B2 (en) | Image enhancement and repair using sample data from other images | |
CN107787463A (en) | The capture of optimization focusing storehouse | |
JP2016123044A (en) | Subject tracking device, and control method and program therefor | |
CN112529846A (en) | Image processing method and device, electronic equipment and storage medium | |
CN111953907B (en) | Composition method and device | |
JP2022039719A (en) | Position and posture estimation device, position and posture estimation method, and program | |
CN108234868B (en) | Intelligent shooting system and method based on case reasoning | |
CN112073640B (en) | Panoramic information acquisition pose acquisition method, device and system | |
JP5791361B2 (en) | PATTERN IDENTIFICATION DEVICE, PATTERN IDENTIFICATION METHOD, AND PROGRAM | |
TW201301874A (en) | Method and device of document scanning and portable electronic device | |
CN115623313B (en) | Image processing method, image processing device, electronic device, and storage medium | |
JPH10254903A (en) | Image retrieval method and device therefor | |
JP2016081095A (en) | Subject tracking device, control method thereof, image-capturing device, display device, and program | |
CN113469164A (en) | Background image display method and device, storage medium and electronic equipment | |
JP2017102748A (en) | Pupil image learning device, pupil position detection device, and program therefor | |
KR101276814B1 (en) | Method for Photographing picture in Mobile Terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |