Camera picture preview method and device, electronic equipment and storage medium
By obtaining reference pictures for post-processing, the local picture enlargement is realized when taking pictures, the problem of difficulty in partial enlargement in the prior art is solved, and the shooting experience and preview quality are improved.
Patent Information
- Application Number
- CN202411198934.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
AI Technical Summary
The prior art is difficult to achieve partial picture enlargement during the photography process, which affects the user's ability to observe the details of the picture during shooting, resulting in difficulty in shooting decision making.
By obtaining the reference picture corresponding to the current camera screen, performing higher magnification post-processing, obtaining the preview target for display, and displaying it in the current camera screen, ensuring the preview clarity and consistency.
Provide a partial enlargement solution when taking pictures, which improves the user's photography experience and preview quality, allowing users to observe the details of the picture more clearly and make shooting decisions.
Smart Images

Figure CN119094886A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a camera screen preview method, device, electronic equipment and storage medium. Background Art
[0002] The existing display of local details of the picture is generally achieved by using photo editing software, which enlarges the local area of the photo and then realizes preview. However, this process is generally done after taking the photo, and the pixels of the enlarged area are also reduced. During the photo shooting process, users also need to enlarge the part to observe the details of the picture, and then decide whether to capture the picture as a photo; how to enlarge the part when taking a photo is an urgent problem to be solved. Summary of the invention
[0003] The embodiment of the present invention provides a camera screen preview method, which aims to solve the problem of how to perform partial zooming when taking pictures. When a user needs to preview the current camera screen, a reference picture corresponding to the current camera screen can be obtained, and a reference target with a higher magnification is obtained from the reference picture for post-processing to obtain a preview target for display. While ensuring the preview clarity, a solution for partial zooming when taking pictures is provided, which is convenient for users to make photo decisions. At the same time, since the current camera screen and the reference picture are obtained by the same camera, the preview target has a higher consistency with the current camera screen, which improves the quality of the current camera screen preview, thereby enhancing the user's photo experience.
[0004] In a first aspect, an embodiment of the present invention provides a camera screen preview method, the method comprising:
[0005] In response to a preview instruction for a current camera picture, acquiring at least one reference picture corresponding to the current camera picture, wherein a shooting magnification of the reference picture is greater than a shooting magnification of the current camera picture, and the current camera picture and the reference picture are acquired based on the same camera;
[0006] Based on the preview instruction, determining a target to be previewed that needs to be previewed in the current camera image;
[0007] Based on the target to be previewed, determining a reference target in at least one of the reference pictures;
[0008] Post-processing the reference target to obtain a preview target;
[0009] A preview position is determined in the current camera image, and the preview object is displayed at the preview position.
[0010] Optionally, the determining, based on the preview instruction, a target to be previewed that needs to be previewed in the current camera image includes:
[0011] Based on the preview instruction, determining a preview area in the current camera image;
[0012] A to-be-previewed target that needs to be previewed is determined in the preview area.
[0013] Optionally, there are multiple reference pictures, and the reference pictures have different corresponding shooting magnifications. The step of determining a reference target in at least one of the reference pictures based on the target to be previewed includes:
[0014] Based on the preview target, feature comparison is performed in the plurality of reference images to obtain a plurality of candidate targets and contour data corresponding to the candidate targets, wherein one reference image corresponds to one candidate target;
[0015] Based on the contour data corresponding to the plurality of candidate targets, the reference target is determined from the plurality of candidate features.
[0016] Optionally, the step of post-processing the reference target to obtain a preview target includes:
[0017] Based on the target to be previewed, determining the interpolation parameters of the reference target;
[0018] Based on the interpolation parameters, an interpolation calculation is performed on the reference target to obtain the preview target.
[0019] Optionally, the step of post-processing the reference target to obtain a preview target includes:
[0020] Adding a regularized contour to the reference object, and determining an area to be filled between the reference object and the regularized contour;
[0021] In the reference picture where the reference target is located, determining a target filling area corresponding to the area to be filled;
[0022] Filling the area to be filled based on the pixel points in the target filling area to obtain a reference target with regularized outline;
[0023] The reference target after the outline regularization is post-processed to obtain the preview target.
[0024] Optionally, the step of determining a preview position in the current camera image includes:
[0025] In the current camera image, determining a first preview position of the preview target;
[0026] Based on the first preview position, determining an occlusion value of the current camera image, wherein the occlusion value is determined according to the degree to which important information in the current camera image is occluded;
[0027] If the occlusion value is less than or equal to a preset occlusion value threshold, determining the first preview position as the preview position;
[0028] If the occlusion value is greater than a preset occlusion value threshold, a second preview position of the preview target is determined in the current camera image, and the occlusion value corresponding to the second preview position is smaller than the occlusion value of the first preview position;
[0029] Based on the second preview position, the preview position is determined.
[0030] Optionally, the step of determining the preview position based on the second preview position includes:
[0031] In the current camera image, determining whether there is an associated target having a posture association with the preview target;
[0032] If there is no associated target having a posture association with the preview target, determining the second preview position as the preview position;
[0033] If there is an associated target associated with the preview target posture, determining a combined posture of the preview target and the associated target;
[0034] If the combined posture does not conform to the preset posture rule, the preview object is reduced to obtain a reduced preview object;
[0035] Based on the reduced preview target, determining a third preview position of the reduced preview target in the current camera image;
[0036] Based on the third preview position, determining the preview position;
[0037] The step of displaying the preview target at the preview position includes:
[0038] If the preview position is determined according to the second preview position, while displaying the preview object at the preview position, a guide mark between the preview object and the object to be previewed is added in the current camera image;
[0039] If the preview position is determined according to the third preview position, the reduced preview object is displayed at the preview position.
[0040] In a second aspect, an embodiment of the present invention further provides a camera screen preview device, the camera screen preview device comprising:
[0041] an acquisition module, configured to acquire, in response to a preview instruction for a current camera picture, at least one reference picture corresponding to the current camera picture, wherein a shooting magnification of the reference picture is greater than a shooting magnification of the current camera picture, and the current camera picture and the reference picture are acquired based on the same camera;
[0042] A first processing module, configured to determine a target to be previewed that needs to be previewed in the current camera image based on the preview instruction;
[0043] A second processing module, configured to determine a reference target in at least one of the reference pictures based on the target to be previewed;
[0044] A post-processing module, used for post-processing the reference target to obtain a preview target;
[0045] The display module is used to determine the preview position in the current camera image and display the preview target at the preview position.
[0046] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the camera screen preview method provided in an embodiment of the present invention when executing the computer program.
[0047] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the camera screen preview method provided in the embodiment of the invention are implemented.
[0048] In an embodiment of the present invention, in response to a preview instruction for the current camera screen, at least one reference picture corresponding to the current camera screen is obtained, the shooting magnification of the reference picture is greater than the shooting magnification of the current camera screen, and the current camera screen and the reference picture are obtained based on the same camera; based on the preview instruction, a target to be previewed that needs to be previewed is determined in the current camera screen; based on the target to be previewed, a reference target is determined in at least one reference picture; the reference target is post-processed to obtain a preview target; a preview position is determined in the current camera screen, and the preview target is displayed at the preview position. The present invention can obtain a reference picture corresponding to the current camera screen when the user needs to preview the current camera screen, obtain a reference target with a higher magnification from the reference picture for post-processing, and obtain a preview target for display. Under the condition of ensuring the preview clarity, a solution for partial zooming in when taking pictures is provided, which is convenient for users to make photo decisions. At the same time, since the current camera screen and the reference picture are obtained by the same camera, the preview target has a higher consistency with the current camera screen, which improves the quality of the current camera screen preview, thereby improving the user's photo experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 is a flow chart of a camera screen preview method provided by an embodiment of the present invention;
[0051] Figure 2 It is a structural schematic diagram of a camera image preview device provided by an embodiment of the present invention;
[0052] Figure 3 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] like Figure 1 As shown, Figure 1: is a method flow chart of a camera screen preview method provided by an embodiment of the present invention. The camera screen preview method comprises the steps of:
[0055] 101. In response to a preview instruction for a current camera picture, obtain at least one reference picture corresponding to the current camera picture.
[0056] In an embodiment of the present invention, the camera screen preview method can be applied to electronic devices that can take pictures, such as smart phones, smart cameras, tablets, computers and other electronic devices. The electronic device that can take pictures includes at least a camera, a processor, a display screen and a memory, and the camera, the display screen and the memory are respectively connected to the processor for communication. The camera screen preview method is mainly implemented by the processor, the camera is used to collect the current camera screen and the reference picture, the display screen is used to display the current camera screen, and the memory is used to store the reference picture and the picture obtained by taking pictures.
[0057] The preview command is input by the user, and can be input by touch operation of the display screen, physical key operation, or voice input. The preview command includes a preview mode start command and a preview indication.
[0058] When the user inputs a preview instruction, the processor responds to the preview instruction and obtains a reference image from the memory. The camera can be a zoom camera. During the shooting process, when the user operates the camera to zoom, the images collected during the zoom process will be collected, and these images will be temporarily stored as reference images, so as to obtain an image corresponding to the current camera screen; wherein, each reference image can be automatically identified according to the current camera screen. Each magnification target, and then each magnification reference image is collected based on the zoom camera based on different magnification target center points, thereby ensuring that each magnification reference image includes a corresponding magnification target of each magnification. In addition, after the preview target is determined, other reference images can be deleted to save memory; or they can be retained for users to view the details of other reference images later.
[0059] In a possible embodiment, the reference image may be captured and temporarily stored during the zoom process before the user inputs a preview command. In this way, the reference image can be directly obtained when the user inputs a preview command, without waiting for the reference image to be captured, and without the reference image capture time overhead, thereby reducing the preview loading delay and improving the user experience.
[0060] In a possible embodiment, the reference image can be collected during the zooming process after the user inputs a preview instruction and determines the magnification that needs to be previewed. During the zooming process, the reference image corresponding to the magnification that the user needs to preview can be collected in a targeted manner, and there is no need to collect images of other magnifications, thereby reducing the storage pressure of the device. At this time, the acquisition of multiple reference images and the subsequent steps of selecting preview targets by magnification can also be omitted, saving the process.
[0061] In a possible embodiment, the reference image can be collected after the user inputs a preview instruction and determines the target to be previewed. During the collection process, different magnifications can be collected for the determined target to be previewed, and there is no need to collect magnification images of other preview targets, which reduces the storage pressure of the device. At this time, the acquisition of multiple reference images and the subsequent steps of selecting reference targets according to the target to be previewed can also be omitted, saving the process.
[0062] The shooting magnification of the reference picture is greater than the shooting magnification of the current camera picture, and the current camera picture and the reference picture are obtained based on the same camera. Specifically, after receiving the preview instruction input by the user, the magnification of the current camera picture can be determined, and a temporary picture with a magnification greater than the magnification of the current camera picture can be searched in the memory as the reference picture.
[0063] 102. Based on the preview instruction, determine a target to be previewed that needs to be previewed in the current camera image.
[0064] In the embodiment of the present invention, the preview instruction includes a preview mode start instruction and a preview indication, and the preview indication can be used to determine the target to be previewed in the current camera image.
[0065] The above-mentioned target to be previewed can be a target that the user needs to enlarge in the current camera screen. For example, if it is a photo of two people, and the user wants to enlarge the face of one of the people, then the face of that person is the preview target. Among them, the target to be previewed that needs to be enlarged can be selected by the user with his finger, or it can be obtained according to a voice command. The user can trigger the preview mode by long pressing the display screen and pressing the display screen multiple times, and identify the contact points of the display screen as preview indications, and then identify the target to be previewed. The user can also input by voice: "XX, I want to preview the face of the person on the left", and then trigger the preview mode through "XX". If the preview indication is the face on the left, the face on the left is determined as the target to be previewed.
[0066] 103. Determine a reference target in at least one reference picture based on the target to be previewed.
[0067] In the embodiment of the present invention, after the target to be previewed is obtained, a target corresponding to the target to be previewed is matched in the reference picture as a reference target.
[0068] Specifically, if the number of reference pictures is one, then in the reference picture, a target corresponding to the target to be previewed is identified as the reference target through the target recognition algorithm. If there are multiple targets in the reference picture, the similarity between the target to be previewed and the multiple targets is calculated, and the target with the highest similarity is determined as the reference target.
[0069] If there are multiple reference images, in each reference image, the target corresponding to the target to be previewed is identified as a candidate target through the target recognition algorithm, and one target is selected as a candidate target in each reference image. Through user selection or intelligent recommendation algorithm, a candidate target is determined from multiple candidate targets as a reference target. Similarly, if there are multiple targets in the reference image, the similarity between the target to be previewed and multiple targets is calculated, and the target with the highest similarity is determined as the candidate target.
[0070] 104. Post-process the reference target to obtain a preview target.
[0071] In an embodiment of the present invention, the above-mentioned post-processing may include regularization processing and interpolation processing. The above-mentioned regularization processing may process the reference target into image data that is more in line with user rules, and the above-mentioned interpolation processing is mainly to make the reference target have a performance that is closer to the current camera picture.
[0072] Through post-processing, a preview target that meets the conditions can be obtained, so that the preview target can be displayed in the current camera screen.
[0073] 105. Determine a preview position in the current camera image, and display the preview target at the preview position.
[0074] In an embodiment of the present invention, after obtaining the preview target, the preview position of the preview target can be calculated. The preview position can be the position of the target to be previewed, that is, the preview target and the center of the target to be previewed are centered, and the preview target is covered on the target to be previewed for display. The preview position can also be a position deviated from the target to be previewed. In this case, the preview target and the target to be previewed can be indicated and associated through guidance information.
[0075] In an embodiment of the present invention, in response to a preview instruction for the current camera screen, at least one reference picture corresponding to the current camera screen is obtained, the shooting magnification of the reference picture is greater than the shooting magnification of the current camera screen, and the current camera screen and the reference picture are obtained based on the same camera; based on the preview instruction, a target to be previewed that needs to be previewed is determined in the current camera screen; based on the target to be previewed, a reference target is determined in at least one reference picture; the reference target is post-processed to obtain a preview target; a preview position is determined in the current camera screen, and the preview target is displayed at the preview position. The present invention can obtain a reference picture corresponding to the current camera screen when the user needs to preview the current camera screen, obtain a reference target with a higher magnification from the reference picture for post-processing, and obtain a preview target for display. Under the condition of ensuring the preview clarity, a solution for partial zooming in when taking pictures is provided, which is convenient for users to make photo decisions. At the same time, since the current camera screen and the reference picture are obtained by the same camera, the preview target has a higher consistency with the current camera screen, which improves the quality of the current camera screen preview, thereby improving the user's photo experience.
[0076] It should be noted that the camera screen preview method provided in the embodiment of the present invention can be applied to devices such as smart cameras, smart phones, tablets, computers, servers, etc. that can perform the camera screen preview method.
[0077] It can be understood that in the specific implementation of this application, user data, screen data, image data and other related data are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data, as well as model training, deployment and use, must comply with relevant laws, regulations and standards of relevant countries and regions.
[0078] Optionally, in the step of determining the target to be previewed that needs to be previewed in the current camera screen based on the preview instruction, a preview area can be determined in the current camera screen based on the preview instruction; and the target to be previewed that needs to be previewed is determined in the preview area.
[0079] In an embodiment of the present invention, the above-mentioned preview instruction includes a preview mode start instruction and a preview indication. The preview area can be determined in the current camera screen through the preview indication. Specifically, the above-mentioned preview indication can be a touch point of the user on the display screen. After the touch point is determined, the touch point is expanded outward to determine the preview area, and the target is identified in the preview area to obtain the target in the preview area.
[0080] When there is only one target in the preview area, the target can be determined as the target to be previewed. When there are multiple targets in the preview area, the multiple targets can be provided to the user for selection, and the target selected by the user can be determined as the target to be previewed, or the target closest to the touch point can be determined as the target to be previewed.
[0081] A preview area is determined in the current camera image through the preview indication, and a target to be previewed is determined in the preview area, thereby improving the recognition accuracy of the target to be previewed.
[0082] Optionally, there are multiple reference pictures, and the corresponding shooting magnifications of each reference picture are different. In the step of determining the reference target in at least one reference picture based on the target to be previewed, feature comparison can be performed in multiple reference pictures based on the target to be previewed to obtain multiple candidate targets and contour data corresponding to the candidate targets, with one reference picture corresponding to one candidate target; and the reference target is determined from multiple candidate features based on the contour data corresponding to the multiple candidate targets.
[0083] In an embodiment of the present invention, the number of the above-mentioned reference pictures is multiple. After obtaining the target to be previewed, in each reference picture, the features of the target to be previewed can be compared with the features of each target in the reference picture to obtain the candidate target in the reference picture. After obtaining the candidate target, the contour data corresponding to the candidate target can also be obtained.
[0084] Specifically, an exemplary description is given for a reference image, and target recognition is performed on the reference image to obtain a target frame (x, y, w, h, r) in the reference image. One target frame corresponds to one target, where (x, y) is the center position of the target frame, which can represent the center position of the target; w is the width of the target frame, h is the height of the target frame, and r is the confidence that the target frame is the target. Feature extraction is performed on the target in the target frame to obtain features corresponding to the target, and the features of the target to be previewed are compared with the features of each target. The feature comparison can be a feature similarity calculation, and the target with the greatest similarity is determined as a candidate target of the reference image. Feature comparison is performed on each reference image to obtain a candidate target corresponding to each reference image.
[0085] After obtaining the candidate targets, the profile data corresponding to the candidate targets can be displayed to the user for selection, and the profile data selected by the user is determined as the target profile data, and the candidate targets corresponding to the target profile data are determined as the reference targets. Alternatively, the reference targets can be automatically recommended from multiple candidate targets through an intelligent recommendation algorithm.
[0086] Optionally, in the step of post-processing the reference target to obtain the preview target, interpolation parameters of the reference target may be determined based on the target to be previewed; and interpolation calculation may be performed on the reference target based on the interpolation parameters to obtain the preview target.
[0087] In an embodiment of the present invention, after obtaining the target to be previewed, the first pixel resolution of the target to be previewed can be determined. After obtaining the reference target, the second pixel resolution of the reference target can be determined. The interpolation parameters required for interpolation from the second pixel resolution to the first pixel resolution are calculated, and based on the interpolation parameters, the reference target is interpolated from the second pixel resolution to the first pixel resolution, so that the reference target and the target to be previewed are consistent at the pixel resolution level, thereby avoiding the abruptness of the preview target and the current camera screen at the pixel level when the preview target is displayed on the current camera screen, thereby further improving the picture quality of the camera screen preview.
[0088] The above interpolation calculation can adopt nearest neighbor interpolation, linear interpolation, bilinear interpolation, high-order interpolation and other methods.
[0089] Optionally, in the step of post-processing the reference target to obtain a preview target, a regularized contour can be added to the reference target, and an area to be filled between the reference target and the regularized contour can be determined; in a reference image where the reference target is located, a target filling area corresponding to the area to be filled is determined; based on the pixel points in the target filling area, the area to be filled is filled to obtain a reference target with a regularized contour; and the reference target with a regularized contour is post-processed to obtain a preview target.
[0090] In an embodiment of the present invention, during the post-processing of the reference target, the reference target may be subjected to contour regularization processing, and a regularized contour may be added to the periphery of the reference target, such as a rectangular or circular contour. In a possible embodiment, the target frame (x, y, w, h, r) of the reference target may be obtained, and the aspect ratio of the target frame may be calculated. If the aspect ratio is greater than a first aspect ratio threshold, or the aspect ratio is less than a second aspect ratio threshold, the regularized contour is determined to be a rectangle. If the aspect ratio is less than or equal to the first aspect ratio threshold, or the aspect ratio is greater than or equal to the second aspect ratio threshold, the regularized contour is determined to be a circle. The first aspect ratio threshold is greater than the second aspect ratio threshold, the first aspect ratio threshold is greater than 1, and the second aspect ratio threshold is less than 1. In this way, when the shape of the target frame of the reference target is close to a square, the contour regularization processing may be performed by a circle, and when the shape of the target frame of the reference target deviates from a square, the contour regularization processing may be performed by a rectangle, thereby reducing the area of the area to be filled.
[0091] After adding the regularized contour to the reference target, the area to be filled between the reference target and the regularized contour is calculated, the pixel value in the area to be filled is empty, and the pixel resolution of the area to be filled is the same as that of the reference target. Specifically, the image area corresponding to the area to be filled can be found in the reference image corresponding to the reference target, the image area is determined as the filling area, and the pixel points in the filling area are used to fill the area to be filled, so as to obtain the reference target after the contour is regularized.
[0092] By regularizing the outline of the reference target, the preview target can be made more obvious in the current camera image, making it easier for users to focus on it.
[0093] Of course, it should be noted that the above-mentioned contour regularization processing is not necessary. In some possible embodiments, it is also possible not to perform contour regularization processing on the reference target and directly use the contour of the reference target.
[0094] The reference target after the outline regularization is post-processed, which may be interpolation processing of the reference target after the outline regularization. The interpolation processing may refer to the steps of interpolation calculation of the reference target. After the interpolation processing, the preview target may be obtained.
[0095] Optionally, in the step of determining the preview position in the current camera screen, a first preview position of the preview target can be determined in the current camera screen; based on the first preview position, an occlusion value of the current camera screen is determined, and the occlusion value is determined according to the degree to which important information in the current camera screen is occluded; if the occlusion value is less than or equal to a preset occlusion value threshold, the first preview position is determined as the preview position; if the occlusion value is greater than the preset occlusion value threshold, a second preview position of the preview target is determined in the current camera screen, and the occlusion value corresponding to the second preview position is less than the occlusion value of the first preview position; based on the second preview position, the preview position is determined.
[0096] In an embodiment of the present invention, the first preview position may be the position of the target to be previewed. Specifically, the first preview position coincides with the center point of the target to be previewed. When the first preview position is determined as the preview position, the center point of the preview target is coincident with the first preview position, and then the preview target is overlaid on the current camera screen. Then, a preview screen of the current camera screen can be obtained. The preview target is highlighted through the preview screen of the current camera screen, and the user can view the preview target in the preview screen and decide whether to take a photo.
[0097] In the current camera screen, the important information can be defined by the user or determined based on a reference target. In a possible embodiment, the important information is a specific screen area in the current camera screen. For example, in a group photo of two people, the preview target is the face area of one person, and the important information can be the body area of the person, the face area and body area of the other person, etc. The specific area is the screen area containing the important information, and the non-specific area is the area containing as little important information as possible or the area with many similar pixels.
[0098] Specifically, it can be defined whether there is an intersection between the preview target and the specific screen area. If there is an intersection, the occlusion value of the current camera screen is determined to be 1. If there is no intersection, the occlusion value of the current camera screen is determined to be 0. At this time, the occlusion value threshold can be any number in the interval (0, 1).
[0099] In a possible embodiment, the above-mentioned important information can allow a small degree of occlusion, which does not affect the overall sense of the picture. Therefore, the target screen area of the preview target in the current screen can be determined based on the first preview position, and the intersection and union ratio of the target area and the specific screen area can be calculated. The intersection and union ratio is used to determine the occlusion value of the current camera screen. If the occlusion value is less than or equal to the preset occlusion value threshold, it is said that the preview target does not occlude the important information to a high degree, and the first preview position can be directly determined as the preview position. If the occlusion value is greater than the preset occlusion value threshold, it is said that the preview target occludes the important information to a high degree, and the preview position of the preview target needs to be re-determined so that the preview target avoids these important information. The second preset position can be re-searched outside the specific screen area and the second preset position can be used as the preview position.
[0100] Optionally, in the step of determining the preview position based on the second preview position, it can be determined whether there is an associated target having a posture association with the preview target in the current camera screen; if there is no associated target having a posture association with the preview target, the second preview position is determined as the preview position; if there is an associated target associated with the preview target posture, the combined posture of the preview target and the associated target is determined; if the combined posture does not conform to a preset posture rule, the preview target is reduced to obtain a reduced preview target; based on the reduced preview target, a third preview position of the reduced preview target is determined in the current camera screen; based on the third preview position, the preview position is determined.
[0101] In an embodiment of the present invention, when the occlusion value is greater than a preset occlusion value threshold, it can be determined whether the preview target has an associated target in the current target screen. For example, if a face is used as the preview target, the human body is the associated target of the face. If there is no associated target, it is not necessary to consider whether the combined gesture complies with the gesture rule. The second preview position can be directly determined as the preview position. If there is an associated target, it can be considered whether the combination of the preview target and the associated target in the current target screen complies with the gesture rule. If the combined gesture complies with the gesture rule, it means that the combination of the preview target and the associated target is relatively natural or reasonable. If the combined gesture does not comply with the gesture rule, it means that the combination of the preview target and the associated target is relatively stiff or unreasonable.
[0102] When the combined posture does not conform to the preset posture rule, the preview target is reduced to obtain the reduced preview target, and the third preview position of the reduced preview target is determined in the current camera screen. The third preview position may be near the position of the target to be previewed, so that after the reduced preview target and the associated target are combined, the corresponding combined posture conforms to the preset posture rule. At this time, the third preview position can be directly determined as the preview position. Specifically, in the current camera screen, the area where the target to be previewed is located is taken as the target area, and a position search is performed in the target area to find the third preview position. The reduced preview target may be determined in a reference picture whose shooting magnification is greater than the shooting magnification of the current camera screen and less than the shooting magnification corresponding to the preview target.
[0103] In the step of displaying the preview target at the preview position, if the preview position is determined according to the second preview position, while displaying the preview target at the preview position, a guide mark between the preview target and the target to be previewed is added in the current camera picture.
[0104] If the preview position is determined according to the third preview position, the reduced preview target is displayed at the preview position. It should be noted that the shooting magnification of the reduced preview target is greater than the shooting magnification of the target to be previewed, and the shooting magnification of the reduced preview target is less than the shooting magnification of the preview target.
[0105] In a possible embodiment, if the combined gesture meets the preset gesture rule, the second preview position is determined as the preview position. In this case, it means that the preview target can be combined with the associated target at the second preview position, and the deviation between the second preview position and the first preview position is small. At this time, it is not necessary to add a guide mark between the preview target and the target to be previewed in the current camera screen.
[0106] In a possible embodiment, whether to add a guide mark between the preview target and the target to be previewed in the current camera picture can also refer to the distance and the degree of occlusion between the preview target and the target to be previewed, and the intersection-and-union ratio between the preview target and the target to be previewed can be calculated. If the intersection-and-union ratio is greater than a preset intersection-and-union ratio threshold, it means that the distance between the preview target and the target to be previewed is relatively close, and the preview target occludes the preview target more (the degree of replacement is relatively high), and there is no need to add a guide mark between the preview target and the target to be previewed in the current camera picture. If the intersection-and-union ratio is less than the preset intersection-and-union ratio threshold, it means that the distance between the preview target and the target to be previewed is relatively far, and the preview target occludes the preview target less (the degree of replacement is relatively low), and a guide mark between the preview target and the target to be previewed can be added in the current camera picture.
[0107] In a possible embodiment, when the combined posture does not conform to the preset posture rule, the occlusion value of the current camera screen can also be determined based on the second preview position; if the occlusion value is greater than the preset occlusion value threshold, the size of the preview target can be reduced and the second preview position can be re-determined. For example, it is determined whether the preview target covers other important information in the current camera screen, such as when two people take a photo together and one person enlarges his face, whether the face of the other person is blocked; if the face of the other person is blocked, the preview target is shifted according to the appropriate angle of the body (associated target) to ensure the rationalization of the human body posture in the photo; wherein the rationalization of the posture can be a slight tilt of the head, but the face and body cannot be separated. If the displacement affects the reasonable human body posture and blocks other important information, the magnification can be adjusted and reduced until the rationalization of the posture is not affected as much as possible and too much important information is not blocked.
[0108] In a possible embodiment, for the preview target, a position far from the target to be previewed and the specific screen area can be determined as the preview position from the beginning. At this time, the preview target can be displayed at the preview position, and a guide mark between the preview target and the target to be previewed can be added in the current camera screen. For example, if the preview target is not closely related to other parts in the current camera screen, the preview target can be shifted to a suitable position in the current camera screen; for example, the current camera screen is: "There is a pair of white swans on the lake", and the user wants to preview the white swans to see the details of the swans, but the pixels on the lake are basically the same. In addition to directly covering the white swan as the preview target with the position of the white swan in the current camera screen, the white swan as the preview target can also be placed at other positions on the lake. At this time, another guide information can be added, such as (arrow pointing to) preview target A for white swan No. 1 and preview target B for white swan No. 2.
[0109] In a possible embodiment, the preview target may be one or more. When there are multiple preview targets, the preview position of each preview target may be calculated in an order specified by the user.
[0110] By dynamically determining the preview position of the preview target, the preview target can be displayed at the best position.
[0111] like Figure 2 As shown, an embodiment of the present invention provides a camera screen preview device, the camera screen preview device comprising:
[0112] An acquisition module 201 is used to acquire at least one reference picture corresponding to the current camera picture in response to a preview instruction for the current camera picture, wherein the shooting magnification of the reference picture is greater than the shooting magnification of the current camera picture, and the current camera picture and the reference picture are acquired based on the same camera;
[0113] A first processing module 202 is used to determine a preview target that needs to be previewed in the current camera image based on the preview instruction;
[0114] A second processing module 203 is used to determine a reference target in at least one of the reference pictures based on the target to be previewed;
[0115] A post-processing module 204 is used to post-process the reference target to obtain a preview target;
[0116] The display module 205 is used to determine a preview position in the current camera image and display the preview object at the preview position.
[0117] Optionally, the first processing module 202 is further configured to determine a preview area in the current camera image based on the preview instruction; and determine a target to be previewed that needs to be previewed in the preview area.
[0118] Optionally, there are multiple reference pictures, and the shooting magnifications corresponding to the reference pictures are different. The second processing module 203 is also used to perform feature comparison in the multiple reference pictures based on the preview target to obtain multiple candidate targets and contour data corresponding to the candidate targets, one reference picture corresponds to one candidate target; based on the contour data corresponding to the multiple candidate targets, the reference target is determined from the multiple candidate features.
[0119] Optionally, the post-processing module 204 is further configured to determine interpolation parameters of the reference target based on the target to be previewed; and perform interpolation calculation on the reference target based on the interpolation parameters to obtain the preview target.
[0120] Optionally, the post-processing module 204 is also used to add a regularized contour to the reference target, and determine the area to be filled between the reference target and the regularized contour; in the reference image where the reference target is located, determine the target filling area corresponding to the area to be filled; based on the pixel points in the target filling area, fill the area to be filled to obtain the reference target with a regularized contour; post-process the reference target with a regularized contour to obtain the preview target.
[0121] Optionally, the display module 205 is also used to determine a first preview position of the preview target in the current camera screen; based on the first preview position, determine an occlusion value of the current camera screen, and the occlusion value is determined according to the degree to which important information in the current camera screen is occluded; if the occlusion value is less than or equal to a preset occlusion value threshold, determine the first preview position as the preview position; if the occlusion value is greater than a preset occlusion value threshold, determine a second preview position of the preview target in the current camera screen, and the occlusion value corresponding to the second preview position is less than the occlusion value of the first preview position; determine the preview position based on the second preview position.
[0122] Optionally, the display module 205 is further used to determine whether there is an associated target with a posture association with the preview target in the current camera screen; if there is no associated target with a posture association with the preview target, determine the second preview position as the preview position; if there is an associated target with a posture association with the preview target, determine the combined posture of the preview target and the associated target; if the combined posture does not conform to a preset posture rule, reduce the preview target to obtain a reduced preview target; based on the reduced preview target, determine a third preview position of the reduced preview target in the current camera screen; based on the third preview position, determine the preview position; the display module 205 is further used to, if the preview position is determined according to the second preview position, display the preview target at the preview position, and add a guide mark between the preview target and the target to be previewed in the current camera screen; if the preview position is determined according to the third preview position, display the reduced preview target at the preview position.
[0123] It should be noted that the camera screen preview device provided in the embodiment of the present invention can be applied to devices such as smart cameras, smart phones, tablets, computers, servers, etc. that can perform the camera screen preview method.
[0124] The camera screen preview device provided in the embodiment of the present invention can implement each process implemented by the camera screen preview method in the above method embodiment, and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0125] See also Figure 3 , Figure 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, it includes: a memory 302, a processor 301, and a computer program of a camera picture preview method stored in the memory 302 and executable on the processor 301, wherein:
[0126] The processor 301 is used to call the computer program stored in the memory 302 and execute the following steps:
[0127] In response to a preview instruction for a current camera picture, acquiring at least one reference picture corresponding to the current camera picture, wherein a shooting magnification of the reference picture is greater than a shooting magnification of the current camera picture, and the current camera picture and the reference picture are acquired based on the same camera;
[0128] Based on the preview instruction, determining a target to be previewed that needs to be previewed in the current camera image;
[0129] Based on the target to be previewed, determining a reference target in at least one of the reference pictures;
[0130] Post-processing the reference target to obtain a preview target;
[0131] A preview position is determined in the current camera image, and the preview object is displayed at the preview position.
[0132] Optionally, the processor 301 executes the step of determining, based on the preview instruction, a target to be previewed in the current camera image, including:
[0133] Based on the preview instruction, determining a preview area in the current camera image;
[0134] A to-be-previewed target that needs to be previewed is determined in the preview area.
[0135] Optionally, there are multiple reference pictures, and the corresponding shooting magnifications of the reference pictures are different. The step of determining the reference target in at least one of the reference pictures based on the target to be previewed, performed by the processor 301, includes:
[0136] Based on the preview target, feature comparison is performed in the plurality of reference images to obtain a plurality of candidate targets and contour data corresponding to the candidate targets, wherein one reference image corresponds to one candidate target;
[0137] Based on the contour data corresponding to the plurality of candidate targets, the reference target is determined from the plurality of candidate features.
[0138] Optionally, the step of post-processing the reference target to obtain a preview target performed by the processor 301 includes:
[0139] Based on the target to be previewed, determining the interpolation parameters of the reference target;
[0140] Based on the interpolation parameters, an interpolation calculation is performed on the reference target to obtain the preview target.
[0141] Optionally, the step of post-processing the reference target to obtain a preview target performed by the processor 301 includes:
[0142] Adding a regularized contour to the reference object, and determining an area to be filled between the reference object and the regularized contour;
[0143] In the reference picture where the reference target is located, determining a target filling area corresponding to the area to be filled;
[0144] Filling the area to be filled based on the pixel points in the target filling area to obtain a reference target with regularized outline;
[0145] The reference target after the outline regularization is post-processed to obtain the preview target.
[0146] Optionally, the step of determining a preview position in the current camera picture performed by the processor 301 includes:
[0147] In the current camera image, determining a first preview position of the preview target;
[0148] Based on the first preview position, determining an occlusion value of the current camera image, wherein the occlusion value is determined according to the degree to which important information in the current camera image is occluded;
[0149] If the occlusion value is less than or equal to a preset occlusion value threshold, determining the first preview position as the preview position;
[0150] If the occlusion value is greater than a preset occlusion value threshold, a second preview position of the preview target is determined in the current camera image, and the occlusion value corresponding to the second preview position is smaller than the occlusion value of the first preview position;
[0151] Based on the second preview position, the preview position is determined.
[0152] Optionally, the step of determining the preview position based on the second preview position performed by the processor 301 includes:
[0153] In the current camera image, determining whether there is an associated target having a posture association with the preview target;
[0154] If there is no associated target having a posture association with the preview target, determining the second preview position as the preview position;
[0155] If there is an associated target associated with the preview target posture, determining a combined posture of the preview target and the associated target;
[0156] If the combined posture does not conform to the preset posture rule, the preview object is reduced to obtain a reduced preview object;
[0157] Based on the reduced preview target, determining a third preview position of the reduced preview target in the current camera image;
[0158] Based on the third preview position, determining the preview position;
[0159] The step of displaying the preview target at the preview position performed by the processor 301 includes:
[0160] If the preview position is determined according to the second preview position, while displaying the preview object at the preview position, a guide mark between the preview object and the object to be previewed is added in the current camera image;
[0161] If the preview position is determined according to the third preview position, the reduced preview object is displayed at the preview position.
[0162] It should be noted that the electronic device provided in the embodiment of the present invention can be applied to devices such as smart cameras, smart phones, tablets, computers, servers, etc. that can perform the camera screen preview method.
[0163] The electronic device provided by the embodiment of the present invention can implement each process implemented by the camera screen preview method in the above method embodiment, and can achieve the same beneficial effect. To avoid repetition, it will not be described here.
[0164] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the camera screen preview method provided by the embodiment of the present invention are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0165] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The computer-readable storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0166] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A camera image preview method, characterized in that: The method comprises the following steps: In response to a preview instruction for a current camera picture, acquiring at least one reference picture corresponding to the current camera picture, wherein a shooting magnification of the reference picture is greater than a shooting magnification of the current camera picture, and the current camera picture and the reference picture are acquired based on the same camera; Based on the preview instruction, determining a target to be previewed that needs to be previewed in the current camera image; Based on the target to be previewed, determining a reference target in at least one of the reference pictures; Post-processing the reference target to obtain a preview target; A preview position is determined in the current camera image, and the preview object is displayed at the preview position.
2. The camera image preview method according to claim 1, wherein: The step of determining a target to be previewed that needs to be previewed in the current camera image based on the preview instruction includes: Based on the preview instruction, determining a preview area in the current camera image; A to-be-previewed target that needs to be previewed is determined in the preview area.
3. The camera image preview method according to claim 2, wherein: There are multiple reference pictures, and the reference pictures have different corresponding shooting magnifications. The step of determining a reference target in at least one of the reference pictures based on the target to be previewed includes: Based on the target to be previewed, feature comparison is performed in the plurality of reference images to obtain a plurality of candidate targets and contour data corresponding to the candidate targets, wherein one reference image corresponds to one candidate target; Based on the contour data corresponding to the plurality of candidate targets, the reference target is determined from the plurality of candidate features.
4. The camera image preview method according to claim 2, wherein: The step of post-processing the reference target to obtain a preview target comprises: Based on the target to be previewed, determining the interpolation parameters of the reference target; Based on the interpolation parameters, an interpolation calculation is performed on the reference target to obtain the preview target.
5. The camera image preview method according to claim 2, wherein: The step of post-processing the reference target to obtain a preview target comprises: Adding a regularized contour to the reference object, and determining an area to be filled between the reference object and the regularized contour; In the reference picture where the reference target is located, determining a target filling area corresponding to the area to be filled; Filling the area to be filled based on the pixel points in the target filling area to obtain a reference target with regularized outline; The reference target after the outline regularization is post-processed to obtain the preview target.
6. The camera image preview method according to any one of claims 1 to 4, characterized in that: The step of determining the preview position in the current camera image comprises: In the current camera image, determining a first preview position of the preview target; Based on the first preview position, determining an occlusion value of the current camera image, wherein the occlusion value is determined according to the degree to which important information in the current camera image is occluded; If the occlusion value is less than or equal to a preset occlusion value threshold, determining the first preview position as the preview position; If the occlusion value is greater than a preset occlusion value threshold, a second preview position of the preview target is determined in the current camera image, and the occlusion value corresponding to the second preview position is smaller than the occlusion value of the first preview position; Based on the second preview position, the preview position is determined.
7. The camera image preview method according to claim 6, wherein: The step of determining the preview position based on the second preview position includes: In the current camera image, determining whether there is an associated target having a posture association with the preview target; If there is no associated target having a posture association with the preview target, determining the second preview position as the preview position; If there is an associated target associated with the preview target posture, determining a combined posture of the preview target and the associated target; If the combined posture does not conform to the preset posture rule, the preview object is reduced to obtain a reduced preview object; Based on the reduced preview target, determining a third preview position of the reduced preview target in the current camera image; Based on the third preview position, determining the preview position; The step of displaying the preview target at the preview position includes: If the preview position is determined according to the second preview position, while displaying the preview object at the preview position, a guide mark between the preview object and the object to be previewed is added in the current camera image; If the preview position is determined according to the third preview position, the reduced preview object is displayed at the preview position.
8. A camera image preview device, characterized in that: The camera picture preview device comprises: an acquisition module, configured to acquire, in response to a preview instruction for a current camera picture, at least one reference picture corresponding to the current camera picture, wherein a shooting magnification of the reference picture is greater than a shooting magnification of the current camera picture, and the current camera picture and the reference picture are acquired based on the same camera; A first processing module, configured to determine a target to be previewed that needs to be previewed in the current camera image based on the preview instruction; A second processing module, configured to determine a reference target in at least one of the reference pictures based on the target to be previewed; A post-processing module, used for post-processing the reference target to obtain a preview target; The display module is used to determine the preview position in the current camera image and display the preview target at the preview position.
9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the camera screen preview method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the camera image preview method according to any one of claims 1 to 7 are implemented.
