CN112612980B - Picture service method, apparatus, device, storage medium and computer program product - Google Patents
Picture service method, apparatus, device, storage medium and computer program product Download PDFInfo
- Publication number
- CN112612980B CN112612980B CN202011533322.4A CN202011533322A CN112612980B CN 112612980 B CN112612980 B CN 112612980B CN 202011533322 A CN202011533322 A CN 202011533322A CN 112612980 B CN112612980 B CN 112612980B
- Authority
- CN
- China
- Prior art keywords
- picture
- original picture
- original
- storing
- cut
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000004590 computer program Methods 0.000 title claims abstract description 19
- 238000005520 cutting process Methods 0.000 claims abstract description 51
- 230000004044 response Effects 0.000 claims description 16
- 238000000605 extraction Methods 0.000 claims description 15
- 238000010586 diagram Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 239000000284 extract Substances 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20112—Image segmentation details
- G06T2207/20132—Image cropping
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Library & Information Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present disclosure discloses a picture service method, apparatus, device, storage medium and computer program product, relating to the field of computers, in particular to the fields of computer vision, information flow and big data. The specific implementation scheme is as follows: responding to an uploading request of the original picture, storing content data of the original picture, and extracting and storing characteristic information of the original picture; responding to an access request of the original picture, and cutting the original picture based on the content data and the characteristic information of the original picture to obtain a cut picture; the original picture is an original picture; and sending the cut picture to the terminal equipment which initiates the access request. The picture service method can improve the cutting efficiency and accuracy, thereby improving the quality of picture service.
Description
Technical Field
The present disclosure relates to the field of computer technology, and in particular to the field of computer vision, information flow, and big data technology, and more particularly to a picture service method, apparatus, device, storage medium, and computer program product.
Background
The rapid development of multimedia technology and internet technology has enabled users to obtain a large amount of picture resources from the internet. Because larger bandwidth resources are occupied during picture transmission, the time for loading pictures by a client is longer, and the pictures cannot be directly used on line.
Therefore, after receiving the picture downloading request, the server needs to cut the picture, reduces the size of the picture, and reduces the occupied bandwidth resources under the condition of not affecting the view of the user.
Disclosure of Invention
The present disclosure provides a picture service method, apparatus, device, storage medium, and computer program product.
According to a first aspect of the present disclosure, there is provided a picture service method, including:
responding to an uploading request of an original picture, storing content data of the original picture, and extracting and storing characteristic information of the original picture;
responding to an access request of an original picture, and cutting the original picture based on the content data and the characteristic information of the original picture to obtain a cut picture;
and sending the cut picture to the terminal equipment which initiates the access request.
According to a second aspect of the present disclosure, there is provided a picture service apparatus including:
the feature extraction module is used for responding to an uploading request of an original picture and extracting feature information of the original picture;
the storage module is used for storing the content data of the original picture and the characteristic information of the original picture;
the cutting module is used for responding to an access request of an original picture, cutting the original picture based on the content data and the characteristic information of the original picture, and obtaining a cut picture;
and the sending module is used for sending the cut picture to the terminal equipment which initiates the access request.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the picture service methods.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform any one of the picture service methods.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method of any one of the above-described picture service methods.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic architecture diagram of a picture service method implementing an embodiment of the present disclosure;
FIG. 2 is a schematic diagram according to a first embodiment of the present disclosure;
FIG. 3 is a flowchart of a cut in accordance with a first embodiment of the present disclosure;
FIG. 4 is a flow chart of a method of serving logo pictures in an embodiment of the present disclosure;
FIG. 5 is a schematic diagram according to a second embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device used to implement a picture service method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the absence of conflict, embodiments and features of embodiments herein may be combined with one another.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Fig. 1 is a schematic architecture diagram of a picture service method implementing an embodiment of the present disclosure. As shown in fig. 1, the architecture includes: a terminal device 10, a server 20 and a network 30, wherein the terminal device 10 can upload and download pictures, the server 20 provides picture services, and the network 30 is used for connecting the terminal device 10 and the server 20.
Among them, the terminal device 10 includes, but is not limited to: personal computers, smart phones, tablet computers, and personal digital assistant devices. These terminal devices 10 may each be installed with various Applications (APPs), such as social APPs, shopping APPs, etc.
In the embodiment of the present disclosure, the terminal device 10 may open a web page through the APP. The web page may include at least one picture, which may be a picture uploaded by the current user or a picture uploaded by another user or a server to the server 20.
The server 20 is used to provide storage and processing services for pictures. For example, the server 20 stores pictures uploaded by the user, such as content data storing the pictures. Alternatively, the server 20 provides a processing service for pictures. Among them, processing services include, but are not limited to, a picture feature extraction process and a cropping process. Wherein the extracted feature information includes, but is not limited to, the size of the picture, the main body feature, and the color feature. The server 20 is also used for storing the characteristic information of the picture and the cut-processed picture.
In the embodiment of the present disclosure, the server 20 is provided with a uniform resource locator (Uniform Resource Locator, URL) for each of the original picture and the processed picture, respectively, and the original picture and the processed picture can be obtained according to the URL.
In the prior art, the cutting process of the picture is mainly performed by experience, for example, the lateral picture only retains the middle area, and other areas are cut. The portrait remains only the top region, the other regions being cropped. Because the distribution state of the effective information in the picture is unpredictable, the effective information in the picture is easily cut off by the cutting mode depending on experience, namely, the cutting accuracy is lower.
In order to improve the accuracy of cropping, an intelligent cropping service is provided in the prior art, wherein the intelligent cropping service is used for cropping images completely in the form of a synchronous interface, namely, when a user accesses images, a server calls content data of the accessed images, the accessed images are cropped through an intelligent algorithm, and the cropped images are returned to the user. The intelligent graph cutting service adopts a synchronous interface mode to cut graphs, the response time of each graph is in the second level, and for pages with a plurality of graphs, the waiting access is needed to be longer, so that the intelligent graph cutting service cannot be used in an actual service environment.
The embodiment of the present disclosure provides a picture service method, after receiving a picture uploaded by a terminal device 10 through a network 30, a server 20 stores not only content data of the picture, but also feature information of the picture, and stores the extracted feature information. After the request for accessing the picture is received, the picture is cut based on the content data and the characteristic information of the picture, so that the cutting efficiency is greatly improved, and the cutting accuracy can be improved.
The following embodiments can be applied to the system architecture of the present embodiment. For simplicity of description, the following embodiments may be referred to and cited with each other.
In a first aspect, an embodiment of the present disclosure provides a method for serving pictures, which may improve accuracy of cutting, and may further improve cutting rate of pictures, so as to improve access speed of a user.
Fig. 2 is a schematic diagram according to a first embodiment of the present disclosure. As shown in fig. 2, the picture service method may include the steps of:
step S201, in response to the upload request of the original picture, stores the content data of the original picture, and extracts and stores the feature information of the original picture.
The uploaded original picture can be any type of picture, such as portrait, trademark (logo), landscape, etc. The content data of the original picture refers to a set of gray values that numerically represent pixels (pixels) in the original picture. The feature information of the original picture is information for representing main features in the original picture. For example, the feature information of the original picture includes, but is not limited to, at least one of face feature information, body feature information, and background color feature information.
The face feature information may be face feature information of all people in the original picture, or face feature information of a main person in the original picture, so as to avoid cutting faces of the main person. The main body characteristic information is characteristic information for reflecting the main body of the original picture, and the main body information is kept as much as possible in the cutting process. The background color feature information is feature information reflecting the background color of the original picture. For example, the original picture is a logo picture, the feature information of the logo pattern is the main feature information of the original picture, and the color outside the logo pattern is the background color feature information.
In some embodiments, the request for uploading the original picture may be a request sent by the user through the terminal device, or may be a request sent by a service provider that provides the picture service. After receiving the uploading request, the server stores the uploaded content data of the original picture in the storage module. The server may also process the original picture, such as extracting feature information of the original picture, and store the extracted feature information. The storage module for storing the content data of the original picture and the storage module for storing the feature information of the original picture may be different storage modules or the same storage module.
It should be noted that, the feature information of the original picture may be extracted by an existing extraction manner, for example, the face feature information is obtained by using a face detection operator, the body feature information is obtained by using a body detection operator, and the background color feature information is obtained by using a background color extraction operator.
Step S202, in response to the access request of the original picture, the original picture is cut based on the content data and the characteristic information of the original picture, and a cut picture is obtained.
The access request may be a request sent by the user through the terminal device. The original picture is a picture selected from a plurality of original pictures, and has been stored in the server.
In some embodiments, after receiving the access request, the server cuts the original picture based on the content data and the feature information of the original picture to obtain the cut picture, and since the server has already obtained the feature information of the original picture, when receiving the access request, it is unnecessary to wait for the time of extracting the feature information of the original picture, so that the cutting efficiency is improved, the cutting speed can reach millisecond level, and further, the accuracy of cutting can be improved because the original picture is cut by adopting the feature information.
Step S203, the cut picture is sent to the terminal equipment which initiates the access request.
After obtaining a cut picture corresponding to the original picture, the server sends the cut picture to terminal equipment, and the terminal equipment is the terminal equipment initiating the access request.
According to the embodiment of the disclosure, after the original picture is obtained, not only the content data of the original picture is stored, but also the characteristic information is extracted from the original picture, and the characteristic information of the original picture is stored, and after an access request is received, the original picture is cut based on the content data and the characteristic information of the original picture, so that the time for extracting the characteristic information of the original picture is not needed, the cutting time is shortened, and the cutting efficiency is improved; moreover, the original picture is cut by adopting the characteristic information of the original picture, so that the accuracy of cutting can be improved.
In some embodiments, step S201, in response to the original picture upload request, stores content data of the original picture, and extracts and stores feature information of the original picture, including:
step S21, in response to the uploading request of the original picture, the content data of the original picture is synchronously stored.
In some embodiments, after receiving the upload request of the original picture, the server receives the original picture and synchronously stores the content data of the original picture.
Step S22, in response to the uploading request of the original picture, the characteristic information of the original picture is asynchronously extracted and stored.
In some embodiments, after receiving an upload request of an original picture, the server receives the original picture, asynchronously extracts feature information of the original picture, and stores the feature information of the original picture.
It should be noted that, in step S21 and step S22, after the server receives the upload request of the original picture, the step of receiving the original picture is the same, except that the content data of the original picture is synchronously stored, and the feature information of the original picture is asynchronously extracted and stored.
In some embodiments, in response to the upload request of the original picture, in step S22, the server asynchronously extracts and stores the feature information of the original picture, and adds the extraction task to the message queue after receiving the original picture, and the server extracts the feature information of the original picture according to the order in the message queue.
In the embodiment of the disclosure, since the time taken to extract the feature information of the original picture is longer than the time taken to store the content data of the original picture, the content data of the original picture is synchronously stored, and the feature information of the original picture is asynchronously extracted and stored, the time for uploading the original picture is shortened, and the uploading efficiency of the original picture is improved.
In some embodiments, as shown in fig. 3, in step S201, in response to an original picture access request, the original picture is cropped based on content data and feature information corresponding to the original picture to obtain a cropped picture, including:
step S301, in response to the original picture access request, searches whether a cut picture corresponding to the original picture exists.
In practical application, when the original picture is accessed for the first time, there is no cropping picture corresponding to the original picture in the server, and therefore, the original picture needs to be cropped, that is, step S302 is executed. When the original picture is accessed for the first time, the server stores the cut picture corresponding to the original picture, and sets a corresponding URL for the cut picture corresponding to the original picture. Therefore, when the server is not accessed for the first time, the server can directly obtain the cut picture corresponding to the original picture from the storage module.
In some embodiments, the server may determine whether a content delivery network (Content Delivery Network, CDN) of the original picture exists through the URL, and if the original picture CDN exists, it indicates that a cut picture corresponding to the original picture exists in the server. For example, the server receives the original picture access request, determines whether the original picture CDN exists according to the URL, and if the original picture CDN exists, indicates that the original picture CDN exists.
Step S302, when no cut picture corresponding to the original picture exists, cutting the original picture based on the content data and the characteristic information corresponding to the original picture, and obtaining the cut picture corresponding to the original picture.
In some embodiments, in the case that there is no cropped picture corresponding to the original picture, the original picture is cropped based on the content data and the feature information corresponding to the original picture, and the cropped picture corresponding to the original picture is obtained.
In step S303, in the case that there is a cut picture corresponding to the original picture, the cut picture corresponding to the original picture is directly accessed.
In the embodiment of the disclosure, in response to an access request of an original picture, whether a cut picture corresponding to the original picture exists or not is searched, and corresponding operation is performed according to a search result, for example, when the cut picture corresponding to the original picture exists, the cut picture corresponding to the original picture is directly accessed, and only when the cut picture corresponding to the original picture does not exist, the original picture is cut, so that the access speed can be improved, and the user experience is improved.
In some embodiments, step S102, in response to an access request of the original picture, cuts the original picture based on the content data and the feature information corresponding to the original picture, and after obtaining the cut picture, further includes:
and storing the cut picture, wherein the address of the uniform resource locator of the cut picture is different from the address of the uniform resource locator of the original picture.
In the embodiment of the disclosure, the cut picture and the original picture are stored by adopting different addresses of the uniform resource locators, so that addressing and calling of different pictures are facilitated, the confusion of the original picture and the cut picture is avoided, and the access rate of the pictures is improved.
In the picture service, different users have different display proportion requirements, and the server generally cuts the original picture based on the display proportion requirements of the users to obtain cut pictures with different display proportions. The display scale may be a pixel scale that is optimally displayed by the user display device.
In some embodiments, the server cuts the original picture according to different display proportions, stores the cut picture of different display proportions after obtaining the cut picture of different display proportions, and the addresses of the uniform resource locators of the cut picture of different display proportions are different.
The embodiment of the disclosure provides cut pictures with various display proportions so as to meet the requirements of different users; and the addresses of the uniform resource locators of the cut pictures with different display proportions are different, so that the management of the cut pictures is facilitated, confusion during calling the cut pictures is avoided, the calling efficiency is improved, and the access rate of users is improved.
In an embodiment of the present disclosure, as shown in fig. 4, a service method of logo pictures includes:
step S401, receiving an uploading request of an original logo picture.
Step S402, synchronously storing the content data of the original logo picture in a picture storage module.
Step S403, adding the extracting task of the original logo picture into a message queue.
And step S404, extracting the characteristic information of the original logo picture.
In this embodiment, the original logo image is extracted according to the order in the message queue and processed. The feature information of the original logo picture comprises main feature information and background color feature information. The main feature information of the original logo picture can be extracted through the existing technical means. The main characteristic information of the original logo picture is the logo pattern information. Based on the cutting of the main body characteristic information, the main body area can be prevented from being cut, so that the accuracy of cutting is improved.
In this embodiment, non-main-body pixel points in the original logo image are extracted according to the horizontal direction and the vertical direction respectively. And matching the color similar points of the non-main pixel points in the original logo picture, and counting a color histogram. The color with the highest duty ratio in the color histogram is used as the background color.
The transverse direction and the vertical direction are relative concepts, and the original logo picture can be turned from the transverse direction to the vertical direction by taking the symmetry center of the original logo picture as an axis to rotate by 90 degrees.
Step S405, storing the feature information of the original logo picture in a feature information storage module.
The steps S401 to S405 may be asynchronously completed when the original logo picture is received.
Step S406, a request for accessing the target logo picture is received.
Step S407, judging whether the cut picture corresponding to the target logo picture is hit or not, if yes, executing step S408; if not, step S409 is performed.
In this embodiment, the cut picture corresponding to the target logo picture may determine whether to hit the cut picture CDN corresponding to the target logo picture according to the URL.
Step S408, obtaining a cut picture corresponding to the target logo picture and providing the cut picture to a user.
In the embodiment of the disclosure, the CDN obtains a cut picture corresponding to the target logo picture and provides the cut picture to the user, that is, the CDN transmits the cut picture corresponding to the target logo picture to a browser of the terminal device.
Step S409, obtaining content data of the target logo picture and characteristic information of the target logo picture, and cutting the target logo picture.
In the embodiment of the disclosure, before the target logo picture is cut, whether the target logo picture needs to be filled or not can be judged according to the main body characteristic information, and if yes, the target logo picture is filled. For example, when the main color of the target logo picture is single, the target logo picture needs to be filled. After finishing cutting, returning the cutting picture corresponding to the target logo picture to the CDN, and transmitting the cutting picture corresponding to the target logo picture to a browser of the terminal equipment by the CDN.
According to the picture service method provided by the embodiment, when the original picture is cut, the original picture is cut based on the asynchronously obtained characteristic information and the synchronously stored content data, so that the server does not need to extract the characteristic information of the original picture, the cutting time is shortened, the average cutting time can be reduced to below 200ms, and the cutting efficiency is improved. Moreover, the cutting is performed based on the characteristic information of the original picture, so that the error rate of cutting can be reduced, and the error rate can be reduced from 3% to 0.05%.
In a second aspect, an embodiment of the present disclosure provides a picture service apparatus, which may increase a cropping rate of a picture, thereby increasing an access speed of a user.
Fig. 5 is a schematic diagram of a second embodiment of the present disclosure. As shown in fig. 5, the picture service apparatus 500 includes:
the feature extraction module 501 is configured to respond to an upload request of an original picture, and extract feature information of the original picture.
The uploaded original picture can be any type of picture, such as portrait, trademark (logo), landscape, etc. The content data of the original picture refers to a set of gray values that numerically represent pixels (pixels) in the original picture. The feature information of the original picture is information for representing main features in the original picture. For example, the feature information of the original picture includes, but is not limited to, at least one of face feature information, body feature information, and background color feature information.
The face feature information may be face feature information of all people in the original picture, or face feature information of main characters in the original picture. The main body characteristic information is characteristic information for reflecting the main body of the original picture. The background color feature information is feature information reflecting the background color of the original picture. For example, the original picture is a logo picture, the feature information of the logo pattern is the main feature information of the original picture, and the color outside the logo pattern is the background color feature information.
In some embodiments, the request for uploading the original picture may be a request sent by the user through the terminal device, or may be a request sent by a service provider that provides the picture service.
The storage module 502 is configured to store content data of an original picture and feature information of the original picture.
After receiving the uploading request, the server stores the uploaded content data of the original picture in the storage module. The server may also process the original picture, such as extracting feature information of the original picture, and store the extracted feature information. The storage module for storing the content data of the original picture and the storage module for storing the feature information of the original picture may be different storage modules or the same storage module.
And the cropping module 503 is configured to, in response to an access request of the original picture, crop the original picture based on the content data and the feature information of the original picture, and obtain a cropped picture.
In some embodiments, after receiving the access request, the server cuts the original picture based on the content data and the feature information of the original picture, and obtains a cut picture after cutting. Because the server has obtained the characteristic information of the original picture, the time for extracting the characteristic information of the original picture is not needed, and therefore, the cutting speed can reach millisecond level, and the cutting efficiency is improved.
And the sending module 504 is configured to send the cropped picture to a terminal device that initiates the access request.
After obtaining a cut picture corresponding to the original picture, the server sends the cut picture to the terminal equipment through the sending module, and the terminal equipment is the terminal equipment initiating the access request.
In some embodiments, feature extraction module 501 extracts feature information of the original picture asynchronously. The storage module 502 synchronously stores content data of the original picture.
The feature extraction module 501 includes a face feature extraction unit, a main feature extraction unit, and a background color feature extraction unit, where the face feature extraction unit is used to extract face features in an original picture. The main feature extraction unit is used for extracting main features in the original picture. The background color feature extraction unit is used for extracting background color features in the original picture.
In some embodiments, the cropping module 503, in the absence of the cropped picture corresponding to the original picture, performs cropping on the original picture based on the content data and the feature information corresponding to the original picture, to obtain the cropped picture corresponding to the original picture. In some embodiments, the cropping module 503 cropping the original picture at different display scales to obtain cropped pictures at different display scales.
In some embodiments, the storage module 502 stores that the address of the uniform resource locator of the cut picture is different from the address of the uniform resource locator of the original picture, which is beneficial to addressing and calling of different pictures, and avoids the confusion of the original picture and the cut picture, thereby improving the access rate of the pictures. The memory module 502 has different addresses of uniform resource locators for cutting pictures in different display proportions, which is beneficial to the management of the cutting pictures, avoids confusion when the cutting pictures are called, and improves the calling efficiency, thereby improving the access rate of users.
According to the picture service device provided by the embodiment of the disclosure, when the cutting module cuts the original picture, the original picture is cut based on the asynchronously obtained characteristic information and the synchronously stored content data, so that the cutting module does not need to extract the characteristic information of the original picture, the cutting time is shortened, the average cutting time can be reduced to below 200ms, and the cutting efficiency is improved. Moreover, the cutting module cuts based on the characteristic information of the original picture, so that the error rate of cutting can be reduced, and the error rate can be reduced from 3% to 0.05%.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, for example, a picture service method. For example, in some embodiments, the picture service method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the picture service method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the picture service method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements any one of the above-mentioned picture service methods.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (9)
1. A picture service method, comprising:
responding to an uploading request of an original picture, storing content data of the original picture, and extracting and storing characteristic information of the original picture;
responding to an access request of an original picture, and cutting the original picture based on the content data and the characteristic information of the original picture to obtain a cut picture;
sending the cut picture to a terminal device which initiates the access request;
the responding to the uploading request of the original picture, storing the content data of the original picture, extracting and storing the characteristic information of the original picture, and comprises the following steps:
synchronously storing the content data of the original picture in response to the uploading request of the original picture; and asynchronously extracting and storing the characteristic information of the original picture.
2. The method of claim 1, wherein the cropping the original picture based on the content data and the feature information of the original picture to obtain a cropped picture in response to an access request of the original picture comprises:
responding to the access request of the original picture, and searching whether the cut picture corresponding to the original picture exists or not;
and under the condition that the cut picture corresponding to the original picture does not exist, cutting the original picture based on the content data and the characteristic information corresponding to the original picture, and obtaining the cut picture corresponding to the original picture.
3. The method of claim 1, wherein the cropping the original picture based on the content data and the feature information of the original picture in response to the access request of the original picture, after obtaining the cropped picture, further comprises:
and storing the cut picture, wherein the address of the uniform resource locator for storing the cut picture is different from the address of the uniform resource locator for storing the original picture.
4. The method of claim 1, wherein the cropped picture comprises cropped pictures of multiple display scales, and addresses of uniform resource locators of the cropped pictures of different display scales are different.
5. The method of any of claims 1-4, wherein the characteristic information comprises at least one of the following: face feature information, body feature information, and background color feature information.
6. A picture service apparatus comprising:
the feature extraction module is used for responding to an uploading request of an original picture and extracting feature information of the original picture;
the storage module is used for storing the content data of the original picture and the characteristic information of the original picture;
the cutting module is used for responding to an access request of an original picture, cutting the original picture based on the content data and the characteristic information of the original picture, and obtaining a cut picture; the responding to the uploading request of the original picture, storing the content data of the original picture, extracting and storing the characteristic information of the original picture, and comprises the following steps:
synchronously storing the content data of the original picture in response to the uploading request of the original picture; extracting and storing the characteristic information of the original picture asynchronously;
and the sending module is used for sending the cut picture to the terminal equipment which initiates the access request.
7. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
8. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
9. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011533322.4A CN112612980B (en) | 2020-12-22 | 2020-12-22 | Picture service method, apparatus, device, storage medium and computer program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011533322.4A CN112612980B (en) | 2020-12-22 | 2020-12-22 | Picture service method, apparatus, device, storage medium and computer program product |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112612980A CN112612980A (en) | 2021-04-06 |
CN112612980B true CN112612980B (en) | 2024-03-01 |
Family
ID=75244481
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011533322.4A Active CN112612980B (en) | 2020-12-22 | 2020-12-22 | Picture service method, apparatus, device, storage medium and computer program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112612980B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101025764A (en) * | 2006-02-24 | 2007-08-29 | 佳能株式会社 | Image processing apparatus, image processing method, and server and control method of the same |
WO2017193906A1 (en) * | 2016-05-09 | 2017-11-16 | 腾讯科技(深圳)有限公司 | Image processing method and processing system |
CN107393000A (en) * | 2017-08-24 | 2017-11-24 | 广东欧珀移动通信有限公司 | Image processing method, device, server and computer-readable recording medium |
CN108122238A (en) * | 2018-01-30 | 2018-06-05 | 百度在线网络技术(北京)有限公司 | Image processing method, device, equipment and computer readable storage medium |
CN109033261A (en) * | 2018-07-06 | 2018-12-18 | 北京旷视科技有限公司 | Image processing method, device, processing equipment and its storage medium |
EP3493105A1 (en) * | 2017-12-03 | 2019-06-05 | Facebook, Inc. | Optimizations for dynamic object instance detection, segmentation, and structure mapping |
CN111063007A (en) * | 2019-12-17 | 2020-04-24 | 北京思维造物信息科技股份有限公司 | Image generation method, device, equipment and storage medium |
-
2020
- 2020-12-22 CN CN202011533322.4A patent/CN112612980B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101025764A (en) * | 2006-02-24 | 2007-08-29 | 佳能株式会社 | Image processing apparatus, image processing method, and server and control method of the same |
WO2017193906A1 (en) * | 2016-05-09 | 2017-11-16 | 腾讯科技(深圳)有限公司 | Image processing method and processing system |
CN107393000A (en) * | 2017-08-24 | 2017-11-24 | 广东欧珀移动通信有限公司 | Image processing method, device, server and computer-readable recording medium |
EP3493105A1 (en) * | 2017-12-03 | 2019-06-05 | Facebook, Inc. | Optimizations for dynamic object instance detection, segmentation, and structure mapping |
CN108122238A (en) * | 2018-01-30 | 2018-06-05 | 百度在线网络技术(北京)有限公司 | Image processing method, device, equipment and computer readable storage medium |
CN109033261A (en) * | 2018-07-06 | 2018-12-18 | 北京旷视科技有限公司 | Image processing method, device, processing equipment and its storage medium |
CN111063007A (en) * | 2019-12-17 | 2020-04-24 | 北京思维造物信息科技股份有限公司 | Image generation method, device, equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
徐少平 ; 刘小平 ; 李春泉 ; 胡凌燕 ; 杨晓辉 ; .基于区域特征分析的快速FCM图像分割改进算法.模式识别与人工智能.2012,(06),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN112612980A (en) | 2021-04-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109992406B (en) | Picture request method, picture request response method and client | |
CN114548426B (en) | Asynchronous federal learning method, business service prediction method, device and system | |
CN114792355B (en) | Virtual image generation method and device, electronic equipment and storage medium | |
US20190114989A1 (en) | Systems and methods for image optimization | |
CN104601534A (en) | Method and system for processing CDN system images | |
CN105487640A (en) | Image pre-loading and caching method of Android watch | |
CN111225010A (en) | Data processing method, data processing system and device | |
CN113626113B (en) | Page rendering method and device | |
CN113419865B (en) | Cloud resource processing method, related device and computer program product | |
CN110750602B (en) | Method and device for determining site to which order address belongs | |
CN112688991B (en) | Method for performing point cloud scanning operation, related apparatus and storage medium | |
CN116756444B (en) | Image processing method, device, equipment and storage medium | |
CN112612980B (en) | Picture service method, apparatus, device, storage medium and computer program product | |
CN111414383B (en) | Data request method, data processing system and computing device | |
US11403835B2 (en) | Method and device for processing feature point of image | |
CN106657256A (en) | Resource acquisition processing method and device | |
CN113836455B (en) | Special effect rendering method, device, equipment, storage medium and computer program product | |
CN115599571A (en) | Data processing method and device, electronic equipment and storage medium | |
CN114138397B (en) | Page display method and device, electronic equipment and storage medium | |
CN112540804B (en) | Applet running method and device, electronic equipment and medium | |
CN114095758B (en) | Cloud image intercepting method and related device | |
CN113905040B (en) | File transmission method, device, system, equipment and storage medium | |
CN112989250B (en) | Web service response method and device and electronic equipment | |
CN115016955A (en) | Method and device for sharing information among multiple applications | |
CN114168876A (en) | Page display method and device, computer equipment and computer readable storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |