CN111179161A - Picture scaling processing method and device and electronic equipment - Google Patents

Picture scaling processing method and device and electronic equipment Download PDF

Info

Publication number
CN111179161A
CN111179161A CN201811333856.5A CN201811333856A CN111179161A CN 111179161 A CN111179161 A CN 111179161A CN 201811333856 A CN201811333856 A CN 201811333856A CN 111179161 A CN111179161 A CN 111179161A
Authority
CN
China
Prior art keywords
picture
reference value
scaling
adjusted
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811333856.5A
Other languages
Chinese (zh)
Other versions
CN111179161B (en
Inventor
童飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811333856.5A priority Critical patent/CN111179161B/en
Publication of CN111179161A publication Critical patent/CN111179161A/en
Application granted granted Critical
Publication of CN111179161B publication Critical patent/CN111179161B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof

Abstract

The embodiment of the invention provides a picture zooming processing method and device and electronic equipment. The method comprises the following steps: determining a zooming parameter to be adjusted of the picture according to the attribute of the picture; determining a reference value for scaling the picture; and carrying out zooming processing on the picture according to the reference value, so that the zooming parameters to be adjusted of the picture conform to the reference value. According to the embodiment of the invention, the zoom parameter to be adjusted of the picture is accurately determined according to the attribute of the picture, and the zoom adjustment can be automatically carried out on the picture according to the specific requirement (reference value), so that the defects caused by manual adjustment of the picture are avoided, the adjustment precision is improved, the labor cost is reduced, and the working efficiency is improved.

Description

Picture scaling processing method and device and electronic equipment
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for processing image zooming, and an electronic device.
Background
In the prior art, there is a common practical application that the size of the whole picture is adjusted according to a specific area of a picture for a specific purpose (e.g., visual effect).
For example, enterprise logos are displayed on a logo wall, the sizes of different enterprise logos are in different proportions, and ideally all the logos are expected to look equal in area (visually rather than real area), so that the logo is attractive and the brand on the wall can be perceived as fair.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems: in the prior art, the picture size is adjusted according to the area of a specific region, usually manually. I.e. viewed by the human eye, and then the picture is manually scaled. This results in low precision, high labor costs, and low efficiency of adjustment.
Disclosure of Invention
The embodiment of the invention provides a picture scaling processing method and device and electronic equipment, and aims to overcome the defects of low adjustment accuracy, high labor cost and low efficiency caused by manual adjustment of the size of a picture according to the area of a specific region in the prior art.
To achieve the above object, an embodiment of the present invention provides a method for scaling a picture, including:
determining a zooming parameter to be adjusted of the picture according to the attribute of the picture;
determining a reference value for scaling the picture;
and carrying out zooming processing on the picture according to the reference value, so that the zooming parameters to be adjusted of the picture conform to the reference value.
An embodiment of the present invention further provides an apparatus for scaling a picture, including:
the parameter determining module is used for determining the zooming parameters to be adjusted of the picture according to the attributes of the picture;
a reference value determining module, configured to determine a reference value for performing scaling processing on the picture;
and the zooming processing module is used for zooming the picture according to the reference value so that the zooming parameters to be adjusted of the picture conform to the reference value.
An embodiment of the present invention further provides an electronic device, including:
a memory for storing a program;
a processor for executing the program stored in the memory for:
determining a zooming parameter to be adjusted of the picture according to the attribute of the picture;
determining a reference value for scaling the picture;
and carrying out zooming processing on the picture according to the reference value, so that the zooming parameters to be adjusted of the picture conform to the reference value.
According to the method and the device for processing the zooming of the picture and the electronic equipment, the zooming parameter to be adjusted of the picture is accurately determined according to the attribute of the picture, and the picture can be automatically zoomed and adjusted according to the specific requirement (reference value), so that the defects caused by manual adjustment of the picture are avoided, the adjusting precision is improved, the labor cost is reduced, and the working efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic diagram of a method for scaling a picture according to an embodiment of the present invention;
fig. 2 is a system block diagram of a service system provided in an embodiment of the present invention;
FIG. 3 is a flowchart of an embodiment of a method for scaling an image according to the present invention;
FIG. 4 is a flowchart illustrating an image scaling method according to another embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for scaling a picture according to another embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an embodiment of an apparatus for scaling an image according to the present invention;
FIG. 7 is a schematic structural diagram of an image scaling apparatus according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the prior art, when a picture is processed according to a specific area, a designer is required to observe the picture through human eyes and then manually zoom the picture. This results in low precision, high labor costs, and low efficiency of adjustment. To overcome the defects in the prior art, the present application provides a picture scaling processing scheme, which has the following main principles: and then, according to the scaling parameter to be adjusted, automatically carrying out scaling adjustment operation on the picture according to a specific requirement (reference value) so as to enable the scaling parameter to be adjusted of the picture to accord with the specific reference value. In an embodiment of the present invention, the attributes of the picture include, but are not limited to: pixel value, transparency, resolution, hue, saturation, brightness, etc. of the picture. The zoom parameter to be adjusted of the picture refers to an adjustment feature object obtained according to one or more of the above attributes of the picture and used for performing zoom adjustment on the picture, for example, a specific area of the picture (a visual area, a portrait area, etc. of the picture). When the zoom parameter to be adjusted of the picture is the visual area, the zoom parameter can be obtained by using the pixel value and the transparency value of each pixel point in the picture. Fig. 1 is a schematic diagram of a picture scaling processing method according to an embodiment of the present invention. As shown in fig. 1, for example, it is assumed that a specific application scenario is to adjust the pictures (a), (b), and (c) to be pictures that look the same, that is, to make the visual areas of the three adjusted pictures equal. Wherein, the picture (a) is a rectangular picture, and the colored pattern in the picture is filled in the whole picture (namely, no white or transparent color area exists in the picture); the picture (b) is a square picture, and the colored pattern in the picture is a circle with the diameter equal to the side length of the square (the area outside the circle is white or transparent); the picture (c) is a rectangular picture, and the colored pattern in the picture is a cross-shaped pattern (the area outside the cross shape is white or transparent). According to the scheme of the present invention, the RGB value or RGBA value of each pixel point in the three pictures is respectively identified, and the areas of the areas outside the white (e.g., pixel point with pixel value # fff) area and the full-transparent area in the pictures (i.e., the rectangular area in the picture (a), the circular area in the picture (b), and the cross area in the picture (c)) are counted and respectively determined as the scaling parameters (i.e., the visual areas) to be adjusted for the pictures (a), (b), and (c). And then, adjusting the size of the pictures to be processed one by one or in batches according to a preset reference value or a reference value calculated in real time. It is assumed that the visual area of the picture (c) is determined to be the smallest by calculation, and is determined as a reference value. The visual area of the picture is accurately determined through the attribute of the pixel point in each picture, and the picture can be automatically zoomed and adjusted according to specific requirements (the reference value), so that the defects caused by manual picture adjustment are avoided, the adjustment precision is improved, the labor cost is reduced, and the working efficiency is improved.
The method provided by the embodiment of the invention can be applied to any business system with an image processing function. Fig. 2 is a system block diagram of a service system provided in an embodiment of the present invention, and the structure shown in fig. 2 is only one example of a service system to which the technical solution of the present invention can be applied. As shown in fig. 2, the business system includes an image processing apparatus. The device includes: the parameter determination module, the reference value determination module, and the scaling processing module may be configured to perform the processing flows shown in fig. 3, 4, and 5, which are described below. In the business system, firstly, the scaling parameters to be adjusted of the picture are determined according to the attribute of the picture; meanwhile, determining a reference value for scaling the picture; and then, carrying out zooming processing on the picture to be processed according to the reference value, so that the zooming parameters to be adjusted of the picture conform to the reference value. The business system accurately determines the zoom parameters (specific area) of the picture to be adjusted according to the attributes of the picture, and can automatically implement zoom adjustment on the picture according to specific requirements (reference values), so that the defects caused by manual adjustment of the picture are avoided, the adjustment precision is improved, the labor cost is reduced, and the working efficiency is improved.
The above embodiments are illustrations of technical principles and exemplary application frameworks of the embodiments of the present invention, and specific technical solutions of the embodiments of the present invention are further described in detail below through a plurality of embodiments.
Example one
Fig. 3 is a flowchart of an embodiment of a method for processing zoom of a picture provided by the present invention, where an execution subject of the method may be the service system, various terminal devices having an image processing function, or a device or a chip integrated on the terminal devices. As shown in fig. 3, the method for scaling an image includes the following steps:
s301, determining the zooming parameters to be adjusted of the picture according to the attributes of the picture.
In the embodiment of the invention, different zooming parameters to be adjusted can be determined according to different application scenes and the attributes of the pictures. For example, in an application scenario in which the size of a photo is adjusted according to the portrait area in a portrait photo, the portrait area is a zoom parameter to be adjusted of the photo. In the application scenario, a region outside the background region in the picture may be acquired as the zoom parameter to be adjusted. For another example, in an application scenario in which the size of the picture is adjusted according to the visual area, the area (i.e., the visual area) of the area outside the white area and the fully transparent area in the picture may be obtained according to the pixel value and the transparency value of each pixel point in the picture, and the area may be used as the scaling parameter to be adjusted.
S302, a reference value for scaling the picture is determined.
In the embodiment of the present invention, the reference value may be preset, or the scaling parameter to be adjusted of one picture may be selected as the reference value from a plurality of pictures to be processed.
It should be noted that, in the embodiment of the present invention, when the reference value is a preset value, the execution sequence of the steps S301 and S302 is not sequential, and the step S301 may be executed first and then the step S302 is executed, or the step S302 may be executed first and then the step S301 is executed, or may be executed simultaneously.
And S303, zooming the picture according to the reference value to enable the zooming parameter to be adjusted of the picture to accord with the reference value.
After the reference value used for scaling the pictures is determined, the pictures to be processed are adjusted one by one or in batch according to the reference value, so that the scaling parameters to be adjusted of the pictures conform to the reference value, for example, the scaling parameters to be adjusted of each picture can be all equal to the reference value, or when the picture area of a certain picture is large and the scaling parameters to be adjusted are small, the scaling parameters to be adjusted of the picture can be smaller than the reference value.
According to the image zooming processing method provided by the embodiment of the invention, the zooming parameter (specific area) to be adjusted of the image is accurately determined according to the attribute of the image, and the image can be automatically zoomed and adjusted according to the specific requirement (reference value), so that the defects caused by manual image adjustment are avoided, the adjusting precision is improved, the labor cost is reduced, and the working efficiency is improved.
Example two
Fig. 4 is a flowchart of another embodiment of a picture scaling processing method according to the present invention. As shown in fig. 4, on the basis of the embodiment shown in fig. 3, the method for processing image scaling provided in this embodiment may further include the following steps:
s401, aiming at each picture in a plurality of pictures to be processed, obtaining the zooming parameters to be adjusted of each picture according to the attribute of each picture.
In the embodiment of the invention, when a plurality of pictures to be processed exist, firstly, the zooming parameters to be adjusted of each picture are respectively obtained according to the attribute of each picture. Specifically, the attributes of the picture may include, but are not limited to: and the pixel value and/or the transparency value of each pixel point in the picture.
S402, selecting the scaling parameter to be adjusted of one picture as a reference value from a plurality of pictures to be processed.
Specifically, the smallest scaling parameter to be adjusted may be selected as the reference value from the plurality of pictures to be processed. Of course, in order to avoid that all the pictures look small due to the minimum to-be-adjusted scaling parameter being too small, the scaling parameter to be adjusted with the middle size may be selected from the multiple to-be-processed pictures, or the minimum to-be-adjusted scaling parameter not lower than the preset area threshold may be selected as the reference value.
And S403, calculating the target length and width of the picture to be processed.
Specifically, the target length and width of the picture can be calculated according to the following formulas (1) and (2):
A/B=a/b………………………………………………………………...(1)
a*b*p=S………………………………………………………………..(2)
the method comprises the steps of obtaining a scaling parameter of a picture, wherein A and B are the original length and width of the picture respectively, a and B are the target length and width of the picture respectively, p is the proportion of the scaling parameter to be adjusted of the picture in the original area of the picture, and S is a reference value. Specifically, the ratio p of the to-be-adjusted scaling parameter of the picture to the original area of the picture can be obtained by calculation according to the number of pixel points covered by the to-be-adjusted scaling parameter and the total number of pixel points of the whole picture.
S404, zooming the picture according to the target length and width of the picture to be processed.
According to the image zooming processing method provided by the embodiment of the invention, the zooming parameters (specific area) to be adjusted of the image are accurately determined according to the attributes of the image, the reference value for adjusting the size of each image is determined according to the zooming parameters to be adjusted of a plurality of images to be processed, and the zooming adjustment can be automatically carried out on the image according to the reference value, so that the defects caused by manual image adjustment are avoided, the adjusting precision is improved, the labor cost is reduced, and the working efficiency is improved.
EXAMPLE III
Fig. 5 is a flowchart of another embodiment of a picture scaling method according to the present invention. As shown in fig. 5, on the basis of the embodiments shown in fig. 3 and fig. 4, the method for processing image scaling provided by this embodiment may further include the following steps:
s501, according to the pixel value and the transparency value of each pixel point in the picture, determining the area of a region outside a white region and a full-transparent region in the picture as a scaling parameter to be adjusted of the picture.
The method and the device can be applied to application scenes for adjusting the size of the picture according to the visual area. Firstly, for each picture to be processed, according to the pixel value and the transparency value of each pixel point in the picture, determining the area (namely, the visual area) of the area outside the white area and the full transparent area in the picture as the scaling parameter to be adjusted of the picture.
And S502, selecting the minimum zooming parameter to be adjusted from the plurality of pictures to be processed as a reference value.
Of course, other selection criteria may also be adopted when determining the reference value, and the detailed description refers to the embodiment shown in fig. 4, which is not described herein again.
And S503, calculating the target length and width of the picture to be processed, so that the scaling parameters to be adjusted of each picture are equal to the reference value.
S504, zooming the picture according to the target length and width of the picture to be processed.
In the embodiment of the present invention, steps S503 to S504 are the same as steps S403 and S404 in the embodiment shown in fig. 4, and are not described again here.
In addition, in the picture scaling processing method provided by the embodiment of the present invention, a picture container may also be set.
In the embodiment of the present invention, a picture container may be preset, so that when the picture is scaled in step S504, the target length and width of the picture do not exceed the length specified by the picture container.
Of course, the to-be-processed pictures may be scaled to the size of the container in advance in an equal ratio (that is, any edge of the picture does not exceed the length specified by the container), then a reference picture is selected from each picture, and if the picture with the minimum to-be-adjusted scaling parameter is selected as the reference picture, the rest of the pictures are scaled down so that the to-be-adjusted scaling parameter is equal to the reference value; if the selected reference picture is not the picture with the minimum zooming parameter to be adjusted, only the picture with the larger reference value is subjected to zooming-out operation, and the rest pictures are not processed, so that the size of each picture is ensured not to exceed the picture container.
According to the image zooming processing method provided by the embodiment of the invention, the visual area of the image is accurately determined through the pixel value and the transparency value of each pixel point in the image, the reference value for adjusting the size of each image is determined according to the visual areas of a plurality of images to be processed, and the zooming adjustment can be automatically carried out on the image according to the reference value, so that the defects caused by manual image adjustment are avoided, the adjustment precision is improved, the labor cost is reduced, and the working efficiency is improved.
Example four
Fig. 6 is a schematic structural diagram of an embodiment of a picture scaling apparatus according to the present invention, which can be used to execute the method steps shown in fig. 3. As shown in fig. 6, the picture scaling processing apparatus may include: a parameter determination module 61, a reference value determination module 62 and a scaling processing module 63.
The parameter determining module 61 is configured to determine, according to an attribute of a picture, a scaling parameter to be adjusted of the picture; the reference value determining module 62 is configured to determine a reference value for performing scaling processing on the picture; the scaling module 63 is configured to scale the picture according to the reference value, so that the scaling parameter to be adjusted of the picture conforms to the reference value.
In the embodiment of the present invention, the parameter determining module 61 may determine different scaling parameters to be adjusted according to different application scenarios and according to the attributes of the pictures. Specifically, the attributes of the picture may include, but are not limited to: and the pixel value and/or the transparency value of each pixel point in the picture. For example, in an application scenario in which the size of a photo is adjusted according to the portrait area in a portrait photo, the portrait area is a zoom parameter to be adjusted of the photo. In this application scenario, the parameter determining module 61 may obtain a region outside the background region in the picture as the zoom parameter to be adjusted. For another example, in an application scenario in which the size of the picture is adjusted according to the visual area, the parameter determining module 61 may obtain area (i.e., the visual area) outside a white area and a fully transparent area in the picture according to the pixel value and the transparency value of each pixel point in the picture, and use the area as the scaling parameter to be adjusted.
After the parameter determining module 61 determines the scaling parameters to be adjusted of the pictures and the reference value determining module 62 determines the reference value for scaling the pictures, the scaling module 63 may scale the pictures to be processed one by one or in batches according to the reference value, so that the scaling parameters to be adjusted of the pictures conform to the reference value, for example, the scaling parameters to be adjusted of each picture may be equal to the reference value, or when the picture area of a certain picture is large and the scaling parameters to be adjusted are small, the scaling parameters to be adjusted of the picture may be smaller than the reference value.
The image zooming processing device provided by the embodiment of the invention can accurately determine the zooming parameters (specific area) to be adjusted of the image according to the attributes of the image, and can automatically zoom and adjust the image according to the specific requirements (reference values), thereby avoiding the defects caused by manually adjusting the image, improving the adjusting precision, reducing the labor cost and improving the working efficiency.
EXAMPLE five
Fig. 7 is a schematic structural diagram of another embodiment of the image scaling apparatus according to the present invention, which can be used to execute the method steps shown in fig. 4 and fig. 5. As shown in fig. 7, based on the embodiment shown in fig. 6, the reference value determining module 62 may include: a first obtaining unit 621, where the first obtaining unit 621 may be configured to obtain a preset reference value.
In the embodiment of the present invention, the reference value may be preset, and then the parameter determining module 61 may obtain the scaling parameter to be adjusted of the picture to be processed in real time, and then the scaling processing module 63 performs scaling processing on the picture in real time.
On the other hand, in the embodiment of the present invention, the reference value determining module 62 may further include: a second obtaining unit 622. The second obtaining unit 622 may be configured to, for each of the multiple pictures to be processed, obtain the scaling parameter to be adjusted of each picture according to the attribute of each picture, and select the scaling parameter to be adjusted of one picture from the multiple pictures to be processed as the reference value.
Specifically, the second obtaining unit 622 may be configured to select a smallest scaling parameter to be adjusted from the plurality of pictures to be processed as the reference value. Of course, in order to avoid that all the pictures look very small due to the minimum to-be-adjusted scaling parameter being too small, the second obtaining unit 622 may also select, as the reference value, the scaling parameter to be adjusted with a middle size or the minimum to-be-adjusted scaling parameter not lower than the preset area threshold from the multiple to-be-processed pictures.
In addition, the parameter determining module 61 may be further specifically configured to determine, according to the pixel value and the transparency value of each pixel point in the picture, an area outside a white area and a fully transparent area in the picture as a scaling parameter to be adjusted of the picture.
In the embodiment of the invention, the method can be applied to an application scene of adjusting the picture size according to the visual area. That is, for each to-be-processed picture, the parameter determining module 61 determines, as the to-be-adjusted scaling parameter of the picture, the area (i.e., the visual area) of the region outside the white region and the fully transparent region in the picture according to the pixel value and the transparency value of each pixel point in the picture.
In this embodiment of the present invention, the scaling module 63 may include: a computing unit 631 and a processing unit 632. The calculating unit 631 may be configured to calculate the target length and width of the picture according to the original length and width of the picture, the ratio of the scaling parameter to be adjusted of the picture to the original area of the picture, and the reference value, and specifically, may calculate the target length and width of the picture according to the following formula:
A/B=a/b………………………………………………………………...(1)
a*b*p=S………………………………………………………………..(2)
the method comprises the steps of obtaining a scaling parameter of a picture, wherein A and B are the original length and width of the picture respectively, a and B are the target length and width of the picture respectively, p is the proportion of the scaling parameter to be adjusted of the picture in the original area of the picture, and S is a reference value.
The processing unit 632 may be configured to perform scaling processing on the picture according to the target length and width of the picture.
In addition, the image scaling processing apparatus provided in the embodiment of the present invention may further include: the container setup module 71. The container setting module 71 may be configured to set a picture container, so that when the scaling module 63 scales the picture, the target length and width of the picture do not exceed the length specified by the picture container.
Of course, the picture to be processed may be scaled to the size of the container in advance in an equal ratio (that is, any edge of the picture does not exceed the length specified by the container), then the parameter determining module 61 calculates the scaling parameter to be adjusted of the picture after the equal ratio scaling, the reference value determining module 62 selects the reference picture therein, and if the picture with the minimum scaling parameter to be adjusted is selected as the reference picture, the rest of the pictures are scaled down so that the scaling parameter to be adjusted is equal to the reference value; if the selected reference picture is not the picture with the minimum zooming parameter to be adjusted, only the picture with the larger reference value is subjected to zooming-out operation, and the rest pictures are not processed, so that the size of each picture is ensured not to exceed the picture container.
The image zooming processing device provided by the embodiment of the invention can accurately determine the zooming parameters (specific area) to be adjusted of the image according to the attributes of the image, determine the reference value for adjusting the size of each image according to the zooming parameters to be adjusted of a plurality of images to be processed, and automatically zoom and adjust the image according to the reference value, thereby avoiding the defects caused by manually adjusting the image, improving the adjusting precision, reducing the labor cost and improving the working efficiency.
EXAMPLE six
The internal functions and structure of the picture scaling processing apparatus, which can be implemented as an electronic device, are described above. Fig. 8 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention. As shown in fig. 8, the electronic device includes a memory 81 and a processor 82.
The memory 81 stores programs. In addition to the above-described programs, the memory 81 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 81 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 82, coupled to the memory 81, for executing programs stored in the memory 81 for:
determining a zooming parameter to be adjusted of the picture according to the attribute of the picture;
determining a reference value for scaling the picture;
and carrying out zooming processing on the picture according to the reference value so that the zooming parameters to be adjusted of the picture conform to the reference value.
Further, as shown in fig. 8, the electronic device may further include: communication components 83, power components 84, audio components 85, a display 86, and the like. Only some of the components are schematically shown in fig. 8, and the electronic device is not meant to include only the components shown in fig. 8.
The communication component 83 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 83 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 83 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 84 provides power to the various components of the electronic device. The power components 84 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for an electronic device.
The audio component 85 is configured to output and/or input audio signals. For example, the audio component 85 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 81 or transmitted via the communication component 83. In some embodiments, audio assembly 85 also includes a speaker for outputting audio signals.
The display 86 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (15)

1. A picture scaling processing method is characterized by comprising the following steps:
determining a zooming parameter to be adjusted of the picture according to the attribute of the picture;
determining a reference value for scaling the picture;
and carrying out zooming processing on the picture according to the reference value, so that the zooming parameters to be adjusted of the picture conform to the reference value.
2. The method according to claim 1, wherein the determining a reference value for scaling the picture comprises:
and acquiring a preset reference value.
3. The method according to claim 1, wherein the determining a reference value for scaling the picture comprises:
aiming at each picture in a plurality of pictures to be processed, obtaining a scaling parameter to be adjusted of each picture according to the attribute of each picture;
and selecting the scaling parameter to be adjusted of one picture from the plurality of pictures to be processed as the reference value.
4. The method according to claim 3, wherein selecting the scaling parameter to be adjusted of one of the pictures to be processed as the reference value comprises:
and selecting the minimum scaling parameter to be adjusted from the plurality of pictures to be processed as the reference value.
5. The method according to claim 3, wherein selecting the scaling parameter to be adjusted of one of the pictures to be processed as the reference value comprises:
and selecting the scaling parameter to be adjusted with the middle size or the minimum scaling parameter to be adjusted which is not lower than a preset area threshold value from the plurality of pictures to be processed as the reference value.
6. The method according to claim 1, wherein the attributes of the picture comprise: and the pixel value and/or the transparency value of each pixel point in the picture.
7. The method according to claim 6, wherein the determining the scaling parameter to be adjusted according to the attribute of the picture comprises:
and determining the area of the area outside the white area and the full transparent area in the picture as the scaling parameter to be adjusted of the picture according to the pixel value and the transparency value of each pixel point in the picture.
8. The method according to any one of claims 1 to 7, wherein the scaling the picture according to the reference value so that the scaling parameter to be adjusted of the picture conforms to the reference value comprises:
calculating the target length and width of the picture according to the original length and width of the picture, the proportion of the scaling parameters to be adjusted of the picture in the original area of the picture and the reference value;
and carrying out zooming processing on the picture according to the target length and width of the picture.
9. The picture scaling method according to claim 1, further comprising:
and setting a picture container, so that when the picture is zoomed, the target length and width of the picture do not exceed the length specified by the picture container.
10. A picture scaling processing apparatus, comprising:
the parameter determining module is used for determining the zooming parameters to be adjusted of the picture according to the attributes of the picture;
a reference value determining module, configured to determine a reference value for performing scaling processing on the picture;
and the zooming processing module is used for zooming the picture according to the reference value so that the zooming parameters to be adjusted of the picture conform to the reference value.
11. The picture scaling processing apparatus according to claim 10, wherein the reference value determining module includes:
a first acquisition unit configured to acquire a reference value set in advance.
12. The picture scaling processing apparatus according to claim 10, wherein the reference value determining module includes:
and the second obtaining unit is used for obtaining the scaling parameters to be adjusted of each picture according to the attribute of each picture aiming at each picture in the plurality of pictures to be processed, and selecting the scaling parameters to be adjusted of one picture from the plurality of pictures to be processed as the reference value.
13. The picture scaling processing apparatus according to any one of claims 10 to 12, wherein the scaling processing module comprises:
the calculating unit is used for calculating the target length and width of the picture according to the original length and width of the picture, the proportion of the scaling parameters to be adjusted of the picture in the original area of the picture and the reference value;
and the processing unit is used for carrying out scaling processing on the picture according to the target length and width of the picture.
14. The picture scaling apparatus according to claim 10, further comprising:
and the container setting module is used for setting a picture container so that the target length and width of the picture do not exceed the length specified by the picture container when the picture is zoomed.
15. An electronic device, comprising:
a memory for storing a program;
a processor for executing the program stored in the memory for:
determining a zooming parameter to be adjusted of the picture according to the attribute of the picture;
determining a reference value for scaling the picture;
and carrying out zooming processing on the picture according to the reference value, so that the zooming parameters to be adjusted of the picture conform to the reference value.
CN201811333856.5A 2018-11-09 2018-11-09 Picture scaling processing method and device and electronic equipment Active CN111179161B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811333856.5A CN111179161B (en) 2018-11-09 2018-11-09 Picture scaling processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811333856.5A CN111179161B (en) 2018-11-09 2018-11-09 Picture scaling processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111179161A true CN111179161A (en) 2020-05-19
CN111179161B CN111179161B (en) 2023-04-28

Family

ID=70649867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811333856.5A Active CN111179161B (en) 2018-11-09 2018-11-09 Picture scaling processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111179161B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130148880A1 (en) * 2011-12-08 2013-06-13 Yahoo! Inc. Image Cropping Using Supervised Learning
WO2014206125A1 (en) * 2013-06-28 2014-12-31 北京奇虎科技有限公司 Method and device for aligning zoomed webpage on electronic device
CN104657482A (en) * 2015-02-26 2015-05-27 深圳市中兴移动通信有限公司 Method for displaying application interface and terminal
CN104679466A (en) * 2013-11-29 2015-06-03 腾讯科技(深圳)有限公司 Image display method and device and electronic device
CN105981366A (en) * 2014-02-12 2016-09-28 索尼公司 A method for presentation of images
CN106227825A (en) * 2016-07-22 2016-12-14 努比亚技术有限公司 A kind of image display apparatus and method
CN107610677A (en) * 2017-10-16 2018-01-19 上海斐讯数据通信技术有限公司 A kind of method and system that dimension of picture is designed according to display terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130148880A1 (en) * 2011-12-08 2013-06-13 Yahoo! Inc. Image Cropping Using Supervised Learning
WO2014206125A1 (en) * 2013-06-28 2014-12-31 北京奇虎科技有限公司 Method and device for aligning zoomed webpage on electronic device
CN104679466A (en) * 2013-11-29 2015-06-03 腾讯科技(深圳)有限公司 Image display method and device and electronic device
CN105981366A (en) * 2014-02-12 2016-09-28 索尼公司 A method for presentation of images
CN104657482A (en) * 2015-02-26 2015-05-27 深圳市中兴移动通信有限公司 Method for displaying application interface and terminal
CN106227825A (en) * 2016-07-22 2016-12-14 努比亚技术有限公司 A kind of image display apparatus and method
CN107610677A (en) * 2017-10-16 2018-01-19 上海斐讯数据通信技术有限公司 A kind of method and system that dimension of picture is designed according to display terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邹盼盼等: "基于主体区域保持的图像缩放算法" *

Also Published As

Publication number Publication date
CN111179161B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
US10334153B2 (en) Image preview method, apparatus and terminal
CN108986199B (en) Virtual model processing method and device, electronic equipment and storage medium
RU2578210C1 (en) Method and device for correcting skin colour
US9401036B2 (en) Photographing apparatus and method
US8948505B2 (en) Image processing apparatus, image processing method, program and imaging apparatus
US8497920B2 (en) Method, apparatus, and computer program product for presenting burst images
US20140218552A1 (en) Electronic device and image composition method thereof
JP7166171B2 (en) INTERFACE IMAGE DISPLAY METHOD, APPARATUS AND PROGRAM
EP2993888A1 (en) Method, device, and terminal for image processing
US8704929B2 (en) System and method for user guidance of photographic composition in image acquisition systems
CN107591134B (en) MURA phenomenon compensation method, television and computer readable storage medium
CN111213363A (en) Terminal photographing control method, mobile terminal and readable storage medium
CN105654424B (en) Adjustment ratio display methods, display system, display device and the terminal of image
US8983227B2 (en) Perspective correction using a reflection
US9665925B2 (en) Method and terminal device for retargeting images
KR20160024606A (en) Apparatus and method for providing preview image
CN112948048A (en) Information processing method, information processing device, electronic equipment and storage medium
US20150206282A1 (en) Image processing device, image processing method, and image processing program
CN111179161B (en) Picture scaling processing method and device and electronic equipment
CN113992863B (en) Automatic exposure method, device, electronic equipment and computer readable storage medium
CN115100253A (en) Image comparison method, device, electronic equipment and storage medium
US20190007666A1 (en) Image details processing method, apparatus, terminal, and storage medium
CN113920083A (en) Image-based size measurement method and device, electronic equipment and storage medium
US11622078B2 (en) Method and apparatus for image formation using preview images
US10163190B2 (en) Screen display ratio adjusting apparatus and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40030569

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant