Image processing method and device, equipment and medium
By dynamically switching preset software modules or hardware modules according to the scaling magnification, device parameters and environmental parameters in electronic devices, scaling and image enhancement processing is solved, the problem of insufficient image clarity at high scaling magnification in the prior art is solved. High definition and flexible image scaling are achieved.
Patent Information
- Application Number
- CN202411565815.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art cannot effectively improve image clarity under high scalability, and limiting scalability will limit user operations and cannot meet user needs.
By selecting a more suitable preset software module or hardware module in the electronic device, the image is scaled and image enhanced, and the module is dynamically switched according to the zoom ratio, device parameters and environmental parameters.
It effectively improves the sharpness of the zoom image without limiting the zoom magnification, meeting users' needs for image scaling and clarity.
Smart Images

Figure CN119421047A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and specifically relates to an image processing method, device, equipment and medium. Background Art
[0002] With the development of electronic devices, users have higher and higher requirements for the shooting function of electronic devices. When using electronic devices to shoot, users often zoom in and out on the preview image.
[0003] At present, in order to improve the clarity of the scaled image, the scaled image is usually enhanced by an image processing chip (Image Signal Processor, ISP), or the image scaling factor is limited to avoid being too high.
[0004] However, when the zoom ratio is high, the enhancement capability of the ISP chip is insufficient and cannot effectively improve the clarity of the zoomed image, while limiting the zoom ratio will limit the user's zoom operation and fail to meet user needs. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide an image processing method, apparatus, device and medium, which can select a more appropriate module to scale and enhance the image, thereby effectively improving the clarity of the scaled image without limiting the zoom ratio, so that the image scaling and clarity can better meet user needs.
[0006] In a first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, and the method includes:
[0007] receiving a first input for scaling a first image;
[0008] In response to the first input, acquiring a target parameter, where the target parameter includes at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device;
[0009] Determining a target module from a plurality of preset modules according to the target parameter, the plurality of preset modules including a preset software module and a preset hardware module;
[0010] Scaling the first image through the target module to obtain a second image;
[0011] The second image is subjected to image enhancement processing by the target module to obtain a third image.
[0012] In a second aspect, an embodiment of the present application provides an image processing device, which is applied to an electronic device, and the device includes:
[0013] A receiving module, configured to receive a first input for scaling a first image;
[0014] an acquisition module, configured to acquire a target parameter in response to the first input, the target parameter including at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device;
[0015] A first determining module, configured to determine a target module from a plurality of preset modules according to a target parameter, wherein the plurality of preset modules include a preset software module and a preset hardware module;
[0016] A scaling module, used for scaling the first image through the target module to obtain a second image;
[0017] The image enhancement module is used to perform image enhancement processing on the second image through the target module to obtain a third image.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0021] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0022] In an embodiment of the present application, the electronic device can obtain a target parameter in response to a first input for scaling a first image, the target parameter including at least one of a scaling factor corresponding to the first input, a device parameter of the electronic device, and an environmental parameter of the electronic device, and then determine a target module from a preset software module and a preset hardware module according to the target parameter, and perform scaling and image enhancement processing on the first image through the target module to obtain a third image. Since the preset software module has a strong image enhancement capability and the preset hardware module has a low power consumption, a more suitable module can be selected to scale and enhance the image according to parameters such as the scaling factor, device parameters, and / or environmental parameters, thereby effectively improving the clarity of the scaled image, and there is no need to limit the scaling factor, so that the image scaling and clarity can better meet user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is one of the flowchart diagrams of an image processing method according to an exemplary embodiment;
[0024] Figure 2 is a second flowchart of an image processing method according to an exemplary embodiment;
[0025] Figure 3 is a third flowchart of an image processing method according to an exemplary embodiment;
[0026] Figure 4 is a structural block diagram of an image processing device according to an exemplary embodiment;
[0027] Figure 5 is a structural block diagram of an electronic device according to an exemplary embodiment;
[0028] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0030] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0031] As mentioned in the background art, when a user uses an electronic device to shoot a video, the user often needs to scale the image in the viewfinder according to the relative positions of the object being shot and the electronic device, so as to obtain the desired shooting effect.
[0032] Scaling is generally achieved through a module on an ISP chip integrated in an electronic device, such as a video stream engine (VSE) module. An ISP chip is an integrated hardware chip for image processing, and a VSE module is a hardware module integrated on an ISP chip that performs image enhancement and cropping on a video stream. The VSE module can crop, scale, and reduce noise on the image stream output by the sensor, thereby magnifying the subject and obtaining a video.
[0033] In order to improve the clarity of the video, there are generally two solutions. The first solution is to use a relatively high-end ISP chip. High-end ISP chips generally integrate more image processing modules and can enhance the cropped image. The second solution is to limit the maximum zoom ratio allowed by the user, so as to avoid too large a zoom ratio and ensure a certain clarity of the image.
[0034] However, in the first solution, high-end ISP chips are expensive, and different ISP chips require additional debugging and development, which is time-consuming and labor-intensive. In addition, even for high-end ISP chips, the enhancement capability is insufficient at higher zoom ratios, and sufficiently clear images cannot be obtained. In the second solution, the zoom ratio is limited, and limiting the zoom ratio will limit the user's zoom operation, affecting the user's usage scenarios. When the electronic device is far away from the subject, a satisfactory shooting effect cannot be obtained, which will affect the user's experience, fail to meet user needs, and reduce product competitiveness.
[0035] The embodiments of the present application provide an image processing method, apparatus, device and medium, wherein the electronic device can obtain a target parameter in response to a first input for scaling a first image, the target parameter including at least one of a scaling factor corresponding to the first input, a device parameter of the electronic device, and an environmental parameter of the electronic device, and then determine a target module from a preset software module and a preset hardware module according to the target parameter, and perform scaling and image enhancement processing on the first image through the target module to obtain a third image. Since the preset software module has a strong image enhancement capability and the preset hardware module has a low power consumption, a more suitable module can be selected to scale and enhance the image according to parameters such as the scaling factor, device parameters and / or environmental parameters, thereby effectively improving the clarity of the scaled image, and there is no need to limit the scaling factor, so that the image scaling and clarity can better meet user needs.
[0036] The image processing method, apparatus, device and medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0037] The image processing method provided in the embodiment of the present application can be applied to application scenarios where zooming is required during video shooting.
[0038] The image processing method provided in the embodiment of the present application may be executed by an electronic device. It should be noted that the above execution entity does not constitute a limitation on the present application.
[0039] Combine the following Figure 1 The image processing method provided in the embodiment of the present application is described in detail.
[0040] Figure 1 The figure is a flowchart of an image processing method according to an exemplary embodiment.
[0041] like Figure 1 As shown, the image processing method may include the following steps:
[0042] Step 110: Receive a first input for scaling a first image.
[0043] Here, the first image may be a preview image displayed by the electronic device during the process of shooting a video by the electronic device. The first image may be an original image, that is, an image with a zoom ratio of 1.0, or a zoomed image, for example, an image with a zoom ratio greater than 1.0.
[0044] The first input may be an input for scaling the first image, or an input for scaling the viewfinder.
[0045] The user can use the first input to make the captured image meet his or her needs. For example, the electronic device can be a mobile phone, and the user holds the mobile phone and shoots a video of the object to be shot. During the shooting process, the user can observe the preview image displayed on the mobile phone screen and zoom in and out on the viewfinder until the user is satisfied.
[0046] A scaling factor for scaling the first image may be determined based on the first input.
[0047] Exemplarily, the first input can click the input of the target zoom ratio control. While displaying the first image, the electronic device can also display multiple zoom ratio controls: "1.0" control, "1.5" control and "2.0" control. The target zoom ratio control can be one of the multiple zoom ratio controls.
[0048] Exemplarily, the first input may also be an input of sliding two fingers on the display interface of the electronic device. Specifically, when sliding, the distance between the two fingers from large to small can reduce the zoom ratio, and the distance between the two fingers from small to large can increase the zoom ratio.
[0049] Step 120: Obtain target parameters in response to the first input.
[0050] Here, the target parameter may include at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device.
[0051] The target parameter can be used as a basis for selecting a module to process the image. The target parameter can be the current parameter.
[0052] In some embodiments, the device parameter may include available memory and / or device temperature of the electronic device, and the environment parameter may include the ambient temperature and / or ambient brightness of the environment in which the electronic device is located.
[0053] Zoom ratio, available memory, device temperature, ambient temperature, and ambient brightness all affect image processing.
[0054] The larger the zoom ratio, the stronger the image enhancement processing required. The larger the available memory, the more computing power can be used for image processing. The higher the device temperature, the more you need to reduce the power consumption of image processing to avoid overheating the device. The higher the ambient temperature, the more you need to reduce the power consumption of image processing to avoid overheating the device. The lower the ambient brightness, the stronger the image processing capability required to improve the image brightness.
[0055] In this way, through the above parameters that may affect image processing, a suitable module can be selected more reasonably for image processing.
[0056] Step 130: determine a target module from a plurality of preset modules according to the target parameters.
[0057] Here, the plurality of preset modules may include a preset software module and a preset hardware module.
[0058] During the video shooting process, since the target parameters may change, the target module can dynamically switch between the preset software module and the preset hardware module, thereby taking into account the power consumption advantages of the hardware and the effect advantages of the software, and improving the user's zoom flexibility and video clarity during video shooting.
[0059] The preset software module can be a combination of multiple software algorithms, such as cropping algorithms, high-resolution enhancement algorithms, artificial intelligence (AI) algorithms, etc., which can further improve image clarity while achieving cropping. Compared with the preset hardware module, the preset software module can integrate cropping and image enhancement in one module, which can more effectively utilize the original image information, improve image clarity, and also bring greater scalability.
[0060] Exemplarily, the preset software module may be a video stream algorithm (VSA) module, which may be integrated with a variety of software modules to improve image clarity and crop images. The VSA module may include a video super resolution (VSR) module, which is a software module that can perform image enhancement and improve image clarity.
[0061] Exemplarily, the preset hardware module may be an ISP module, and the ISP module may include a VSE module.
[0062] The target module can be determined from a plurality of preset modules according to the target parameters by the strategy module.
[0063] In some implementations, step 130 may include:
[0064] When the target parameter meets the preset conditions, the preset software module is determined as the target module;
[0065] When the target parameter does not satisfy the preset condition, the preset hardware module is determined as the target module.
[0066] Here, the preset condition may be a condition for triggering the use of a preset software module for image processing. The preset condition may be set according to actual needs and is not limited here.
[0067] Specifically, if the electronic device is originally using a preset hardware module for image processing, when the target parameters meet the preset conditions, it can switch to using a preset software module for image processing; when the target parameters do not meet the preset conditions, it can continue to use the preset hardware module for image processing without switching.
[0068] If the electronic device is originally using a preset software module for image processing, when the target parameters meet the preset conditions, it can continue to use the preset software module for image processing without switching; when the target parameters do not meet the preset conditions, it can switch to using the preset hardware module for image processing.
[0069] Different preset conditions can be customized for different electronic devices to ensure the stability of the electronic device's shooting performance.
[0070] In this way, by judging whether the target parameters meet the preset conditions, a more suitable module can be selected from the preset hardware modules and the preset software modules for image processing.
[0071] In some embodiments, when the target parameter includes a zoom factor, the preset condition may include the zoom factor being greater than a first threshold;
[0072] In the case where the target parameter includes available memory, the preset condition may include the available memory being greater than a second threshold;
[0073] In the case where the target parameter includes device temperature, the preset condition may include the device temperature being less than a third threshold;
[0074] In the case where the target parameter includes the ambient temperature, the preset condition may include the ambient temperature being less than a fourth threshold;
[0075] In the case where the target parameter includes ambient brightness, the preset condition may include that the ambient brightness is less than a fifth threshold.
[0076] Here, the first threshold, the second threshold, the third threshold, the fourth threshold and the fifth threshold can all be set according to actual needs and are not limited here.
[0077] Specifically, the larger the zoom ratio is, the greater the intensity of the required image enhancement processing is. Since the preset software module has a stronger image enhancement processing capability than the preset hardware module, when the zoom ratio is greater than the first threshold, the preset software module can be used for image processing, and when the zoom ratio is less than or equal to the first threshold, the preset hardware module can be used for image processing. Exemplarily, the first threshold can be 20 times. If the zoom ratio is greater than 20 times, the preset software module can be used for image processing; if the zoom ratio is less than or equal to 20 times, the preset hardware module can be used for image processing.
[0078] The larger the available memory, the more computing power can be used for image processing. Since the preset software module requires more computing power than the preset hardware module when performing image processing, when the available memory is greater than the second threshold, the preset software module can be used for image processing. When the available memory is less than or equal to the second threshold, the preset hardware module can be used for image processing.
[0079] The higher the device temperature is, the more it is necessary to reduce the power consumption of image processing in order to avoid the device temperature being too high. Since the preset software module consumes higher power than the preset hardware module when performing image processing, when the device temperature is less than the third threshold, the preset software module can be used for image processing. When the device temperature is greater than or equal to the third threshold, the preset hardware module can be used for image processing.
[0080] The higher the ambient temperature, the more it is necessary to reduce the power consumption of image processing in order to avoid excessive temperature of the device. Since the preset software module consumes higher power than the preset hardware module when performing image processing, when the ambient temperature is less than the fourth threshold, the preset software module can be used for image processing; when the ambient temperature is greater than or equal to the fourth threshold, the preset hardware module can be used for image processing.
[0081] The lower the ambient brightness, the stronger the image processing capability required to increase the image brightness. Since the preset software module has stronger image processing capability than the preset hardware module, when the ambient brightness is less than the fifth threshold, the preset software module can be used for image processing. When the ambient brightness is greater than or equal to the fifth threshold, the preset hardware module can be used for image processing.
[0082] In this way, by setting the corresponding preset conditions for each target parameter, the selection of the target module can be more comprehensively and accurately measured, so as to more reasonably select the target module for image processing, thereby obtaining a better image effect.
[0083] Step 140: scaling the first image using a target module to obtain a second image.
[0084] Here, the target module may be a preset hardware module or a preset software module. The second image may be obtained by scaling the first image.
[0085] In some implementations, step 140 may include:
[0086] The first image is cropped according to the cropping parameters by the target module to obtain a second image.
[0087] Here, the cropping parameter may be determined based on the zoom ratio corresponding to the first input. The cropping parameter may be a parameter of a cropping frame, which may be used to determine the position of the cropping frame, and may include the width, height, and coordinates of one of the vertices of the cropping frame.
[0088] Exemplarily, the cropping box may be a rectangular box, and the cropping parameters may include the width, height, and coordinates of the upper left vertex of the cropping box.
[0089] The cropping frame can be used to crop the first image, cut off the image area outside the cropping frame, retain the image area within the cropping frame, and obtain the second image.
[0090] In this way, accurate cropping of the first image can be achieved through cropping parameters determined based on the zoom ratio, thereby achieving zooming of the first image.
[0091] Step 150: Perform image enhancement processing on the second image through a target module to obtain a third image.
[0092] Here, the image definition can be improved by image enhancement processing. After the video is shot, the third image can be a video frame in the video obtained by shooting.
[0093] If the target module is a preset hardware module, the second image can be enhanced by the noise reduction module on the VSE module; if the target module is a preset software module, the second image can be enhanced by the VSR module on the VSA module.
[0094] In some implementations, step 150 may include:
[0095] During the process of recording video by the electronic device, the second image is enhanced by the target module to obtain a third image.
[0096] Specifically, the user can perform a zoom operation on the first image during the recording process of the electronic device, that is, perform a first input. The electronic device can receive and respond to the first input, obtain target parameters during the recording process, and determine a target module from multiple preset modules based on the target parameters. Then, the electronic device can also perform a zoom operation on the first image through the target module during the recording process to obtain a second image, and perform an image enhancement operation on the second image through the target module to obtain a third image.
[0097] In this way, during the video recording process of the electronic device, dynamic switching of the preset software module and the preset hardware module can be achieved, thereby effectively improving the overall clarity of the recorded video.
[0098] In some embodiments, the method may further include:
[0099] Before the target module crops the first image according to the cropping parameter to obtain the second image, determining the cropping parameter based on the zoom ratio corresponding to the first input;
[0100] or,
[0101] Before determining the target module from a plurality of preset modules according to the target parameter, the calculation module determines the cropping parameter based on the zoom ratio corresponding to the first input.
[0102] Here, the computing module may be a software module independent of a preset hardware module and a preset software module.
[0103] Specifically, the cropping parameters may be determined based on the width, height, coordinates of one vertex of the original image, and the zoom factor. The original image may be an image with a zoom factor of 1.0.
[0104] For example, a plane rectangular coordinate system can be established with the upper left vertex of the original image as the origin of the coordinates, the horizontal right as the positive semi-axis of the X axis, and the vertical downward as the positive semi-axis of the Y axis. The coordinates of the upper left vertex of the original image are (0,0), the width of the original image is W1, the height is H1, and the zoom factor is R. Then the width of the cropping box is W2=W1 / R, the height is H2=H1 / R, the horizontal coordinate X of the upper left vertex of the cropping box is X=(W2-W1) / 2, and the vertical coordinate Y=(H2-H1) / 2.
[0105] For example, if the coordinates of the upper left vertex of the original image are (0,0), the width of the original image is W1=4000, the height is H1=3000, and the zoom ratio is R=2.0, then the width of the cropping box is W2=2000, the height is H2=1500, and the coordinates of the upper left vertex of the cropping box are (1000,750).
[0106] In this way, the cropping parameters can be determined by the target module without the need to set up other modules additionally; since the target module will switch to the preset software module or the preset hardware module based on the target parameters, and the preset software module and the preset hardware module may have errors when determining the cropping parameters, which will cause the image to change suddenly during the module switching process. By determining the cropping parameters through the additionally set calculation module, the cropping parameters can be unified and continuous, thereby avoiding image mutations caused by module switching and making image scaling smoother.
[0107] Thus, the electronic device can obtain target parameters in response to the first input of scaling the first image, the target parameters including at least one of the scaling ratio corresponding to the first input, the device parameters of the electronic device, and the environmental parameters of the electronic device, and then determine the target module from the preset software module and the preset hardware module according to the target parameters, and perform scaling and image enhancement processing on the first image through the target module to obtain a third image. Since the preset software module has a strong image enhancement capability and the preset hardware module has a low power consumption, a more suitable module can be selected to scale and enhance the image according to parameters such as the scaling ratio, device parameters, and / or environmental parameters, thereby effectively improving the clarity of the scaled image, and there is no need to limit the scaling ratio, so that the image scaling and clarity can better meet user needs.
[0108] It should be noted that the input in the embodiments of the present application can be a click input, a voice command input, or a specific gesture input, which can be determined according to actual use requirements, and the embodiments of the present application do not limit this. Among them, the specific gesture can be any one of a single-click gesture, a sliding gesture, a dragging gesture, a pressure recognition gesture, a long press gesture, an area change gesture, a double press gesture, and a double-click gesture; the click input can be a single-click input, a double-click input, or any number of click inputs, etc., and can also be a long press input or a short press input.
[0109] In order to better describe the entire solution, based on the above embodiments, a specific example is given. Figure 2 As shown, the image processing method may include steps 201 to 209, which are explained in detail below.
[0110] Step 201: Receive a first input for scaling a first image.
[0111] Step 202: Obtain target parameters in response to the first input.
[0112] Step 203, determining whether the target parameter meets the preset conditions.
[0113] If yes, execute step 204 ; if no, execute step 207 .
[0114] Step 204 , determining cropping parameters based on the zoom ratio through a preset software module.
[0115] Step 205 , cropping the first image according to cropping parameters using a preset software module to obtain a second image.
[0116] Step 206: Perform image enhancement processing on the second image by using a preset software module to obtain a third image.
[0117] Step 207: Determine cropping parameters based on the zoom ratio by using a preset hardware module.
[0118] Step 208: cropping the first image according to the cropping parameters through a preset hardware module to obtain a second image.
[0119] Step 209: Perform image enhancement processing on the second image by using a preset hardware module to obtain a third image.
[0120] The specific process can be found in the above embodiments and will not be described in detail here.
[0121] In order to better describe the entire solution, based on the above embodiments, another specific example is given. Figure 3 As shown, the image processing method may include steps 301 to 308, which are explained in detail below.
[0122] Step 301: Receive a first input for scaling a first image.
[0123] Step 302: In response to a first input, a calculation module determines a cropping parameter based on a zoom ratio corresponding to the first input.
[0124] Step 303, obtaining target parameters.
[0125] Step 304, determining whether the target parameter meets the preset conditions.
[0126] If yes, execute step 305 ; if no, execute step 307 .
[0127] Step 305 , cropping the first image according to cropping parameters using a preset software module to obtain a second image.
[0128] Step 306: Perform image enhancement processing on the second image by using a preset software module to obtain a third image.
[0129] Step 307 : cropping the first image according to cropping parameters through a preset hardware module to obtain a second image.
[0130] Step 308: Perform image enhancement processing on the second image by using a preset hardware module to obtain a third image.
[0131] The specific process can be found in the above embodiments and will not be described in detail here.
[0132] Thus, the electronic device can obtain target parameters in response to the first input of scaling the first image, the target parameters including at least one of the scaling ratio corresponding to the first input, the device parameters of the electronic device, and the environmental parameters of the electronic device, and then determine the target module from the preset software module and the preset hardware module according to the target parameters, and perform scaling and image enhancement processing on the first image through the target module to obtain a third image. Since the preset software module has a strong image enhancement capability and the preset hardware module has a low power consumption, a more suitable module can be selected to scale and enhance the image according to parameters such as the scaling ratio, device parameters, and / or environmental parameters, thereby effectively improving the clarity of the scaled image, and there is no need to limit the scaling ratio, so that the image scaling and clarity can better meet user needs.
[0133] The image processing method provided in the embodiment of the present application can be executed by an image processing device. In the embodiment of the present application, an image processing device executing the image processing method is taken as an example to illustrate the image processing device provided in the embodiment of the present application.
[0134] Based on the same inventive concept, the present application also provides an image processing device. Figure 4 The image processing device provided in the embodiment of the present application is described in detail.
[0135] Figure 4 The figure is a structural block diagram of an image processing device according to an exemplary embodiment.
[0136] like Figure 4 As shown, the image processing device 400 can be applied to an electronic device, and the image processing device 400 may include:
[0137] A receiving module 401 is used to receive a first input for scaling a first image;
[0138] An acquisition module 402 is used to acquire a target parameter in response to the first input, where the target parameter includes at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device;
[0139] A first determining module 403, configured to determine a target module from a plurality of preset modules according to a target parameter, wherein the plurality of preset modules include a preset software module and a preset hardware module;
[0140] A scaling module 404 is used to perform scaling processing on the first image through a target module to obtain a second image;
[0141] The image enhancement module 405 is used to perform image enhancement processing on the second image through the target module to obtain a third image.
[0142] The image processing device 400 is described in detail below, as follows:
[0143] In one embodiment, the first determining module 403 may include:
[0144] A first determination submodule, configured to determine a preset software module as a target module when a target parameter satisfies a preset condition;
[0145] The second determination submodule is used to determine the preset hardware module as the target module when the target parameter does not meet the preset condition.
[0146] In one embodiment, the scaling module 404 may include:
[0147] The cropping submodule is used to crop the first image according to the cropping parameters through the target module to obtain the second image, and the cropping parameters are determined based on the zoom ratio corresponding to the first input.
[0148] In one embodiment, the image processing device 400 may include:
[0149] A second determination module, configured to determine the cropping parameter based on a zoom ratio corresponding to the first input before the target module crops the first image according to the cropping parameter to obtain the second image;
[0150] or,
[0151] Before determining the target module from a plurality of preset modules according to the target parameter, the calculation module determines the cropping parameter based on the zoom ratio corresponding to the first input.
[0152] In one embodiment, the device parameters include available memory and / or device temperature of the electronic device, and the environmental parameters include ambient temperature and / or ambient brightness of the environment in which the electronic device is located.
[0153] In one of the embodiments, when the target parameter includes a zoom factor, the preset condition includes the zoom factor being greater than a first threshold;
[0154] In the case where the target parameter includes available memory, the preset condition includes the available memory being greater than a second threshold;
[0155] In the case where the target parameter includes device temperature, the preset condition includes the device temperature being less than a third threshold;
[0156] In the case where the target parameter includes the ambient temperature, the preset condition includes the ambient temperature being less than a fourth threshold;
[0157] In the case where the target parameter includes ambient brightness, the preset condition includes that the ambient brightness is less than a fifth threshold.
[0158] In one embodiment, the image enhancement module 405 may include:
[0159] The image enhancement submodule is used to perform image enhancement processing on the second image through the target module to obtain a third image during the video recording process of the electronic device.
[0160] Thus, the electronic device can obtain target parameters in response to the first input of scaling the first image, the target parameters including at least one of the scaling ratio corresponding to the first input, the device parameters of the electronic device, and the environmental parameters of the electronic device, and then determine the target module from the preset software module and the preset hardware module according to the target parameters, and perform scaling and image enhancement processing on the first image through the target module to obtain a third image. Since the preset software module has a strong image enhancement capability and the preset hardware module has a low power consumption, a more suitable module can be selected to scale and enhance the image according to parameters such as the scaling ratio, device parameters, and / or environmental parameters, thereby effectively improving the clarity of the scaled image, and there is no need to limit the scaling ratio, so that the image scaling and clarity can better meet user needs.
[0161] The image processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0162] The image processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0163] The image processing device provided in the embodiment of the present application can achieve Figure 1-3 The various processes implemented in the method embodiment achieve the same technical effect and will not be described again here to avoid repetition.
[0164] In some embodiments, Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, wherein the memory 502 stores programs or instructions that can be executed on the processor 501, and when the program or instructions are executed by the processor 501, the various steps of the above-mentioned image processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0165] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0166] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0167] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.
[0168] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0169] The user input unit 607 is used to receive a first input for scaling the first image;
[0170] The processor 610 is configured to obtain a target parameter in response to the first input, where the target parameter includes at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device;
[0171] Determining a target module from a plurality of preset modules according to the target parameter, the plurality of preset modules including a preset software module and a preset hardware module;
[0172] Scaling the first image through the target module to obtain a second image;
[0173] The second image is subjected to image enhancement processing by the target module to obtain a third image.
[0174] Thus, the electronic device can obtain target parameters in response to the first input of scaling the first image, the target parameters including at least one of the scaling ratio corresponding to the first input, the device parameters of the electronic device, and the environmental parameters of the electronic device, and then determine the target module from the preset software module and the preset hardware module according to the target parameters, and perform scaling and image enhancement processing on the first image through the target module to obtain a third image. Since the preset software module has a strong image enhancement capability and the preset hardware module has a low power consumption, a more suitable module can be selected to scale and enhance the image according to parameters such as the scaling ratio, device parameters, and / or environmental parameters, thereby effectively improving the clarity of the scaled image, and there is no need to limit the scaling ratio, so that the image scaling and clarity can better meet user needs.
[0175] In some embodiments, the processor 610 is further configured to determine a preset software module as a target module when the target parameter satisfies a preset condition;
[0176] When the target parameter does not satisfy the preset condition, the preset hardware module is determined as the target module.
[0177] In this way, by judging whether the target parameters meet the preset conditions, a more suitable module can be selected from the preset hardware modules and the preset software modules for image processing.
[0178] In some embodiments, the processor 610 is further configured to crop the first image according to cropping parameters through a target module to obtain a second image, where the cropping parameters are determined based on a zoom ratio corresponding to the first input.
[0179] In this way, accurate cropping of the first image can be achieved through cropping parameters determined based on the zoom ratio, thereby achieving zooming of the first image.
[0180] In some embodiments, the processor 610 is further configured to determine the cropping parameter based on the zoom ratio corresponding to the first input before the target module crops the first image according to the cropping parameter to obtain the second image;
[0181] or,
[0182] Before determining the target module from a plurality of preset modules according to the target parameter, the calculation module determines the cropping parameter based on the zoom ratio corresponding to the first input.
[0183] In this way, the cropping parameters can be determined by the target module without the need to set up other modules additionally; since the target module will switch to the preset software module or the preset hardware module based on the target parameters, and the preset software module and the preset hardware module may have errors when determining the cropping parameters, which will cause the image to change suddenly during the module switching process. By determining the cropping parameters through the additionally set calculation module, the cropping parameters can be unified and continuous, thereby avoiding image mutations caused by module switching and making image scaling smoother.
[0184] In some embodiments, the device parameters include available memory and / or device temperature of the electronic device, and the environmental parameters include ambient temperature and / or ambient brightness of the environment in which the electronic device is located.
[0185] In this way, through the above parameters that may affect image processing, a suitable module can be selected more reasonably for image processing.
[0186] In some embodiments, when the target parameter includes a zoom factor, the preset condition includes the zoom factor being greater than a first threshold;
[0187] In the case where the target parameter includes available memory, the preset condition includes the available memory being greater than a second threshold;
[0188] In the case where the target parameter includes device temperature, the preset condition includes the device temperature being less than a third threshold;
[0189] In the case where the target parameter includes the ambient temperature, the preset condition includes the ambient temperature being less than a fourth threshold;
[0190] In the case where the target parameter includes ambient brightness, the preset condition includes that the ambient brightness is less than a fifth threshold.
[0191] In this way, by setting the corresponding preset conditions for each target parameter, the selection of the target module can be more comprehensively and accurately measured, so as to more reasonably select the target module for image processing, thereby obtaining a better image effect.
[0192] In some embodiments, the processor 610 is further configured to perform image enhancement processing on the second image through the target module to obtain a third image during the process of recording video by the electronic device.
[0193] In this way, during the video recording process of the electronic device, dynamic switching of the preset software module and the preset hardware module can be achieved, thereby effectively improving the overall clarity of the recorded video.
[0194] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0195] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0196] The processor 610 may include one or more processing units; in some embodiments, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.
[0197] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0198] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory, a random access memory, a magnetic disk or an optical disk.
[0199] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0200] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0201] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned image processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0202] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0203] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0204] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. An image processing method, characterized in that: Applied to electronic equipment, the method comprises: receiving a first input for scaling a first image; In response to the first input, acquiring a target parameter, the target parameter including at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device; Determining a target module from a plurality of preset modules according to the target parameter, the plurality of preset modules including a preset software module and a preset hardware module; Performing scaling processing on the first image by the target module to obtain a second image; The second image is subjected to image enhancement processing by the target module to obtain a third image.
2. The method according to claim 1, characterized in that Determining the target module from a plurality of preset modules according to the target parameter includes: In the case where the target parameter meets a preset condition, determining the preset software module as the target module; When the target parameter does not satisfy the preset condition, the preset hardware module is determined as the target module.
3. The method according to claim 1 or 2, characterized in that: The step of scaling the first image by the target module to obtain a second image includes: The first image is cropped by the target module according to cropping parameters to obtain the second image, where the cropping parameters are determined based on a zoom ratio corresponding to the first input.
4. The method according to claim 3, characterized in that The method further comprises: Before the target module crops the first image according to the cropping parameter to obtain the second image, determining the cropping parameter based on a zoom ratio corresponding to the first input; or, The cropping parameter is determined based on the zoom ratio corresponding to the first input by a calculation module before determining the target module from a plurality of preset modules according to the target parameter.
5. The method according to claim 2, characterized in that: The device parameters include available memory and / or device temperature of the electronic device, and the environmental parameters include ambient temperature and / or ambient brightness of the environment in which the electronic device is located.
6. The method according to claim 5, characterized in that In the case where the target parameter includes the zoom ratio, the preset condition includes that the zoom ratio is greater than a first threshold; In the case where the target parameter includes the available memory, the preset condition includes that the available memory is greater than a second threshold; In the case where the target parameter includes the device temperature, the preset condition includes that the device temperature is less than a third threshold; In the case where the target parameter includes the ambient temperature, the preset condition includes that the ambient temperature is less than a fourth threshold; In a case where the target parameter includes the ambient brightness, the preset condition includes that the ambient brightness is less than a fifth threshold.
7. The method according to claim 1, characterized in that The step of performing image enhancement processing on the second image by the target module to obtain a third image includes: During the process of recording video by the electronic device, the second image is enhanced by the target module to obtain a third image.
8. An image processing device, characterized in that: Applied to electronic equipment, the device comprises: A receiving module, configured to receive a first input for scaling a first image; an acquisition module, configured to acquire a target parameter in response to the first input, the target parameter including at least one of a zoom ratio corresponding to the first input, a device parameter of the electronic device, and an environment parameter of the electronic device; A first determining module, configured to determine a target module from a plurality of preset modules according to the target parameter, wherein the plurality of preset modules include a preset software module and a preset hardware module; A scaling module, used for scaling the first image through the target module to obtain a second image; The image enhancement module is used to perform image enhancement processing on the second image through the target module to obtain a third image.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the image processing method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image processing method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Preview image processing method and system of MT (Mobile Terminal) camera
CN104702846A
Image dynamic contrast enhancement method based on augmented reality and augmented reality glasses
CN110728631A
Photographing preview method and electronic equipment
CN110784654A
Video display control method and device, equipment, medium and product
CN116095355A
Image processing apparatus and image processing method
US20140063350A1