Search

CN-122027900-A - Image processing method, image processing apparatus, electronic device, storage medium, and program product

CN122027900ACN 122027900 ACN122027900 ACN 122027900ACN-122027900-A

Abstract

The present disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product, the method including determining a first deviation value between a second zoom magnification indicated by a second zoom request and a third zoom magnification indicated by a third zoom request in response to detecting consecutive second and third zoom requests; and if the first deviation value is smaller than or equal to a preset threshold value, adjusting the zoom magnification to be adjusted in the second zoom magnification and the third zoom magnification based on the change relation between the zoom magnification indicated by the zoom request before the second zoom request and the second zoom magnification to obtain a target zoom magnification, and cutting a first image generated based on the image data acquired by the first zoom magnification based on the target zoom magnification to obtain a preview image. According to the embodiment of the disclosure, the situation that the difference among the plurality of displayed preview images is too small can be reduced, so that the display smoothness when the preview images are displayed is improved.

Inventors

  • YAO HAIQIANG

Assignees

  • 北京小米移动软件有限公司

Dates

Publication Date
20260512
Application Date
20241111

Claims (12)

  1. 1. An image processing method, comprising: Aiming at the detected first zoom request, acquiring image data based on a first zoom magnification indicated by the first zoom request; In response to detecting consecutive second and third zoom requests, determining a first deviation value between a second zoom magnification indicated by the second zoom request and a third zoom magnification indicated by the third zoom request; If the first deviation value is smaller than or equal to a preset threshold value, adjusting the zoom magnification to be adjusted in the second zoom magnification and the third zoom magnification based on the change relation between the zoom magnification indicated by the zoom request before the second zoom request and the second zoom magnification, so as to obtain a target zoom magnification; And cutting the first image generated based on the image data acquired by the first zoom magnification based on the target zoom magnification to obtain a preview image.
  2. 2. The image processing method according to claim 1, wherein the adjusting of the zoom magnification to be adjusted in the second zoom magnification and the third zoom magnification based on a change relationship between the zoom magnification indicated by the zoom request before the second zoom request and the second zoom magnification if the first deviation value is less than or equal to a preset threshold value, comprises: Determining a fourth zoom magnification indicated by a fourth zoom request if the first deviation value is less than or equal to the preset threshold, wherein the fourth zoom request is a zoom request detected before the second zoom request, and the fourth zoom request is continuous with the second zoom request in time sequence; and adjusting the zoom magnification to be adjusted based on the change relation between the fourth zoom magnification and the second zoom magnification.
  3. 3. The image processing method according to claim 2, wherein the zoom magnification to be adjusted includes the second zoom magnification and/or the third zoom magnification, the adjusting the zoom magnification to be adjusted based on a change relationship between the fourth zoom magnification and the second zoom magnification includes: if the change relation indicates that the fourth zoom magnification is increased to the second zoom magnification, performing reduction processing on the second zoom magnification and/or performing increase processing on the third zoom magnification; And if the change relation indicates that the fourth zoom magnification is reduced to the second zoom magnification, performing increasing processing on the second zoom magnification and/or performing reducing processing on the third zoom magnification.
  4. 4. The image processing method according to claim 2, characterized in that the method further comprises: determining a first adjustment value based on a second deviation value between the fourth zoom magnification and the second zoom magnification, wherein the first adjustment value and the second deviation value are positively correlated; The adjusting the zoom magnification to be adjusted based on the change relation between the fourth zoom magnification and the second zoom magnification includes: and adjusting the zoom magnification to be adjusted based on the change relation and the first adjustment value.
  5. 5. The image processing method according to claim 2, characterized in that the method further comprises: If the second zoom magnification is the zoom magnification to be adjusted, determining a second adjustment value based on an average value between the fourth zoom magnification and the second zoom magnification; The adjusting the zoom magnification to be adjusted based on the change relation between the fourth zoom magnification and the second zoom magnification includes: and adjusting the second zoom magnification based on the change relation and the second adjustment value.
  6. 6. The image processing method according to any one of claims 2 to 5, characterized in that the method further comprises: If the first deviation value is smaller than or equal to the preset threshold value and the preview image is not obtained based on the second zoom magnification within a preset period, determining the second zoom magnification as the zoom magnification to be adjusted, and/or, And if the first deviation value is smaller than or equal to the preset threshold value and the preview image is not obtained based on the third zoom magnification within the preset period, determining the third zoom magnification as the zoom magnification to be adjusted.
  7. 7. The image processing method according to claim 1, wherein the cropping processing of the first image generated based on the image data acquired at the first zoom magnification based on the target zoom magnification to obtain a preview image includes: Performing first cropping processing on the first image by using a first cropping parameter determined based on the first zoom magnification to obtain a processed first image; determining a second cropping parameter based on the first cropping parameter and the target zoom magnification; And carrying out second cutting processing on the processed first image based on the second cutting parameters to obtain the preview image.
  8. 8. The image processing method according to claim 7, wherein the capturing of the image data based on the first zoom magnification indicated by the first zoom request includes: Acquiring image data based on a first camera corresponding to the first zoom magnification, wherein the zoom ranges corresponding to different cameras are different; the method further comprises the steps of: If the target zoom magnification is out of the zoom range of the first camera, switching from the first camera to the second camera to acquire image data, wherein the target zoom magnification is in the zoom range of the second camera, or And if the target zoom magnification is within the zoom range of the first camera, maintaining the acquisition of the image data by using the first camera.
  9. 9. An image processing apparatus, characterized in that the apparatus comprises: the acquisition module is configured to acquire image data based on a first zoom magnification indicated by the first zoom request aiming at the detected first zoom request; A determination module configured to determine, in response to detecting consecutive second and third zoom requests, a first deviation value between a second zoom magnification indicated by the second zoom request and a third zoom magnification indicated by the third zoom request; The adjustment module is configured to adjust the zoom magnification to be adjusted in the second zoom magnification and the third zoom magnification based on the change relation between the zoom magnification indicated by the zoom request before the second zoom request and the second zoom magnification if the first deviation value is smaller than or equal to a preset threshold value, so as to obtain a target zoom magnification; And the processing module is configured to cut a first image generated based on the image data acquired by the first zoom magnification based on the target zoom magnification to obtain a preview image.
  10. 10. An electronic device, comprising: A processor; A memory for storing a computer program or instructions; Wherein the processor executes the computer program or instructions to implement the steps of the method of any one of claims 1 to 8.
  11. 11. A non-transitory computer readable storage medium storing a computer program or instructions, characterized in that the computer program or instructions in the storage medium, when executed by a processor, implement the steps of the method of any one of claims 1 to 8.
  12. 12. A computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 8.

Description

Image processing method, image processing apparatus, electronic device, storage medium, and program product Technical Field The present disclosure relates to the field of image processing, and in particular, to an image processing method, apparatus, electronic device, storage medium, and program product. Background In the related art, an electronic device may perform a cropping process on an image generated by a camera based on image data acquired by a fixed zoom magnification in response to detecting a zooming operation of a user on a photographing preview interface, so as to obtain a preview image meeting a zoom requirement, and display the preview image in the photographing preview interface. In the related art, however, the electronic device cannot ensure display smoothness of the continuously displayed preview image during the continuous zooming. Disclosure of Invention In order to overcome the problems in the related art, the present disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product, so as to reduce the situation that the difference between the displayed preview images is too small, thereby improving the display smoothness when the preview images are displayed. According to a first aspect of embodiments of the present disclosure, there is provided an image processing method, the method including: aiming at the detected first zoom request, acquiring image data based on a first zoom magnification indicated by the first zoom request; In response to detecting the consecutive second and third zoom requests, determining a first deviation value between a second zoom magnification indicated by the second zoom request and a third zoom magnification indicated by the third zoom request; If the first deviation value is smaller than or equal to a preset threshold value, adjusting the zoom magnification to be adjusted in the second zoom magnification and the third zoom magnification based on the change relation between the zoom magnification indicated by the zoom request before the second zoom request and the second zoom magnification, so as to obtain a target zoom magnification; and cutting the first image generated based on the image data acquired by the first zoom magnification based on the target zoom magnification to obtain a preview image. According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including: The acquisition module is configured to acquire image data based on a first zoom magnification indicated by the first zoom request aiming at the detected first zoom request; A determination module configured to determine, in response to detecting consecutive second and third zoom requests, a first deviation value between a second zoom magnification indicated by the second zoom request and a third zoom magnification indicated by the third zoom request; the adjustment module is configured to adjust the zoom magnification to be adjusted in the second zoom magnification and the third zoom magnification based on the change relation between the zoom magnification indicated by the zoom request before the second zoom request and the second zoom magnification if the first deviation value is smaller than or equal to a preset threshold value, so as to obtain a target zoom magnification; And the processing module is configured to cut the first image generated based on the image data acquired by the first zoom magnification based on the target zoom magnification to obtain a preview image. According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: A processor; A memory for storing a computer program or instructions; wherein the processor executes a computer program or instructions to implement the steps of any of the image processing methods of the first aspect described above. According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium comprising: the steps of any of the image processing methods of the first aspect described above are implemented when a computer program or instructions in a storage medium is executed by a processor. According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of any of the image processing methods of the first aspect described above. The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: In the embodiment of the disclosure, if the deviation value between the zoom magnifications indicated by the two continuously detected zoom requests is smaller, at least one of the two zoom magnifications is adjusted based on the change relationship between the zoom magnification indicated by the zoom request before the secon