[go: up one dir, main page]

CN112685680A - Picture adding method and device - Google Patents

Picture adding method and device Download PDF

Info

Publication number
CN112685680A
CN112685680A CN202110032963.XA CN202110032963A CN112685680A CN 112685680 A CN112685680 A CN 112685680A CN 202110032963 A CN202110032963 A CN 202110032963A CN 112685680 A CN112685680 A CN 112685680A
Authority
CN
China
Prior art keywords
picture
pictures
added
determining
input
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.)
Pending
Application number
CN202110032963.XA
Other languages
Chinese (zh)
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.)
Shanghai Observer Information Technology Co ltd
Original Assignee
Shanghai Observer Information Technology Co 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 Shanghai Observer Information Technology Co ltd filed Critical Shanghai Observer Information Technology Co ltd
Priority to CN202110032963.XA priority Critical patent/CN112685680A/en
Publication of CN112685680A publication Critical patent/CN112685680A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a picture adding method and device, relates to the technical field of text editing, and solves the problem of low picture adding efficiency. The picture adding method comprises the following steps: under the condition that first input of a user is received, determining keywords of an edited text in response to the first input, and determining M pictures to be added corresponding to the keywords; displaying N pictures to be added in the M pictures to be added according to the relevance; under the condition that second input of a user on a first picture in the N pictures to be added is received, responding to the second input, and cutting the first picture according to preset size information to obtain a second picture; displaying a second picture at a preset position; wherein M is greater than or equal to N, and M, N is an integer greater than 0.

Description

Picture adding method and device
Technical Field
The invention relates to the technical field of text editing, in particular to a speed limiting method and device.
Background
When text editing is performed, a cover page is usually added to beautify the effect of the article displayed on the front listing page.
In the prior art, the pictures need to be manually searched on each webpage, and the searched pictures need to be processed by using picture editing software after being searched so as to meet the picture size required by a website.
Accordingly, those skilled in the art have endeavored to develop a picture adding method and apparatus that can improve picture adding efficiency.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the technical problems to be solved by the present invention are: how to improve the picture adding efficiency.
In order to achieve the purpose, the invention adopts the following technical scheme:
in a first aspect, the present invention provides a picture adding method, including: under the condition that first input of a user is received, determining keywords of an edited text in response to the first input, and determining M pictures to be added corresponding to the keywords; displaying N pictures to be added in the M pictures to be added according to the relevance; under the condition that second input of a user on a first picture in the N pictures to be added is received, responding to the second input, and cutting the first picture according to preset size information to obtain a second picture; displaying a second picture at a preset position; wherein M is greater than or equal to N, and M, N is an integer greater than 0.
In a preferred embodiment of the present invention, determining keywords for editing the text may include at least one of: receiving a keyword input by a user; and determining high-frequency words in the edited text, and determining a first number of high-frequency words as the key words according to the frequency of occurrence.
In a preferred embodiment of the present invention, after determining M to-be-added pictures corresponding to the keyword, the method further includes: if the M is larger than a first threshold value, adding at least one high-frequency word as the keyword according to the frequency of occurrence until K pictures to be added which are smaller than or equal to the first threshold value are obtained; the displaying N to-be-added pictures in the M to-be-added pictures according to the relevance comprises the following steps: displaying N pictures to be added in the K pictures to be added according to the relevance; wherein M is greater than or equal to K, K is greater than or equal to N, and K is an integer greater than 0.
In a preferred embodiment of the present invention, the cropping the first picture according to the preset size information to obtain a second picture, includes: adjusting the aspect ratio of the first picture to the aspect ratio corresponding to the preset size information to obtain a third picture; and cutting the third picture according to the pixel difference of the pixel points in the third picture to obtain a second picture with a preset size.
In a preferred embodiment of the present invention, the clipping the third picture according to the pixel difference of the pixel point in the third picture to obtain a second picture with a preset size includes: executing a first operation on each pixel point in the third picture to obtain color difference values of all the pixel points; the first operation includes: determining absolute color difference between a target pixel point and an adjacent pixel point according to the three primary colors of the pixels, and determining the color difference value of the target pixel point according to the absolute color difference, wherein the target pixel point is any one pixel point in the third picture; cutting continuous pixel points of which the color difference values are smaller than a second threshold value in the edge area of the third picture to obtain a fourth picture; determining a pixel average point of the fourth picture; and extending the pixel average point to the periphery to obtain a second picture with a preset size.
In the embodiment of the invention, under the trigger of the first input of the user, M pictures to be added can be determined according to the determined key words, N pictures to be added with highest relevance in the M pictures to be added are displayed, the user can select one picture from the N pictures to be added according to personal desire, and the cutting operation of the picture is triggered, so that the picture with the preset size is obtained. According to the scheme, on one hand, M to-be-added pictures can be determined according to the keywords, so that the M to-be-added pictures with high association can be rapidly determined even under the condition of a large search range; on the other hand, the user can select one picture from the N pictures to be added with the highest relevance degree, so that the accuracy and the efficiency of picture selection can be improved; on the other hand, since the first picture can be cropped according to the preset size information, the efficiency of the picture adding operation is further improved.
In a second aspect, the present invention provides a picture adding apparatus, including: the device comprises a receiving unit, a processing unit and a display unit; the receiving unit is used for receiving a first input of a user; the processing unit is used for responding to the first input, determining a keyword of an edited text and determining M pictures to be added corresponding to the keyword; the display unit is used for displaying N pictures to be added in the M pictures to be added according to the relevance; the receiving unit is also used for receiving second input of a user to a first picture in the N pictures to be added; the processing unit is also used for responding to the second input and cutting the first picture according to preset size information to obtain a second picture; the display unit is also used for displaying the second picture at a preset position; wherein M is greater than or equal to N, and M, N is an integer greater than 0.
In a preferred embodiment of the present invention, the processing unit may be specifically configured to perform at least one of the following: receiving a keyword input by a user; and determining high-frequency words in the edited text, and determining a first number of high-frequency words as the key words according to the frequency of occurrence.
In a preferred embodiment of the present invention, after determining M to-be-added pictures corresponding to the keyword, if M is greater than a first threshold, adding at least one high-frequency word as the keyword according to the frequency of occurrence until K to-be-added pictures smaller than or equal to the first threshold are obtained; the display unit is specifically used for displaying N pictures to be added in the K pictures to be added according to the relevance; wherein M is greater than or equal to K, K is greater than or equal to N, and K is an integer greater than 0.
In a preferred embodiment of the present invention, the processing unit may be specifically configured to: adjusting the aspect ratio of the first picture to the aspect ratio corresponding to the preset size information to obtain a third picture; and cutting the third picture according to the pixel difference of the pixel points in the third picture to obtain a second picture with a preset size.
In a preferred embodiment of the present invention, the processing unit may be specifically configured to: executing a first operation on each pixel point in the third picture to obtain color difference values of all the pixel points; the first operation includes: determining absolute color difference between a target pixel point and an adjacent pixel point according to the three primary colors of the pixels, and determining the color difference value of the target pixel point according to the absolute color difference, wherein the target pixel point is any one pixel point in the third picture; cutting continuous pixel points of which the color difference values are smaller than a second threshold value in the edge area of the third picture to obtain a fourth picture; determining a pixel average point of the fourth picture; and extending the pixel average point to the periphery to obtain a second picture with a preset size.
In a third aspect, the present invention provides a picture adding apparatus, which includes a memory and a processor. The memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus. When the picture adding device runs, the processor executes computer-executable instructions stored in the memory to enable the picture adding device to execute the picture adding method provided by the first aspect and various possible implementation manners thereof.
In a fourth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium includes computer-executable instructions, which, when executed on a computer, cause a picture adding apparatus to perform the picture adding method provided in the first aspect and various possible implementations thereof.
In a fifth aspect, a computer program product is provided, which includes computer instructions that, when run on a computer, cause a picture adding apparatus to execute the picture adding method provided in the first aspect and its various possible implementations.
It should be noted that all or part of the computer instructions may be stored on the computer readable storage medium. The computer-readable storage medium may be packaged together with a processor executing the picture adding apparatus, or may be packaged separately from the processor executing the picture adding apparatus, which is not limited in this embodiment of the present invention.
For the description of the second, third, fourth and fifth aspects of the present invention, reference may be made to the detailed description of the first aspect; in addition, for the beneficial effects described in the second aspect, the third aspect, the fourth aspect and the fifth aspect, reference may be made to the beneficial effect analysis of the first aspect, and details are not repeated here.
The conception, the specific structure and the technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, the features and the effects of the present invention.
Drawings
Fig. 1 is a schematic flowchart illustrating a picture adding method according to a preferred embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a picture adding apparatus according to an embodiment of the present invention;
fig. 3 is a second schematic structural diagram of a picture adding apparatus according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of embodiments of the present invention is not limited to performing functions in the order illustrated or discussed, but may include performing functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", and the like are used for distinguishing the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the words "first", "second", and the like are not limited in number or execution order.
Some exemplary embodiments of the invention have been described for illustrative purposes, and it is to be understood that the invention may be practiced otherwise than as specifically described.
In general, when text editing is performed, a cover page is added to beautify the effect of the article displayed on the front list page. In the prior art, the pictures need to be manually searched on each webpage, and the searched pictures need to be processed by using picture editing software after being searched so as to meet the picture size required by a website.
In order to solve the above problem, the present invention provides a picture adding method, which is used for solving the problem of low picture adding efficiency. The picture adding method comprises the following steps: under the condition that first input of a user is received, determining keywords of an edited text in response to the first input, and determining M pictures to be added corresponding to the keywords; displaying N pictures to be added in the M pictures to be added according to the relevance; under the condition that second input of a user on a first picture in the N pictures to be added is received, responding to the second input, and cutting the first picture according to preset size information to obtain a second picture; displaying a second picture at a preset position; wherein M is greater than or equal to N, and M, N is an integer greater than 0. According to the scheme, on one hand, M to-be-added pictures can be determined according to the keywords, so that the M to-be-added pictures with high association can be rapidly determined even under the condition of a large search range; on the other hand, the user can select one picture from the N pictures to be added with the highest relevance degree, so that the accuracy and the efficiency of picture selection can be improved; on the other hand, since the first picture can be cropped according to the preset size information, the efficiency of the picture adding operation is further improved.
The above-described implementations are described in detail below with reference to specific embodiments and the accompanying drawings.
As shown in fig. 1, an embodiment of the present invention provides a picture adding method, where the picture adding method may be applied to a picture adding apparatus, and the picture adding method may include: S101-S104:
s101, under the condition that a first input of a user is received, the picture adding device responds to the first input, determines keywords of an edited text, and determines M pictures to be added corresponding to the keywords.
Wherein M is an integer greater than 0.
When a user wants to add a cover picture to an edited text, the user may perform a first input to the picture adding apparatus, for example, click and input a first control in a first page of the picture adding apparatus, and after receiving the first input, the picture adding apparatus may respond to the first input by determining a keyword of the edited text first, and then determining M pictures to be added corresponding to the keyword according to the determined keyword.
Optionally, the picture adding apparatus determines that the keywords of the edited text may include at least one of: receiving a keyword input by a user; and determining high-frequency words in the edited text, and determining a first number of high-frequency words as the key words according to the frequency of occurrence.
Specifically, one way is: the image adding device may display a keyword input page in response to the first input after receiving the first input, and the user may input a keyword to be added in the keyword input page, so that the image adding device determines the keyword of the edited text; the other mode is as follows: the picture adding device may determine, in response to the first input, high-frequency words in the edited text by traversing the edited text after receiving the first input, for example, a word whose occurrence number exceeds 5 times may be determined as a high-frequency word, so that the picture adding device determines keywords of the edited text; another way is: the image adding device can respond to the first input after receiving the first input, firstly receives keywords input by a user in a keyword input page, and can add new keywords automatically in a text traversing and editing mode if the number of the keywords input by the user is less than a preset number value.
Optionally, the image adding device may determine, in the preset image search system, M images to be added corresponding to the keyword according to the determined keyword. The preset picture search system may include at least one picture search engine.
It should be noted that the preset image search system needs to determine the user identity according to the predetermined signature information, and may perform the search operation when the signature information input by the user matches. Thus, the safety of the operation can be improved.
Optionally, the picture adding device may determine a time range of the picture searched in the preset picture searching system according to a text type of the edit text input by the user. For example, if the text type of the edited text is a current comment or a headline type, a picture of the latest month is acquired, that is, the start time beginTime is a time one month ago, the end time endTime is a current time, and the times are all in unix timestamp format. If the picture is not the current comment or the headline type, the picture within one year is acquired, beginTime is the time one year ago, endTime is the current time, and the format of unix timemap is also adopted.
S102, the picture adding device displays N pictures to be added in the M pictures to be added according to the relevance.
Optionally, after the image adding device determines M images to be added corresponding to the keyword, the size of M and a first threshold may also be determined, if M is greater than the first threshold, at least one high-frequency word is added as the keyword according to the frequency of occurrence until K images to be added smaller than or equal to the first threshold are obtained; then, displaying N pictures to be added in the K pictures to be added according to the relevance; wherein M is greater than or equal to K, K is greater than or equal to N, and K is an integer greater than 0. Thus, the picture range determined by the picture adding device can be further reduced, and the relevance of the pictures is improved.
The image adding device can enable the preset image searching system to return N images to be added with highest relevance and sorted according to the heat degree according to the interface setting, and after the interface returns the N images to be added, the image adding device can display the N images to be added in a list form. The N pictures to be added can be displayed in a list in a form of width limit 480 equal-ratio scaling, and after a user clicks and inputs any one picture, the picture adding device can restore the original size of the picture so as to facilitate the user to review.
S103, under the condition that second input of a user on a first picture in the N pictures to be added is received, the picture adding device responds to the second input and cuts the first picture according to preset size information to obtain a second picture.
Wherein N is an integer greater than 0, and M is greater than or equal to N.
Optionally, after the first picture is determined, the picture adding device may adjust the aspect ratio of the first picture to the aspect ratio corresponding to the preset size information, so as to obtain a third picture.
For example, the preset size information includes 1200 × 462, 365 × 259 and 800 × 309, i.e., the first picture needs to be adjusted to the three sizes respectively. The picture adding device may first save the first picture locally, determine the width and height of the first picture by using a picture address (gettimezise), compare the aspect ratio of the first picture with the aspect ratio of 1200 × 462, 365 × 259 and 800 × 309, respectively, scale the height of the first picture to a desired height if the aspect ratio of the first picture is large, and perform width adaptive processing, or scale the width of the first picture to a desired width if the aspect ratio of the first picture is small, and perform height adaptive processing, thereby obtaining a third picture.
Optionally, the picture adding device may perform clipping processing on the third picture according to pixel differences of pixel points in the third picture, so as to obtain a second picture with a preset size. The image adding device may perform a first operation on each pixel point in the third image, thereby obtaining color difference values of all the pixel points. The first operation may include: determining absolute color difference between a target pixel point and an adjacent pixel point according to the three primary colors of the pixels, and determining the color difference value of the target pixel point according to the absolute color difference, wherein the target pixel point is any one pixel point in the third picture; cutting continuous pixel points of which the color difference values are smaller than a second threshold value in the edge area of the third picture to obtain a fourth picture; determining a pixel average point of the fourth picture; and extending the pixel average point to the periphery to obtain a second picture with a preset size.
Specifically, the picture adding device may determine each pixel point in the third picture, obtain and store pixel information of the third picture through a picture path (macrocreatefrom jpeg), and then determine each pixel according to the pixel informationThe three primary colors of the pixels of the dot. And then, respectively carrying out first operation on the upper pixel point, the lower pixel point, the left pixel point and the right pixel point of the target pixel point to obtain four absolute color difference values of the target pixel point, and then carrying out second operation on the four absolute color difference values of the target pixel point to obtain a color difference value of the target pixel point, so that the color difference value of each pixel point in a third picture is obtained. Wherein the first operation is according to the formula
Figure BDA0002893099680000081
Determining four absolute color difference values, x, of a target pixel point1、y1And z1Three primary colors, x, of the target pixel point2、y2And z2Three primary colors of any one of the upper, lower, left and right pixels of the target pixel point are shown, and F is an absolute color difference value. The second operation is according to the formula
Figure BDA0002893099680000091
Determining the color difference value of the target pixel point, F1、F2、F3And F4The absolute color difference values of the upper, lower, left and right pixels of the target pixel point are respectively, and H is the color difference value. Further, the image adding device may perform clipping processing on continuous pixels of which the color difference value is smaller than a second threshold value in an edge region of the third image to obtain a fourth image, where the edge region is an annular region having a preset distance from an edge line of the third image. Then, the picture adding device can add the picture through a formula
Figure BDA0002893099680000092
Determining the average pixel point of the fourth picture, wherein n is the total number of pixel points and xiThe color difference value of the ith pixel point is obtained; after the pixel average point is obtained, the second picture can be extended to the periphery by taking the pixel average point as the center, and the second picture with the preset size can be obtained by cutting.
It should be noted that if the extension distance in one direction exceeds the edge line of the first picture, the remaining dimension may be extended in the opposite direction.
And S104, the picture adding device displays a second picture at a preset position.
The preset position is a position for displaying a cover picture.
In the embodiment of the invention, under the trigger of the first input of the user, M pictures to be added can be determined according to the determined key words, N pictures to be added with highest relevance in the M pictures to be added are displayed, the user can select one picture from the N pictures to be added according to personal desire, and the cutting operation of the picture is triggered, so that the picture with the preset size is obtained. According to the scheme, on one hand, M to-be-added pictures can be determined according to the keywords, so that the M to-be-added pictures with high association can be rapidly determined even under the condition of a large search range; on the other hand, the user can select one picture from the N pictures to be added with the highest relevance degree, so that the accuracy and the efficiency of picture selection can be improved; on the other hand, since the first picture can be cropped according to the preset size information, the efficiency of the picture adding operation is further improved.
The scheme provided by the embodiment of the application is mainly introduced from the perspective of a method. To implement the above functions, it includes hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
According to the picture adding method provided by the embodiment of the application, the execution main body can be a picture adding device, or a control module used for adding pictures in the picture adding device. The embodiment of the present application describes a picture adding device provided in the embodiment of the present application by taking a picture adding device as an example to execute a picture adding method.
It should be noted that, in the embodiment of the present application, the functional modules of the image adding apparatus may be divided according to the above method example, for example, each functional module may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. Optionally, the division of the modules in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
As shown in fig. 2, an embodiment of the present application provides a picture adding apparatus 200. The picture adding apparatus 200 includes: a receiving unit 201, a processing unit 202, and a display unit 203; the receiving unit 201 may be configured to receive a first input of a user; the processing unit 202 may be configured to determine, in response to the first input, a keyword of an editing text, and determine M to-be-added pictures corresponding to the keyword; the display unit 203 may be configured to display N to-be-added pictures of the M to-be-added pictures according to the association degree; the receiving unit 201 may be further configured to receive a second input of the user to the first picture of the N pictures to be added; the processing unit 202 is further configured to, in response to the second input, perform cropping processing on the first picture according to preset size information to obtain a second picture; the display unit 203 may be further configured to display the second picture at a preset position; wherein M is greater than or equal to N, and M, N is an integer greater than 0.
Optionally, the processing unit 202 may be specifically configured to execute at least one of the following: receiving a keyword input by a user; and determining high-frequency words in the edited text, and determining a first number of high-frequency words as the key words according to the frequency of occurrence.
Optionally, the processing unit 202 may be further configured to, after determining M to-be-added pictures corresponding to the keyword, if M is greater than a first threshold, add at least one high-frequency word as the keyword according to the frequency of occurrence until K to-be-added pictures smaller than or equal to the first threshold are obtained; the display unit 203 is specifically configured to display N to-be-added pictures of the K to-be-added pictures according to the association degree; wherein M is greater than or equal to K, K is greater than or equal to N, and K is an integer greater than 0.
Optionally, the processing unit 202 may be specifically configured to: adjusting the aspect ratio of the first picture to the aspect ratio corresponding to the preset size information to obtain a third picture; and cutting the third picture according to the pixel difference of the pixel points in the third picture to obtain a second picture with a preset size.
Optionally, the processing unit 202 may be specifically configured to: executing a first operation on each pixel point in the third picture to obtain color difference values of all the pixel points; the first operation includes: determining absolute color difference between a target pixel point and an adjacent pixel point according to the three primary colors of the pixels, and determining the color difference value of the target pixel point according to the absolute color difference, wherein the target pixel point is any one pixel point in the third picture; cutting continuous pixel points of which the color difference values are smaller than a second threshold value in the edge area of the third picture to obtain a fourth picture; determining a pixel average point of the fourth picture; and extending the pixel average point to the periphery to obtain a second picture with a preset size.
Of course, the picture adding apparatus 200 provided in the embodiment of the present application includes, but is not limited to, the above units.
On one hand, the image adding device provided by the embodiment of the invention can determine M images to be added according to the keywords, so that the M images to be added with higher association can be quickly determined even under the condition of a large search range; on the other hand, the user can select one picture from the N pictures to be added with the highest relevance degree, so that the accuracy and the efficiency of picture selection can be improved; on the other hand, since the first picture can be cropped according to the preset size information, the efficiency of the picture adding operation is further improved.
The embodiment of the present application further provides a picture adding apparatus as shown in fig. 3, where the picture adding apparatus includes a processor 11, a memory 12, a communication interface 13, and a bus 14. The processor 11, the memory 12 and the communication interface 13 may be connected by a bus 14.
The processor 11 is a control center of the picture adding apparatus, and may be a single processor or a collective term for a plurality of processing elements. For example, the processor 11 may be a general-purpose Central Processing Unit (CPU), or may be another general-purpose processor. Wherein a general purpose processor may be a microprocessor or any conventional processor or the like.
For one embodiment, processor 11 may include one or more CPUs, such as CPU 0 and CPU 1 shown in FIG. 3.
The memory 12 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
In a possible implementation, the memory 12 may be present separately from the processor 11, and the memory 12 may be connected to the processor 11 via a bus 14 for storing instructions or program code. The deployment method of the service function chain provided by the embodiment of the present application can be implemented when the processor 11 calls and executes the instructions or program codes stored in the memory 12.
In another possible implementation, the memory 12 may also be integrated with the processor 11.
And a communication interface 13 for connecting with other devices through a communication network. The communication network may be an ethernet network, a radio access network, a Wireless Local Area Network (WLAN), or the like. The communication interface 13 may comprise a receiving unit for receiving data and a transmitting unit for transmitting data.
The bus 14 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
It is to be noted that the structure shown in fig. 3 does not constitute a limitation of the picture adding apparatus. The picture adding means may comprise more or less components than those shown in fig. 3, or some components may be combined, or a different arrangement of components than those shown.
Embodiments of the present invention also provide a computer-readable storage medium, which includes computer-executable instructions. When the computer executes the instructions to run on the computer, the computer is caused to execute the steps executed by the picture adding device in the picture adding method provided by the embodiment.
The embodiment of the present invention further provides a computer program product, which can be directly loaded into the memory and contains software codes, and after the computer program product is loaded and executed by the computer, the method for adding pictures provided by the above embodiment can be implemented, and each step executed by the picture adding device is executed.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for causing a terminal to execute the methods according to the embodiments of the present invention.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. A picture adding method is characterized by comprising the following steps:
under the condition that first input of a user is received, determining keywords of an edited text in response to the first input, and determining M pictures to be added corresponding to the keywords;
displaying N pictures to be added in the M pictures to be added according to the relevance;
under the condition that second input of a user to a first picture in the N pictures to be added is received, responding to the second input, and cutting the first picture according to preset size information to obtain a second picture;
displaying the second picture at a preset position;
wherein M is greater than or equal to N, and M, N is an integer greater than 0.
2. The picture adding method according to claim 1, wherein the determining of the keyword of the edit text includes at least one of:
receiving a keyword input by a user;
and determining high-frequency words in the edited text, and determining a first number of high-frequency words as the keywords according to the frequency of occurrence.
3. The picture adding method according to claim 2, wherein after determining M pictures to be added corresponding to the keyword, the method further comprises:
if M is larger than a first threshold value, adding at least one high-frequency word as the keyword according to the frequency of occurrence until K pictures to be added which are smaller than or equal to the first threshold value are obtained;
the displaying N to-be-added pictures in the M to-be-added pictures according to the relevance comprises the following steps:
displaying N pictures to be added in the K pictures to be added according to the relevance;
wherein M is greater than or equal to K, K is greater than or equal to N, and K is an integer greater than 0.
4. The picture adding method according to claim 1, wherein the cropping the first picture according to the preset size information to obtain a second picture comprises:
adjusting the aspect ratio of the first picture to the aspect ratio corresponding to the preset size information to obtain a third picture;
and cutting the third picture according to the pixel difference of the pixel points in the third picture to obtain a second picture with a preset size.
5. The picture adding method according to claim 4, wherein the cropping the third picture according to the pixel difference of the pixel point in the third picture to obtain a second picture with a preset size comprises:
executing a first operation on each pixel point in the third picture to obtain color difference values of all the pixel points; the first operation includes: determining absolute color difference between a target pixel point and an adjacent pixel point according to three primary colors of pixels, and determining a color difference value of the target pixel point according to the absolute color difference, wherein the target pixel point is any one pixel point in the third picture;
cutting continuous pixel points of which the color difference values are smaller than a second threshold value in the edge region of the third picture to obtain a fourth picture;
determining a pixel average point of the fourth picture;
and extending the pixel average point to the periphery to obtain a second picture with a preset size.
6. A picture adding apparatus, comprising: the device comprises a receiving unit, a processing unit and a display unit;
the receiving unit is used for receiving a first input of a user;
the processing unit is used for responding to the first input, determining keywords of an edited text and determining M pictures to be added corresponding to the keywords;
the display unit is used for displaying N pictures to be added in the M pictures to be added according to the relevance;
the receiving unit is further used for receiving a second input of a user to a first picture in the N pictures to be added;
the processing unit is further used for responding to the second input, and cutting the first picture according to preset size information to obtain a second picture;
the display unit is further used for displaying the second picture at a preset position;
wherein M is greater than or equal to N, and M, N is an integer greater than 0.
7. The picture adding apparatus according to claim 6, wherein the processing unit is specifically configured to perform at least one of:
receiving a keyword input by a user;
and determining high-frequency words in the edited text, and determining a first number of high-frequency words as the keywords according to the frequency of occurrence.
8. The picture adding apparatus according to claim 7,
the processing unit is further configured to, after M to-be-added pictures corresponding to the keyword are determined, add at least one high-frequency word as the keyword according to the frequency of occurrence if M is greater than a first threshold value until K to-be-added pictures smaller than or equal to the first threshold value are obtained;
the display unit is specifically used for displaying N pictures to be added in the K pictures to be added according to the relevance;
wherein M is greater than or equal to K, K is greater than or equal to N, and K is an integer greater than 0.
9. The picture adding device according to claim 6, wherein the processing unit is specifically configured to: adjusting the aspect ratio of the first picture to the aspect ratio corresponding to the preset size information to obtain a third picture; and cutting the third picture according to the pixel difference of the pixel points in the third picture to obtain a second picture with a preset size.
10. The picture adding device according to claim 9, wherein the processing unit is specifically configured to: executing a first operation on each pixel point in the third picture to obtain color difference values of all the pixel points; the first operation includes: determining absolute color difference between a target pixel point and an adjacent pixel point according to three primary colors of pixels, and determining a color difference value of the target pixel point according to the absolute color difference, wherein the target pixel point is any one pixel point in the third picture; cutting continuous pixel points of which the color difference values are smaller than a second threshold value in the edge region of the third picture to obtain a fourth picture; determining a pixel average point of the fourth picture; and extending the pixel average point to the periphery to obtain a second picture with a preset size.
CN202110032963.XA 2021-01-12 2021-01-12 Picture adding method and device Pending CN112685680A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110032963.XA CN112685680A (en) 2021-01-12 2021-01-12 Picture adding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110032963.XA CN112685680A (en) 2021-01-12 2021-01-12 Picture adding method and device

Publications (1)

Publication Number Publication Date
CN112685680A true CN112685680A (en) 2021-04-20

Family

ID=75457331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110032963.XA Pending CN112685680A (en) 2021-01-12 2021-01-12 Picture adding method and device

Country Status (1)

Country Link
CN (1) CN112685680A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1816836A2 (en) * 2005-12-30 2007-08-08 LG Electronics Inc. Apparatus and method for managing images of mobile terminal
CN102289813A (en) * 2011-08-30 2011-12-21 西安交通大学 Blurring-degree evaluation method without reference images
CN102682099A (en) * 2012-04-27 2012-09-19 北京百度网讯科技有限公司 Method and device for providing target pictures in target areas
CN104133956A (en) * 2014-07-25 2014-11-05 小米科技有限责任公司 Method and device for processing pictures
CN105867915A (en) * 2016-03-25 2016-08-17 广州阿里巴巴文学信息技术有限公司 Application interface display method and device
CN107341271A (en) * 2017-08-08 2017-11-10 珠海市富状元科技有限公司 A kind of display methods of Searches of Patent Literature result
CN107506343A (en) * 2017-07-27 2017-12-22 北京金堤科技有限公司 The processing method and platform of a kind of information editing
CN107610131A (en) * 2017-08-25 2018-01-19 百度在线网络技术(北京)有限公司 A kind of image cropping method and image cropping device
CN108021714A (en) * 2017-12-29 2018-05-11 成都索贝数码科技股份有限公司 A kind of integrated contribution editing system and contribution edit methods

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1816836A2 (en) * 2005-12-30 2007-08-08 LG Electronics Inc. Apparatus and method for managing images of mobile terminal
CN102289813A (en) * 2011-08-30 2011-12-21 西安交通大学 Blurring-degree evaluation method without reference images
CN102682099A (en) * 2012-04-27 2012-09-19 北京百度网讯科技有限公司 Method and device for providing target pictures in target areas
CN104133956A (en) * 2014-07-25 2014-11-05 小米科技有限责任公司 Method and device for processing pictures
CN105867915A (en) * 2016-03-25 2016-08-17 广州阿里巴巴文学信息技术有限公司 Application interface display method and device
CN107506343A (en) * 2017-07-27 2017-12-22 北京金堤科技有限公司 The processing method and platform of a kind of information editing
CN107341271A (en) * 2017-08-08 2017-11-10 珠海市富状元科技有限公司 A kind of display methods of Searches of Patent Literature result
CN107610131A (en) * 2017-08-25 2018-01-19 百度在线网络技术(北京)有限公司 A kind of image cropping method and image cropping device
CN108021714A (en) * 2017-12-29 2018-05-11 成都索贝数码科技股份有限公司 A kind of integrated contribution editing system and contribution edit methods

Similar Documents

Publication Publication Date Title
EP3618003B1 (en) Method and apparatus for generating synthetic picture
US10460001B2 (en) Window switching method and device and storage medium thereof
US20180225542A1 (en) Image information recognition processing method and device, and computer storage medium
CN110427147B (en) Page position positioning method and device
WO2013075324A1 (en) Image attractiveness based indexing and searching
CN104899227A (en) Webpage character rendering method and device
CN107967099A (en) A kind of method, device and mobile terminal of terminal screenshotss
CN101937428A (en) Method and system for rearranging pictures with literal contents for mobile terminal equipment
CN107103010B (en) Visualized data processing method and device
US11615515B2 (en) Superpixel merging
CN110309447B (en) Electronic bookmark generation method, electronic equipment and computer storage medium
US20180253778A1 (en) Information processing system, information processing method, and non-transitory computer-readable storage medium storing program
US8965133B2 (en) Image processing apparatus and control method therefor
CN112055244B (en) Image acquisition method and device, server and electronic equipment
US10248712B1 (en) Generating a set of representative items using a maximum-set-coverage selection strategy
CN112419183A (en) Method and device for reducing zoomed image, computer equipment and storage medium
CN106354369A (en) Character input interface display handling method and device
CN114782716A (en) Image matching method and device
CN112685680A (en) Picture adding method and device
CN111353115B (en) Method and device for generating snowplow map
US20130227444A1 (en) Method and Device for Improving Page Rendering Speed of Browser
JP2011086050A (en) Information processing terminal and computer program
CN114168035A (en) Application page layout adjusting method and device, electronic equipment and storage medium
CN110598026B (en) Display method and device of picture list and terminal equipment
US10114885B1 (en) Generating a set of representative items using a clustering-selection strategy

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210420

RJ01 Rejection of invention patent application after publication