CN113781494A - Image segmentation method and device, electronic equipment and computer readable medium - Google Patents

Image segmentation method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113781494A
CN113781494A CN202110207880.XA CN202110207880A CN113781494A CN 113781494 A CN113781494 A CN 113781494A CN 202110207880 A CN202110207880 A CN 202110207880A CN 113781494 A CN113781494 A CN 113781494A
Authority
CN
China
Prior art keywords
image
sub
target
height
segmentation
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
CN202110207880.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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110207880.XA priority Critical patent/CN113781494A/en
Publication of CN113781494A publication Critical patent/CN113781494A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure discloses an image segmentation method, an image segmentation device, an electronic device and a medium. One embodiment of the method comprises: acquiring the height and width of a first target image; inquiring whether a second target image with the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each image in each pre-segmented image, and the image information comprises: height of the image, width of the image; and carrying out image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image. The embodiment can quickly and efficiently utilize the image experience database to realize the segmentation of the image, thereby reducing the time for loading the image and improving the user experience.

Description

Image segmentation method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to an image segmentation method, an image segmentation device, electronic equipment and a computer readable medium.
Background
At present, a large number of images are usually contained in an item detail introduction page, and the time for loading the images is an important factor influencing the user experience. The image is usually divided into a plurality of sub-images and then sequentially loaded to shorten the loading time. For the image segmentation into several sub-images, the general approach is: the image is divided into several sub-images of the same height.
However, when the image is segmented in the above manner, there are often technical problems as follows:
since the image pixel distribution may not be uniform, although the height of the segmented image becomes small, the size of the image may have a large difference. When the size of the segmented image is large, the image loading speed is still influenced, and the purpose of shortening the image loading time is difficult to achieve.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose image segmentation methods, apparatuses, electronic devices and computer readable media to solve one or more of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide an image segmentation method, including: acquiring the height and width of a first target image; inquiring whether a second target image with the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each image in each pre-divided image, and the image information comprises: height of the image, width of the image; and according to the query result of the image experience database, performing image segmentation on the first target image to obtain at least one sub-image.
In a second aspect, some embodiments of the present disclosure provide an image segmentation apparatus, including: an acquisition unit configured to acquire a height and a width of a first target image; an inquiring unit configured to inquire whether a second target image having the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each of pre-divided images, the image information including: height of the image, width of the image; and the segmentation unit is configured to perform image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the disclosure provide a computer readable medium having a computer program stored thereon, where the program when executed by a processor implements a method as described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following beneficial effects: according to the image segmentation method disclosed by some embodiments of the disclosure, the image can be rapidly and efficiently segmented by using the image experience database, so that the time for loading the image is reduced, and the user experience is improved. Specifically, since the image pixel distribution may not be uniform, although the height of the segmented image becomes small, the size of the image may have a large difference. When the size of the segmented image is large, the image loading speed is still influenced, and the purpose of shortening the image loading time is difficult to achieve. Based on this, the image segmentation method of some embodiments of the present disclosure may first acquire the height and width of the first target image. Here, the height and width of the first target image are used to subsequently determine the second target image in the image experience database. Then, whether a second target image having the same height and width as the first target image is stored in the image experience database is queried. Wherein the image experience database stores image information of each image of pre-divided images, the image information including: height of the image, width of the image. Here, whether the segmentation result of each image in the image experience database can be utilized to check whether the second target image with the same height and width as the first target image is stored in the image experience database can be quickly and effectively realized. And finally, performing image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image. Therefore, the image segmentation method can rapidly and efficiently utilize the image experience database to realize the segmentation of the image, so that the time for loading the image is reduced, and the user experience is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a schematic illustration of one application scenario of an image segmentation method according to some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of an image segmentation method according to the present disclosure;
FIG. 3 is a flow diagram of further embodiments of an image segmentation method according to the present disclosure;
FIG. 4 is a schematic illustration of determining a first target segmentation count in some embodiments of an image segmentation method according to the present disclosure;
FIG. 5 is a schematic block diagram of some embodiments of an image segmentation apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of an image segmentation method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, the electronic device 101 may first acquire the height and width of the first target image 102. In the present application scenario, the height of the first target image may be 100 px. The width of the first target image may be 50 px. Then, it is queried whether or not a second target image having the same height and width as those of the above-described first target image 102 is stored in the image experience database 103. The image experience database 103 stores image information of each image in each pre-divided image, where the image information includes: height of the image, width of the image. In the present application scenario, each of the images includes: a first image 1031, a second image 1032, and a third image 1033. The image information of the first image 1031 is: "height: 100px, width: 50px ". The image information of the second image 1032 is: "height: 120px, width: 80px ". The image information of the third image 1033 is: "height: 200px, width: 150px ". Thus, the second target image may be the first image 1031. Finally, according to the query result of the image experience database, the first target image 102 is subjected to image segmentation to obtain at least one sub-image 104. Optionally, the query result may be that the second target image exists in an image experience database. In the present application scenario, the at least one sub-image 104 may include: sub-image 1041, sub-image 1042, sub-image 1043, sub-image 1044.
The electronic device 101 may be hardware or software. When the electronic device is hardware, the electronic device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it may be installed in the above-listed hardware devices. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of electronic devices in fig. 1 is merely illustrative. There may be any number of electronic devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of an image segmentation method according to the present disclosure is shown. The image segmentation method comprises the following steps:
step 201, acquiring the height and width of the first target image.
In some embodiments, the executing subject (e.g., the electronic device shown in fig. 1) of the image segmentation method may acquire the height and width of the first target image through a wired connection manner or a wireless connection manner. Wherein, the unit of the height and the width of the first target image may be px (Pixel). The first target image may be an article detail introduction image. Wherein, the article detail introduction image represents the basic information of the article.
As an example, the execution subject may acquire the height and width of the first target image through canvas drawing rendering calculation.
Step 202, inquiring whether a second target image with the same height and width as the first target image is stored in the image experience database.
In some embodiments, the executing entity may query whether a second target image having the same height and width as the first target image is stored in the image experience database. Wherein the image experience database stores image information of each image of pre-divided images, the image information including: height of the image, width of the image. As an example, the image experience database may be a MySQL database.
As an example, the execution subject may query whether a second target image having the same height and width as the first target image is stored in the image experience database through a related query instruction.
Step 203, performing image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image.
In some embodiments, the executing entity may perform image segmentation on the first target image according to a query result of the image experience database to obtain at least one sub-image. The query result of the image experience database may be that the image experience database includes the second target image. The image experience database may not include the second target image.
As an example, in response to the image experience database including the second target image, the first target image is segmented by using a segmentation method of the second target image to obtain at least one sub-image. In response to the image experience database not including the second target image, the first target image is divided into sub-images of a predetermined height size.
In some optional implementation manners of some embodiments, the performing image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image may include:
the first step, in response to the query result that the second target image does not exist, determining whether at least one third target image with a difference value between the height and/or the width of the third target image and the first target image in a third threshold exists in the image experience database. As an example, the third threshold may be 10 px.
In a second step, in response to the presence of at least one third target image in the image experience database, the height and/or width difference of which is between third thresholds with respect to the first target image, a set of image information associated with the at least one third target image is determined. Wherein the third target image corresponds to individual image information. At least one third target image is associated with the set of image information.
And thirdly, segmenting the first target image according to the second target segmentation times in the image information set to obtain a second sub-image set. As an example, the executing entity may divide the first target image by a second target division number, resulting in a second sub-image set.
And fourthly, determining the second sub-image set as the at least one sub-image in response to the height of each sub-image in the second sub-image set being less than or equal to a first threshold and the occupied storage space of the sub-image being less than or equal to a second threshold.
Optionally, the above steps further include:
in the first step, in response to that the height of a target sub-image in the second sub-image set is larger than the first threshold and/or the width of the target sub-image is larger than the second threshold, performing a binary division process on the target sub-image to obtain a sub-image set of the target sub-image. The binary division may be performed by equally dividing the target sub-image according to the height.
And secondly, removing the target sub-image in the second sub-image set to obtain a removed sub-image set.
And thirdly, determining the removed sub-image set and the sub-image set of the target sub-image as the at least one sub-image.
Optionally, the above steps further include: and in response to the fact that at least one third target image with the height and/or width difference value between the third target image and the first target image being within a third threshold value does not exist in the image experience database, performing binary segmentation processing on the first target image to obtain at least one sub-image.
Optionally, the performing the binary division processing on the first target image to obtain the at least one sub-image may include:
the first step, the following image segmentation step is performed on the first target image:
the first substep: the executing body may halve the first target image according to height to obtain a third sub-image set.
The second substep: the executing agent may determine whether the first target sub-image occupying a storage space larger than the second threshold exists in the third sub-image set.
The third substep: in response to that the occupied storage space of the target sub-image existing in the third sub-image set is larger than the second threshold, the executing entity may determine the target sub-image as the first target image, and continue to execute the image segmentation step.
A fourth substep: in response to the occupied storage space of each sub-image in the third sub-image set being less than or equal to the second threshold, the executing entity may determine whether a second target sub-image with a height greater than the first threshold exists in the third sub-image set.
A fifth substep: in response to determining that the second target sub-image does not exist in the third set of sub-images, the executing entity may determine the third set of sub-images as the at least one sub-image.
In response to determining that the second target sub-image exists in the third sub-image set, the executing entity may determine the second target sub-image as the first target image and continue to execute the image segmentation step.
Optionally, the above steps further include:
first, image information corresponding to the first target image is determined. As an example, the executing body may determine image information corresponding to the first target image according to a cutting process of the first target image.
And secondly, storing the image information corresponding to the first target image in the image experience database.
The above embodiments of the present disclosure have the following beneficial effects: according to the image segmentation method disclosed by some embodiments of the disclosure, the image can be rapidly and efficiently segmented by using the image experience database, so that the time for loading the image is reduced, and the user experience is improved. Specifically, since the image pixel distribution may not be uniform, although the height of the segmented image becomes small, the size of the image may have a large difference. When the size of the segmented image is large, the image loading speed is still influenced, and the purpose of shortening the image loading time is difficult to achieve. Based on this, the image segmentation method of some embodiments of the present disclosure may first acquire the height and width of the first target image. Here, the height and width of the first target image are used to subsequently determine the second target image in the image experience database. Then, whether a second target image having the same height and width as the first target image is stored in the image experience database is queried. Wherein the image experience database stores image information of each image of pre-divided images, the image information including: height of the image, width of the image. Here, whether the segmentation result of each image in the image experience database can be utilized to check whether the second target image with the same height and width as the first target image is stored in the image experience database can be quickly and effectively realized. And finally, performing image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image. Therefore, the image segmentation method can rapidly and efficiently utilize the image experience database to realize the segmentation of the image, so that the time for loading the image is reduced, and the user experience is improved.
With further reference to fig. 3, a flow 300 of further embodiments of an image segmentation method according to the present disclosure is shown. The image segmentation method comprises the following steps:
step 301, acquiring the height and width of the first target image.
Step 302, inquiring whether a second target image with the same height and width as the first target image is stored in the image experience database.
In some embodiments, the specific implementation of steps 301 and 302 and the technical effect thereof can refer to step 201 and 202 in the embodiment corresponding to fig. 2, which are not described herein again.
Step 303, in response to the query result indicating that the second target image exists, acquiring image information of the second target image.
In some embodiments, in response to the query result indicating that the second target image exists, the execution subject (e.g., the electronic device shown in fig. 1) may acquire the image information of the second target image in a wired manner or a wireless manner. Wherein the image information further includes: at least one division frequency corresponding to the image and the occurrence frequency of dividing the image with the same height and width. Each image in the image experience database may be used multiple times for segmentation of the acquired image to be segmented. Furthermore, the frequency corresponding to each image in the image experience database is counted, and the obtained number can be used as the occurrence number.
As an example, the execution subject may acquire the height and width of the second target image through canvas drawing rendering calculation.
Step 304, segmenting the first target image according to the first target segmentation frequency in the image information of the second target image to obtain a first sub-image set.
In some embodiments, the executing entity may divide the first target image according to a first target division number in the image information of the second target image, so as to obtain a first sub-image set. Wherein the first target division number is determined based on the number of occurrences in the image information of the second target image.
It should be further noted that, for the determination of the first target division number, reference may be made to fig. 4. The first target image 401 has a height of 100px and a width of 50 px. There may be at least one second target image in the same height and width as the first target image 401 in the image experience database. In the present application scenario, the number of occurrences of the second target image 4021 is 5. The number of occurrences of the second target image 4022 is 11. The number of occurrences of the second target image 4023 is 10. The second target image 4021, the second target image 4022, and the second target image 4023 correspond to the number of unique divisions. Further, the number of times of division of the second target image 4022 having the largest number of occurrences is selected as the first target number of times of division.
Step 305, in response to that the height of each sub-image in the first sub-image set is less than or equal to a first threshold and the occupied storage space of the sub-image is less than or equal to a second threshold, determining the first sub-image set as the at least one sub-image.
In some embodiments, in response to the height of each sub-image in the first set of sub-images being equal to or less than a first threshold and the occupied storage space of the sub-image being equal to or less than a second threshold, the executing entity may determine the first set of sub-images as the at least one sub-image. The first threshold and the second threshold may be preset. Therefore, the height of each sub-image in the at least one sub-image is smaller than or equal to a first threshold value, and the occupied storage space of the sub-image is smaller than or equal to a second threshold value. Therefore, smooth and unsmooth image loading can be guaranteed, and user experience is guaranteed.
In some optional implementations of some embodiments, the number of occurrences in the image information of the second target image corresponding to the first target segmentation number in the image experience database is increased by 1. It should be noted that, by updating the image information of the second target image, the subsequent image segmentation using the image experience database can be made simpler and more efficient.
In some optional implementations of some embodiments, the foregoing step further includes:
in the first step, in response to that the height of the target sub-image in the first sub-image set is greater than the first threshold and/or the width of the target sub-image in the first sub-image set is greater than the second threshold, the execution subject may perform a partition process on the target sub-image to obtain a sub-image set of the target sub-image. As an example, the above-described binary division processing may be to divide the target sub-image into average according to the size of the height.
And secondly, removing the target sub-image in the first sub-image set to obtain a removed sub-image set.
And thirdly, determining the removed sub-image set and the sub-image set of the target sub-image as the at least one sub-image.
As can be seen from fig. 3, compared with the description of some embodiments corresponding to fig. 2, the flow 300 of the image segmentation method in some embodiments corresponding to fig. 3 highlights the specific steps of the image experience database where the second target image has the same height and width as the first target image. Therefore, the scheme described by the embodiments can effectively and accurately segment the first target image through the image information of the second target image.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an image segmentation apparatus, which correspond to those shown in fig. 2, and which may be applied in particular in various electronic devices.
As shown in fig. 5, an image segmentation apparatus 500 includes: an acquisition unit 501, a query unit 502 and a segmentation unit 503. Wherein the obtaining unit 501 is configured to: the height and width of the first target image are acquired. The query unit 502 is configured to: inquiring whether a second target image with the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each image in each pre-divided image, and the image information comprises: height of the image, width of the image. The division unit 503 is configured to: and according to the query result of the image experience database, performing image segmentation on the first target image to obtain at least one sub-image.
In some optional implementations of some embodiments, the image information further includes: the number of image segmentations, the number of occurrences of segmentation of images of the same height and width, and the apparatus 500 further comprises: an image information acquisition unit, an image segmentation unit, a determination unit (not shown in the figure). Wherein the image information acquisition unit may be configured to: and acquiring the image information of the second target image in response to the query result that the second target image exists. The image segmentation unit may be configured to: and dividing the first target image according to a first target division frequency in the image information of the second target image to obtain a first sub-image set, wherein the first target division frequency is determined based on the occurrence frequency in the image information of the second target image. The determination unit may be configured to: and determining the first sub-image set as the at least one sub-image in response to the height of each sub-image in the first sub-image set being less than or equal to a first threshold and the occupied storage space of the sub-image being less than or equal to a second threshold.
In some optional implementations of some embodiments, the apparatus 500 further includes: a unit (not shown) is added. Wherein the adding unit may be configured to: and increasing the number of occurrences of the image information of the second target image corresponding to the first target division number in the image experience database by 1.
In some optional implementations of some embodiments, the apparatus 500 further includes: processing unit, removal unit, sub-image determination unit (not shown in the figure). Wherein the processing unit may be configured to: and in response to the fact that the height of the target sub-image in the first sub-image set is larger than the first threshold and/or the width of the target sub-image in the first sub-image set is larger than the second threshold, performing division processing on the target sub-image to obtain a sub-image set of the target sub-image. The removal unit may be configured to: and removing the target sub-image in the first sub-image set to obtain a removed sub-image set. The sub-image determination unit may be configured to: and determining the removed sub-image set and the sub-image set of the target sub-image as the at least one sub-image.
In some optional implementations of some embodiments, the image segmentation unit may be further configured to: in response to the query result being that the second target image does not exist, determining whether at least one third target image having a difference in height and/or width between a third threshold value and the first target image exists in the image experience database; in response to the presence of at least one third target image in the image experience database having a difference in height and/or width between a third threshold value and the first target image, determining a set of image information associated with the at least one third target image; dividing the first target image according to the second target division times in the image information set to obtain a second sub-image set; and determining the second sub-image set as the at least one sub-image in response to the height of each sub-image in the second sub-image set being less than or equal to a first threshold and the occupied storage space of the sub-image being less than or equal to a second threshold.
In some optional implementations of some embodiments, the apparatus 500 further includes: a subdivision processing unit, a sub-image removal unit, at least one sub-image determination unit (not shown). Wherein the binary processing unit may be configured to: and in response to that the height of the target sub-image in the second sub-image set is larger than the first threshold and/or the width of the target sub-image in the second sub-image set is larger than the second threshold, performing division processing on the target sub-image to obtain a sub-image set of the target sub-image. The sub-image removal unit may be configured to: and removing the target sub-image in the second sub-image set to obtain a removed sub-image set. The at least one sub-image determination unit may be configured to: and determining the removed sub-image set and the sub-image set of the target sub-image as the at least one sub-image.
In some optional implementations of some embodiments, the apparatus 500 further includes: an image segmentation unit (not shown). Wherein the image binary segmentation processing unit may be configured to: and in response to the fact that at least one third target image with the height and/or width difference value between the third target image and the first target image being within a third threshold value does not exist in the image experience database, performing binary segmentation processing on the first target image to obtain at least one sub-image.
In some optional implementations of some embodiments, the image segmentation unit may be further configured to: performing the following image segmentation steps on the first target image: halving the first target image according to the height to obtain a third sub-image set; determining whether a first target sub-image occupying storage space larger than the second threshold exists in the third sub-image set; determining the target sub-image as the first target image and continuing to execute the image segmentation step in response to the fact that the occupied storage space of the target sub-image in the third sub-image set is larger than the second threshold; determining whether a second target sub-image with a height larger than a first threshold exists in the third sub-image set or not in response to the occupied storage space of each sub-image in the third sub-image set being smaller than or equal to the second threshold; determining the third set of sub-images as the at least one sub-image in response to determining that the second target sub-image does not exist in the third set of sub-images; and in response to determining that the second target sub-image exists in the third sub-image set, determining the second target sub-image as the first target image, and continuing to perform the image segmentation step.
In some optional implementations of some embodiments, the apparatus 500 further includes: an information determination unit and a storage unit (not shown in the figure). Wherein the information determination unit may be configured to: and determining image information corresponding to the first target image. The storage unit may be configured to: and storing the image information corresponding to the first target image in the image experience database.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., the electronic device of FIG. 1) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described above in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having 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. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring the height and width of a first target image; inquiring whether a second target image with the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each image in each pre-divided image, and the image information comprises: height of the image, width of the image; and according to the query result of the image experience database, performing image segmentation on the first target image to obtain at least one sub-image.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a query unit, and a segmentation unit. Where the names of the cells do not in some cases constitute a limitation of the cell itself, for example, the acquisition cell may also be described as a "cell acquiring the height and width of the first target image".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (12)

1. An image segmentation method comprising:
acquiring the height and width of a first target image;
inquiring whether a second target image with the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each image in each pre-segmented image, and the image information comprises: height of the image, width of the image;
and carrying out image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image.
2. The method of claim 1, wherein the image information further comprises: the number of image divisions, the number of occurrences of dividing an image having the same height and width; and
the image segmentation is performed on the first target image according to the query result of the image experience database to obtain at least one sub-image, and the method comprises the following steps:
responding to the query result that the second target image exists, and acquiring image information of the second target image;
segmenting the first target image according to a first target segmentation frequency in the image information of the second target image to obtain a first sub-image set, wherein the first target segmentation frequency is determined based on the occurrence frequency in the image information of the second target image;
determining the first sub-image set as the at least one sub-image in response to a height of each sub-image in the first sub-image set being less than or equal to a first threshold and an occupied storage space of the sub-image being less than or equal to a second threshold.
3. The method of claim 2, wherein the method further comprises:
and increasing the occurrence frequency in the image information of the second target image corresponding to the first target segmentation frequency in the image experience database by 1.
4. The method of claim 2, wherein the method further comprises:
in response to that the height of a target sub-image in the first sub-image set is larger than the first threshold and/or the width of the target sub-image is larger than the second threshold, performing division processing on the target sub-image to obtain a sub-image set of the target sub-image;
removing the target sub-image in the first sub-image set to obtain a removed sub-image set;
and determining the removed sub-image set and the sub-image set of the target sub-image as the at least one sub-image.
5. The method of claim 2, wherein the image segmenting the first target image into at least one sub-image according to the query result of the image experience database comprises:
in response to the query result being that the second target image does not exist, determining whether at least one third target image having a difference in height and/or width between a third threshold value and the first target image exists in the image experience database;
in response to there being at least one third target image in the image experience database having a difference in height and/or width between a third threshold value with respect to the first target image, determining a set of image information associated with the at least one third target image;
segmenting the first target image according to the second target segmentation times in the image information set to obtain a second sub-image set;
determining the second set of sub-images as the at least one sub-image in response to a height of each sub-image in the second set of sub-images being less than or equal to a first threshold and an occupied storage space of the sub-image being less than or equal to a second threshold.
6. The method of claim 5, wherein the method further comprises:
in response to that the height of a target sub-image in the second sub-image set is larger than the first threshold and/or the width of the target sub-image is larger than the second threshold, performing division processing on the target sub-image to obtain a sub-image set of the target sub-image;
removing the target sub-image in the second sub-image set to obtain a removed sub-image set;
and determining the removed sub-image set and the sub-image set of the target sub-image as the at least one sub-image.
7. The method of claim 5, wherein the method further comprises:
and in response to the fact that at least one third target image with the difference value of the height and/or the width of the first target image between a third threshold value and a third threshold value does not exist in the image experience database, performing binary segmentation processing on the first target image to obtain at least one sub-image.
8. The method of claim 7, wherein said performing a binary segmentation process on the first target image to obtain the at least one sub-image comprises:
performing the following image segmentation steps on the first target image:
halving the first target image according to the height to obtain a third sub-image set;
determining whether a first target sub-image occupying storage space larger than the second threshold exists in the third sub-image set;
determining the target sub-image as the first target image in response to the occupied storage space of the target sub-image existing in the third sub-image set being larger than the second threshold, and continuing to execute the image segmentation step;
determining whether a second target sub-image with a height greater than a first threshold exists in the third sub-image set in response to the occupied storage space of each sub-image in the third sub-image set being less than or equal to the second threshold;
in response to determining that the second target sub-image is not present in the third set of sub-images, determining the third set of sub-images as the at least one sub-image;
in response to determining that the second target sub-image is present in the third set of sub-images, determining the second target sub-image as the first target image, and continuing to perform the image segmentation step.
9. The method of any of claims 4 or 6-7, wherein the method further comprises:
determining image information corresponding to the first target image;
and storing the image information corresponding to the first target image in the image experience database.
10. An image segmentation apparatus comprising:
an acquisition unit configured to acquire a height and a width of a first target image;
a query unit configured to query whether a second target image having the same height and width as the first target image is stored in an image experience database, wherein the image experience database stores image information of each of pre-divided images, the image information including: height of the image, width of the image;
and the segmentation unit is configured to perform image segmentation on the first target image according to the query result of the image experience database to obtain at least one sub-image.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-9.
CN202110207880.XA 2021-02-25 2021-02-25 Image segmentation method and device, electronic equipment and computer readable medium Pending CN113781494A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110207880.XA CN113781494A (en) 2021-02-25 2021-02-25 Image segmentation method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110207880.XA CN113781494A (en) 2021-02-25 2021-02-25 Image segmentation method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113781494A true CN113781494A (en) 2021-12-10

Family

ID=78835640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110207880.XA Pending CN113781494A (en) 2021-02-25 2021-02-25 Image segmentation method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113781494A (en)

Similar Documents

Publication Publication Date Title
CN110058936B (en) Method, apparatus and computer program product for determining an amount of resources of a dedicated processing resource
CN111784712B (en) Image processing method, device, equipment and computer readable medium
CN110288625B (en) Method and apparatus for processing image
CN112650790B (en) Target point cloud plane determining method and device, electronic equipment and storage medium
CN111598902B (en) Image segmentation method, device, electronic equipment and computer readable medium
CN111757100B (en) Method and device for determining camera motion variation, electronic equipment and medium
CN112182374B (en) Inventory control method, apparatus, electronic device, and computer-readable medium
CN111158907B (en) Data processing method and device, electronic equipment and storage medium
CN111726476B (en) Image processing method, device, equipment and computer readable medium
CN113792869B (en) Video processing method and device based on neural network chip and electronic equipment
CN113781494A (en) Image segmentation method and device, electronic equipment and computer readable medium
CN110209851B (en) Model training method and device, electronic equipment and storage medium
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN111815654A (en) Method, apparatus, device and computer readable medium for processing image
CN111680754A (en) Image classification method and device, electronic equipment and computer-readable storage medium
CN111258582A (en) Window rendering method and device, computer equipment and storage medium
CN112215789B (en) Image defogging method, device, equipment and computer readable medium
CN112884794B (en) Image generation method, device, electronic equipment and computer readable medium
CN114040014B (en) Content pushing method, device, electronic equipment and computer readable storage medium
CN113362097B (en) User determination method and device
CN112488943B (en) Model training and image defogging method, device and equipment
CN112395447A (en) Label system updating method, device and equipment based on picture and storage medium
CN111625692A (en) Feature extraction method, device, electronic equipment and computer readable medium
CN112328131A (en) Information display method and device, electronic equipment and computer readable medium
CN111815656A (en) Video processing method, video processing device, electronic equipment and computer readable 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