Search

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

CN122027899ACN 122027899 ACN122027899 ACN 122027899ACN-122027899-A

Abstract

The present disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product, the method including generating at least one second zoom magnification based on a first change relationship between at least two first zoom magnifications and the first zoom magnification in a case where a first frequency of generating the first zoom magnification is less than or equal to a preset second frequency of generating the preview image; the method comprises the steps of determining a first zoom magnification from a first zoom magnification and a second zoom magnification according to a first frequency, determining a second zoom magnification from the first zoom magnification and the second zoom magnification according to a second frequency, and generating a preview image based on the first target zoom magnification. According to the embodiment of the disclosure, the situation that multiple frames of preview images are generated based on the same zoom magnification 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: In response to generating at least two first zoom magnifications for a detected zoom operation, determining a first frequency of generating the first zoom magnifications and a preset second frequency of generating preview images; Generating at least one second zoom magnification based on a first change relation between the at least two first zoom magnifications and the first zoom magnification when the first frequency is smaller than or equal to the second frequency, wherein the change relation is used for indicating a change trend of the zoom magnification; And determining a first target zoom magnification from the first zoom magnification and the second zoom magnification according to the second frequency based on a second change relation between the first zoom magnification and the second zoom magnification, and generating the preview image based on the first target zoom magnification.
  2. 2. The image processing method according to claim 1, wherein the determining a first target zoom magnification from the first zoom magnification and the second zoom magnification at the second frequency includes: determining a first candidate zoom magnification from the first zoom magnification and the second zoom magnification according to a preset third frequency, wherein the third frequency is larger than the second frequency; And determining the zoom magnification acquired from the first candidate zoom magnification according to the second frequency as the first target zoom magnification.
  3. 3. The image processing method according to claim 2, characterized in that the method further comprises: determining a first number from the first frequency and the third frequency; the generating at least one second zoom magnification based on the first zoom magnification includes: The first number of the second zoom magnifications is generated based on the first zoom magnifications.
  4. 4. The image processing method according to claim 1, characterized in that the method further comprises: determining a second number based on the second frequency and a screen refresh rate; the generating at least one second zoom magnification based on the first zoom magnification includes: the second number of the second zoom magnifications is generated based on the first zoom magnifications.
  5. 5. The image processing method according to claim 2, wherein the generating at least one second zoom magnification based on the first change relation between the at least two first zoom magnifications and the first zoom magnification includes: If the at least two first zoom magnifications comprise an N first zoom magnification and an N+1 first zoom magnification which are continuously generated, adjusting the N first zoom magnification or the N+1 first zoom magnification based on the first change relation between the N first zoom magnification and the N+1 first zoom magnification to obtain a second candidate zoom magnification, wherein the second candidate zoom magnification is positioned between the N first zoom magnification and the N+1 first zoom magnification, and N is larger than or equal to 1; at least one of the second zoom magnifications is determined from the second candidate zoom magnifications.
  6. 6. The image processing method according to claim 5, wherein the determining a first candidate zoom magnification from the first zoom magnification and the second zoom magnification at a preset third frequency includes: If the Nth first zoom magnification is generated, determining the Nth first zoom magnification as the first candidate zoom magnification according to the third frequency until the (N+1) th first zoom magnification is generated, wherein N is 1; and if the (N+1) th first zoom magnification is generated and the second zoom magnification is obtained, sequentially determining the second zoom magnification and the (N+1) th first zoom magnification as the first candidate zoom magnification according to the third frequency.
  7. 7. The image processing method according to claim 5, characterized in that the method further comprises: deleting the Nth first zoom magnification and the second zoom magnification if the (n+2) th first zoom magnification is generated; generating at least one third zoom magnification based on the n+1th first zoom magnification and the n+2th first zoom magnification; and determining a second target zoom magnification from the third zoom magnification and the (n+2) th first zoom magnification according to the second frequency, and generating a preview image based on the second target zoom magnification.
  8. 8. The image processing method according to claim 1, characterized in that the method further comprises: generating the first zoom magnification based on a preset zoom strategy for the detected zoom operation, wherein the preset zoom strategy is used for indicating a strategy for generating the zoom magnification based on the zoom operation; the generating at least one second zoom magnification based on the first zoom magnification includes: adjusting the first zoom magnification based on an adjustment strategy corresponding to the preset zoom strategy to obtain the second zoom magnification; The adjustment strategy is a strategy for adjusting the first zoom magnification, and a mapping relationship exists between the preset zoom strategy and the adjustment strategy.
  9. 9. An image processing apparatus, characterized in that the apparatus comprises: A first determination module configured to determine a first frequency of generating the first zoom magnification and a preset second frequency of generating a preview image in response to generating at least two first zoom magnifications for the detected zoom operation; The generating module is configured to generate at least one second zoom magnification based on a first change relation between the at least two first zoom magnifications and the first zoom magnification when the first frequency is smaller than or equal to the second frequency, wherein the change relation is used for indicating a change trend of the zoom magnification; And a second determining module configured to determine a first target zoom magnification from the first zoom magnification and the second zoom magnification at the second frequency based on a second change relation between the first zoom magnification and the second zoom magnification, and generate the preview image based on the first target zoom magnification.
  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 To overcome the problems in the related art, the present disclosure provides an image processing method, apparatus, electronic device, storage medium, and program product to reduce color differences between different image areas in a target image while providing the target image with a stereoscopic effect. According to a first aspect of embodiments of the present disclosure, there is provided an image processing method, the method including: in response to generating at least two first zoom magnifications for the detected zoom operation, determining a first frequency of generating the first zoom magnifications and a preset second frequency of generating the preview image; generating at least one second zoom magnification based on a first change relation between at least two first zoom magnifications and the first zoom magnifications when the first frequency is smaller than or equal to the second frequency, wherein the change relation is used for indicating the change trend of the zoom magnifications; and determining a first target zoom magnification from the first zoom magnification and the second zoom magnification according to a second frequency based on a second change relation between the first zoom magnification and the second zoom magnification, and generating a preview image based on the first target zoom magnification. In one embodiment, determining the first target zoom magnification from the first zoom magnification and the second zoom magnification at the second frequency includes: determining a first candidate zoom magnification from the first zoom magnification and the second zoom magnification according to a preset third frequency, wherein the third frequency is larger than the second frequency; the zoom magnification obtained from the first candidate zoom magnification at the second frequency is determined as a first target zoom magnification. In one embodiment, the method further comprises: determining a first number based on the first frequency and the third frequency; generating at least one second zoom magnification based on the first zoom magnification, comprising: Based on the first zoom magnification, a first number of second zoom magnifications are generated. In one embodiment, the method further comprises: determining a second number based on the second frequency and the screen refresh rate; generating at least one second zoom magnification based on the first zoom magnification, comprising: a second number of second zoom magnifications is generated based on the first zoom magnifications. In one embodiment, generating at least one second zoom magnification based on a first change relationship between at least two first zoom magnifications and the first zoom magnification comprises: If the at least two first zoom magnifications comprise an N first zoom magnification and an N+1 first zoom magnification which are continuously generated, adjusting the N first zoom magnification or the N+1 first zoom magnification based on a first change relation between the N first zoom magnification and the N+1 first zoom magnification to obtain a second candidate zoom magnification, wherein the second candidate zoom magnification is positioned between the N first zoom magnification and the N+1 first zoom magnification; at least one second zoom magnification is determined from the second candidate zoom magnifications. In one embodiment, determining the first candidate zoom magnification from the first zoom magnification and the second zoom magnification at a preset third frequency includes: If the Nth first zoom magnification is generated, determining the Nth first zoom magnification as a first candidate zoom magnification according to a third frequency until the (N+1) th first zoom magnification is generated, wherein N is 1; And if the (N+1) th first zoom magnification is generated and the second zoom magnification is obtained, sequentially determining the second zoom magnification and the (N+1) th first zoom magnification as first candidate zoom magnification according to the third frequency. In one embodiment, the method further c