Image segmentation method, device, electronic device and computer-readable medium

By querying the image experience database to obtain the segmentation results of the target image, the problem of slow loading speed caused by uneven pixels in image segmentation is solved, fast and efficient image segmentation is achieved, and the user experience is improved.

CN113781494BActive Publication Date: 2025-09-12BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110207880.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-25
Publication Date
2025-09-12
Estimated Expiration
2041-02-25

AI Technical Summary

Technical Problem

In the existing technology, due to the uneven distribution of image pixels during image segmentation, the sizes of the segmented images vary greatly, which affects the image loading speed and makes it difficult to effectively shorten the loading time.

Method used

By obtaining the height and width of the target image, the image experience database is queried to see whether there are pre-segmented images of the same size stored. The image is segmented according to the query results, and the target image is quickly segmented using the segmentation results in the database.

Benefits of technology

It achieves fast and efficient image segmentation, reduces image loading time and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113781494B_ABST
    Figure CN113781494B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose an image segmentation method, apparatus, electronic device, and medium. A specific implementation of the method includes: obtaining the height and width of a first target image; querying an image experience database to see whether a second target image with the same height and width as the first target image is stored, wherein the image experience database stores image information of each of the pre-segmented images, and the image information includes: the height of the image, the width of the image; and performing image segmentation on the first target image based on the query results of the image experience database to obtain at least one sub-image. This implementation can quickly and efficiently utilize the image experience database to implement image segmentation, thereby reducing the time to load images and improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to an image segmentation method, apparatus, electronic device, and computer-readable medium. Background Art

[0002] Currently, item detail pages often contain numerous images, and image loading time is a significant factor impacting user experience. Images are often split into several sub-images and loaded sequentially to shorten loading times. This approach typically involves dividing an image into several sub-images of equal height.

[0003] However, when using the above method to segment images, the following technical problems often occur:

[0004] Since image pixels may be unevenly distributed, the image after segmentation may be smaller in height, but the image size may vary greatly. If the size of the segmented image is large, it will still affect the image loading speed, making it difficult to achieve the goal of shortening the image loading time. Summary of the Invention

[0005] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0006] Some embodiments of the present disclosure provide image segmentation methods, devices, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.

[0007] In a first aspect, some embodiments of the present disclosure provide an image segmentation method, including: obtaining the height and width of a first target image; querying 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 includes: the height of the image, and the width of the image; performing image segmentation on the first target image according to the query results of the image experience database to obtain at least one sub-image.

[0008] In a second aspect, some embodiments of the present disclosure provide an image segmentation device, comprising: an acquisition unit, configured to acquire the height and width of a first target image; a query unit, configured to query 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 includes: the height of the image, and the width of the image; a segmentation unit, configured to perform image segmentation on the first target image according to the query results of the image experience database to obtain at least one sub-image.

[0009] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner in the first aspect.

[0010] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner in the first aspect is implemented.

[0011] The above-described embodiments of the present disclosure have the following beneficial effects: The image segmentation methods of some embodiments of the present disclosure can quickly and efficiently utilize the image experience database to segment images, thereby reducing image loading time and improving user experience. Specifically, due to the uneven distribution of image pixels, although the height of the segmented images is reduced, the image sizes may vary significantly. When the segmented images are large, this still affects image loading speed, making it difficult to achieve the goal of shortening image loading time. Based on this, the image segmentation methods of some embodiments of the present disclosure can first obtain the height and width of a first target image. Here, the height and width of the first target image are used to subsequently determine a second target image in the image experience database. Then, the image experience database is queried to determine whether a second target image with the same height and width as the first target image is stored. The image experience database stores image information for each of the pre-segmented images, including the image height and width. By determining whether a second target image with the same height and width as the first target image is stored in the image experience database, it can be determined whether the segmentation results of each image in the image experience database can be used to quickly and efficiently segment the first target image. Finally, based on the query results of the image experience database, the first target image is segmented to obtain at least one sub-image. Thus, the image segmentation method can quickly and efficiently utilize the image experience database to segment the image, thereby reducing image loading time and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0013] Figure 1 is a schematic diagram of an application scenario of the image segmentation method according to some embodiments of the present disclosure;

[0014] Figure 2 is a flowchart of some embodiments of the image segmentation method according to the present disclosure;

[0015] Figure 3 is a flowchart of other embodiments of the image segmentation method according to the present disclosure;

[0016] Figure 4 is a schematic diagram of determining the first target segmentation times in some embodiments of the image segmentation method disclosed herein;

[0017] Figure 5is a schematic structural diagram of some embodiments of the image segmentation device according to the present disclosure;

[0018] Figure 6 It is a structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0019] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0020] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0021] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0022] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0023] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0024] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0025] Figure 1 It is a schematic diagram of an application scenario of the image segmentation method according to some embodiments of the present disclosure.

[0026] exist Figure 1In an application scenario, electronic device 101 can first obtain the height and width of first target image 102. In this application scenario, the height of the first target image can be 100 px. The width of the first target image can be 50 px. Then, electronic device 101 queries image experience database 103 to see whether a second target image with the same height and width as first target image 102 is stored. Image experience database 103 stores image information for each of the pre-segmented images, including image height and image width. In this application scenario, the images include first image 1031, second image 1032, and third image 1033. The image information for first image 1031 is: "Height: 100 px, Width: 50 px." The image information for second image 1032 is: "Height: 120 px, Width: 80 px." The image information for third image 1033 is: "Height: 200 px, Width: 150 px." Therefore, the second target image can be first image 1031. Finally, based on the query result of the image experience database, the first target image 102 is segmented to obtain at least one sub-image 104. Optionally, the query result may be that the second target image exists in the image experience database. In this application scenario, the at least one sub-image 104 may include sub-image 1041, sub-image 1042, sub-image 1043, and sub-image 1044.

[0027] It should be noted that the electronic device 101 can be hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0028] It should be understood that Figure 1 The number of electronic devices in the embodiment is merely illustrative. Any number of electronic devices may be provided according to implementation requirements.

[0029] Continue to refer Figure 2 , shows a process 200 of some embodiments of the image segmentation method according to the present disclosure. The image segmentation method comprises the following steps:

[0030] Step 201: Obtain the height and width of a first target image.

[0031] In some embodiments, the execution subject of the above image segmentation method (for example Figure 1The electronic device shown in FIG. 1 may obtain the height and width of the first target image via a wired or wireless connection. The height and width of the first target image may be expressed in pixels (px). The first target image may be an item details image. The item details image represents basic information about the item.

[0032] As an example, the execution entity may obtain the height and width of the first target image through canvas drawing rendering calculation.

[0033] Step 202: Check whether a second target image with the same height and width as the first target image is stored in the image experience database.

[0034] In some embodiments, the execution entity may query an image experience database to determine whether a second target image with the same height and width as the first target image is stored. The image experience database stores image information for each of the pre-segmented images, including image height and image width. For example, the image experience database may be a MySQL database.

[0035] As an example, the execution entity may query the image experience database through a related query instruction whether a second target image having the same height and width as the first target image is stored.

[0036] 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.

[0037] In some embodiments, the execution entity may perform image segmentation on the first target image based on a query result of the image experience database to obtain at least one sub-image. The query result of the image experience database may indicate that the second target image is included in the image experience database. Alternatively, the query result of the image experience database may indicate that the second target image is not included in the image experience database.

[0038] As an example, in response to the second target image being included in the image experience database, the first target image is segmented using the segmentation method for the second target image to obtain at least one sub-image. In response to the second target image not being included in the image experience database, the first target image is segmented into sub-images of predetermined heights.

[0039] In some optional implementations of some embodiments, performing image segmentation on the first target image to obtain at least one sub-image based on the query results of the image experience database may include the following steps:

[0040] In the first step, in response to the query result indicating that the second target image does not exist, determining whether there is at least one third target image in the image experience database whose height and / or width difference from the first target image is within a third threshold. As an example, the third threshold may be 10 pixels.

[0041] In the second step, in response to the presence of at least one third target image in the image experience database whose height and / or width difference from the first target image is within a third threshold, an image information set associated with the at least one third target image is determined. The third target image corresponds to separate image information. Therefore, the at least one third target image is associated with the image information set.

[0042] In the third step, the first target image is segmented according to the second target segmentation times in the image information set to obtain a second sub-image set. As an example, the execution entity may segment the first target image a second target segmentation times to obtain a second sub-image set.

[0043] In the fourth step, 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 storage space occupied by the sub-image being less than or equal to a second threshold, the second sub-image set is determined as the at least one sub-image.

[0044] Optionally, the above steps further include:

[0045] In the first step, in response to a target sub-image in the second sub-image set having a height greater than the first threshold and / or a width greater than the second threshold, the target sub-image is subjected to a binary segmentation process to obtain a sub-image set of the target sub-image. The binary segmentation process may be performed by evenly dividing the target sub-image according to the height.

[0046] In the second step, the target sub-image in the second sub-image set is removed to obtain a sub-image set after removal.

[0047] In a third step, the sub-image set after the removal and the sub-image set of the target sub-image are determined as the at least one sub-image.

[0048] Optionally, the above steps also include: in response to the absence of at least one third target image in the above image experience database whose height and / or width difference with the first target image is within a third threshold, performing binary segmentation processing on the above first target image to obtain the above at least one sub-image.

[0049] Optionally, performing binary segmentation on the first target image to obtain the at least one sub-image may include the following steps:

[0050] In the first step, the following image segmentation steps are performed on the first target image:

[0051] First sub-step: the execution entity may divide the first target image into two equal parts according to height to obtain a third sub-image set.

[0052] Second sub-step: the execution entity may determine whether there is a first target sub-image in the third sub-image set that occupies a storage space greater than the second threshold.

[0053] The third sub-step: in response to the target sub-image in the third sub-image set occupying a storage space greater than the second threshold, the execution entity may determine the target sub-image as the first target image and continue to perform the image segmentation step.

[0054] Fourth sub-step: In response to the storage space occupied by each sub-image in the third sub-image set being less than or equal to the second threshold, the execution entity may determine whether there is a second target sub-image in the third sub-image set with a height greater than the first threshold.

[0055] Fifth sub-step: in response to determining that the second target sub-image does not exist in the third sub-image set, the execution entity may determine the third sub-image set as the at least one sub-image.

[0056] In the second step, in response to determining that the second target sub-image exists in the third sub-image set, the execution entity may determine the second target sub-image as the first target image and continue to perform the image segmentation step.

[0057] Optionally, the above steps further include:

[0058] The first step is to determine the image information corresponding to the first target image. As an example, the execution entity may determine the image information corresponding to the first target image based on a segmentation process of the first target image.

[0059] The second step is to store the image information corresponding to the first target image in the image experience database.

[0060] The above-described embodiments of the present disclosure have the following beneficial effects: The image segmentation methods of some embodiments of the present disclosure can quickly and efficiently utilize the image experience database to segment images, thereby reducing image loading time and improving user experience. Specifically, due to the uneven distribution of image pixels, although the height of the segmented images is reduced, the image sizes may vary significantly. When the segmented images are large, this still affects image loading speed, making it difficult to achieve the goal of shortening image loading time. Based on this, the image segmentation methods of some embodiments of the present disclosure can first obtain the height and width of a first target image. Here, the height and width of the first target image are used to subsequently determine a second target image in the image experience database. Then, the image experience database is queried to determine whether a second target image with the same height and width as the first target image is stored. The image experience database stores image information for each of the pre-segmented images, including the image height and width. By determining whether a second target image with the same height and width as the first target image is stored in the image experience database, it can be determined whether the segmentation results of each image in the image experience database can be used to quickly and efficiently segment the first target image. Finally, based on the query results of the image experience database, the first target image is segmented to obtain at least one sub-image. Thus, the image segmentation method can quickly and efficiently utilize the image experience database to segment the image, thereby reducing image loading time and improving the user experience.

[0061] Further references Figure 3 , shows a process 300 of another embodiment of the image segmentation method according to the present disclosure. The image segmentation method includes the following steps:

[0062] Step 301: Obtain the height and width of a first target image.

[0063] Step 302: Check whether a second target image with the same height and width as the first target image is stored in the image experience database.

[0064] In some embodiments, the specific implementation of steps 301-302 and the technical effects thereof can be referred to in Figure 2 Steps 201-202 in the corresponding embodiment will not be repeated here.

[0065] Step 303 : In response to the query result indicating that the second target image exists, image information of the second target image is acquired.

[0066] In some embodiments, in response to the query result that the second target image exists, the execution subject (eg Figure 1The electronic device shown in FIG. 1 can obtain image information of the second target image via a wired or wireless method. The image information also includes at least one segmentation count corresponding to the image and the number of occurrences of segmenting images of the same height and width. Each image in the image experience database may be used multiple times to obtain segmentations of the image to be segmented. Furthermore, the frequency of each image in the image experience database is counted, and the resulting number can be used as the number of occurrences.

[0067] As an example, the execution entity may obtain the height and width of the second target image through canvas drawing rendering calculation.

[0068] Step 304 : Segment the first target image according to the first target segmentation times in the image information of the second target image to obtain a first sub-image set.

[0069] In some embodiments, the execution entity may segment the first target image to obtain a first set of sub-images based on a number of first target segmentation times in the image information of the second target image, wherein the number of first target segmentation times is determined based on a number of first target appearances in the image information of the second target image.

[0070] It should be further explained that for determining the number of first target segmentation times, please refer to Figure 4 . Among them, the height of the first target image 401 is 100px and the width is 50px. There may be at least one second target image with the same height and width as the first target image 401 in the above-mentioned image experience database. In this application scenario, the number of appearances of the above-mentioned second target image 4021 is 5 times. The number of appearances of the above-mentioned second target image 4022 is 11 times. The number of appearances of the above-mentioned second target image 4023 is 10 times. The second target image 4021, the second target image 4022, and the second target image 4023 each correspond to a separate number of segmentation times. Then, the number of segmentation times of the second target image 4022 with the largest number of appearances is selected as the first target segmentation times.

[0071] Step 305 : 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 storage space occupied by the sub-image being less than or equal to a second threshold, determine the first sub-image set as the at least one sub-image.

[0072] In some embodiments, 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 storage space occupied by the sub-image being less than or equal to a second threshold, the execution entity may determine the first sub-image set as the at least one sub-image. The first and second thresholds may be pre-set. Thus, the height of each sub-image in the at least one sub-image is less than or equal to the first threshold and the storage space occupied by the sub-image is less than or equal to the second threshold. This ensures smooth image loading without lag, enhancing the user experience.

[0073] In some optional implementations of some embodiments, the number of occurrences of the first target segmentation times in the image information of the second target image in the image experience database is increased by 1. It should be noted that by updating the image information of the second target image, subsequent image segmentation using the image experience database can be made simpler and more effective.

[0074] In some optional implementations of some embodiments, the above steps further include:

[0075] In the first step, in response to a target sub-image in the first sub-image set having a height greater than the first threshold and / or a width greater than the second threshold, the execution entity may perform a binary segmentation process on the target sub-image to obtain a sub-image set of the target sub-image. As an example, the binary segmentation process may be to divide the target sub-image into equal parts according to height.

[0076] In the second step, the target sub-image in the first sub-image set is removed to obtain a sub-image set after removal.

[0077] In a third step, the sub-image set after the removal and the sub-image set of the target sub-image are determined as the at least one sub-image.

[0078] from Figure 3 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 3 The image segmentation method process 300 of some corresponding embodiments further highlights the specific steps of determining that a second target image with the same height and width as the first target image exists in the image experience database. Thus, the solutions described in these embodiments efficiently and accurately segment the first target image using the image information of the second target image.

[0079] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an image segmentation device. These device embodiments are similar to Figure 2Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0080] like Figure 5 As shown, an image segmentation device 500 includes: an acquisition unit 501, a query unit 502 and a segmentation unit 503. The acquisition unit 501 is configured to: acquire the height and width of the first target image. The query unit 502 is configured to: query whether a second target image with the same height and width as the first target image is stored in the image experience database, wherein the image experience database stores the image information of each of the pre-segmented images, and the image information includes: the height of the image and the width of the image. The segmentation unit 503 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.

[0081] In some optional implementations of some embodiments, the image information further includes: the number of times the image is segmented, the number of occurrences of segmenting images with the same height and width, and the apparatus 500 further includes: an image information acquisition unit, an image segmentation unit, and a determination unit (not shown in the figure). The image information acquisition unit may be configured to: in response to the query result indicating the presence of the second target image, acquire the image information of the second target image. The image segmentation unit may be configured to: segment the first target image according to the number of first target segmentations in the image information of the second target image, to obtain a first sub-image set, wherein the number of first target segmentations is determined based on the number of occurrences in the image information of the second target image. The determination unit may be configured to: in response to the fact that the height of each sub-image in the first sub-image set is less than or equal to a first threshold and the storage space occupied by the sub-image is less than or equal to a second threshold, determine the first sub-image set as the at least one sub-image.

[0082] In some optional implementations of some embodiments, the apparatus 500 further includes an adding unit (not shown). The adding unit may be configured to increase the number of occurrences of the first target segmentation times in the image information of the second target image in the image experience database by 1.

[0083] In some optional implementations of some embodiments, the apparatus 500 further includes: a processing unit, a removal unit, and a sub-image determination unit (not shown in the figure). The processing unit may be configured to: in response to the existence of a target sub-image in the first sub-image set having a height greater than the first threshold and / or a width greater than the second threshold, perform a binary segmentation process on the target sub-image to obtain a sub-image set of the target sub-image. The removal unit may be configured to: remove the target sub-image from the first sub-image set to obtain a sub-image set after removal. The sub-image determination unit may be configured to: determine the sub-image set after removal and the sub-image set of the target sub-image as the at least one sub-image.

[0084] In some optional implementations of some embodiments, the image segmentation unit may be further configured to: in response to the query result that the second target image does not exist, determine whether there is at least one third target image in the image experience database whose height and / or width difference with the first target image is within a third threshold; in response to the existence of at least one third target image in the image experience database whose height and / or width difference with the first target image is within a third threshold, determine an image information set associated with the at least one third target image; segment the first target image according to the second target segmentation times in the image information set to obtain a second sub-image set; in response to the height of each sub-image in the second sub-image set being less than or equal to the first threshold and the storage space occupied by the sub-image being less than or equal to the second threshold, determine the second sub-image set as the at least one sub-image.

[0085] In some optional implementations of some embodiments, the apparatus 500 further includes: a binary segmentation processing unit, a sub-image removal unit, and at least one sub-image determination unit (not shown in the figure). The binary segmentation processing unit may be configured to: in response to the existence of a target sub-image in the second sub-image set having a height greater than the first threshold and / or a width greater than the second threshold, perform a binary segmentation process 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: remove the target sub-image from the second sub-image set to obtain a sub-image set after removal. The at least one sub-image determination unit may be configured to: determine the sub-image set after removal and the sub-image set of the target sub-image as the at least one sub-image.

[0086] In some optional implementations of some embodiments, the apparatus 500 further includes an image binary segmentation processing unit (not shown). The image binary segmentation processing unit may be configured to: in response to the absence of at least one third target image in the image experience database having a height and / or width difference with the first target image within a third threshold, perform binary segmentation on the first target image to obtain the at least one sub-image.

[0087] In some optional implementations of some embodiments, the image binary segmentation processing unit can be further configured to: perform the following image segmentation steps on the above-mentioned first target image: divide the above-mentioned first target image into two equal parts according to height to obtain a third sub-image set; determine whether there is a first target sub-image in the above-mentioned third sub-image set that occupies a storage space greater than the above-mentioned second threshold; in response to the existence of a target sub-image in the above-mentioned third sub-image set that occupies a storage space greater than the above-mentioned second threshold, determine the above-mentioned target sub-image as the above-mentioned first target image, and continue to perform the above-mentioned image segmentation steps; in response to the storage space occupied by each sub-image in the above-mentioned third sub-image set being less than or equal to the above-mentioned second threshold, determine whether there is a second target sub-image in the above-mentioned third sub-image set that has a height greater than the first threshold; in response to determining that the above-mentioned second target sub-image does not exist in the above-mentioned third sub-image set, determine the above-mentioned third sub-image set as the above-mentioned at least one sub-image; in response to determining that the above-mentioned second target sub-image exists in the above-mentioned third sub-image set, determine the above-mentioned second target sub-image as the above-mentioned first target image, and continue to perform the above-mentioned image segmentation steps.

[0088] In some optional implementations of some embodiments, the apparatus 500 further includes an information determination unit and a storage unit (not shown). The information determination unit may be configured to determine image information corresponding to the first target image. The storage unit may be configured to store the image information corresponding to the first target image in the image experience database.

[0089] It is understood that the units described in the device 500 are similar to those in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be repeated here.

[0090] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 Schematic diagram of the structure of the electronic device 600. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0091] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0092] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as needed.

[0093] In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.

[0094] It should be noted that in some embodiments of the present disclosure, the computer-readable medium mentioned above may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0095] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0096] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs. When executed by the electronic device, the electronic device: obtains the height and width of a first target image; queries an image experience database to determine whether a second target image with the same height and width as the first target image is stored, wherein the image experience database stores image information of each of the pre-segmented images, including the image height and width; and performs image segmentation on the first target image based on the query results of the image experience database to obtain at least one sub-image.

[0097] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The units described in some embodiments of the present disclosure may be implemented in software or hardware. The units described may also be provided in a processor. For example, they may be described as follows: a processor includes an acquisition unit, a query unit, and a segmentation unit. The names of these units do not, in some cases, limit the units themselves. For example, the acquisition unit may also be described as a "unit for acquiring the height and width of the first target image."

[0100] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and 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 chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0101] The above description is only an illustration of some preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. An image segmentation method, comprising: Get the height and width of the first target image; querying 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 the pre-segmented images, the image information including: image height and image width; According to the query result of the image experience database, the first target image is segmented to obtain at least one sub-image.

2. The method according to claim 1, wherein The image information also includes: the number of times the image is segmented, the number of times images with the same height and width are segmented; and The step of 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 includes: In response to the query result indicating that the second target image exists, acquiring image information of the second target image; Segmenting the first target image according to a number of first target segmentation times in the image information of the second target image to obtain a first sub-image set, wherein the number of first target segmentation times is determined based on a number of appearances in the image information of the second target image; In response to the fact that the height of each sub-image in the first sub-image set is less than or equal to a first threshold and the storage space occupied by the sub-image is less than or equal to a second threshold, the first sub-image set is determined as the at least one sub-image.

3. The method according to claim 2, wherein: The method further comprises: The number of occurrences of the first target segmentation times in the image information of the second target image in the image experience database is increased by 1.

4. The method according to claim 2, wherein: The method further comprises: In response to a target sub-image in the first sub-image set having a height greater than the first threshold and / or a width greater than the second threshold, performing a binary segmentation process on the target sub-image to obtain a sub-image set of the target sub-image; removing the target sub-image from the first sub-image set to obtain a sub-image set after removal; The sub-image set after the removal and the sub-image set of the target sub-image are determined as the at least one sub-image.

5. The method according to claim 2, wherein: The step of 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 includes: In response to the query result being that the second target image does not exist, determining whether there is at least one third target image in the image experience database whose height and / or width difference from the first target image is within a third threshold; In response to the existence of at least one third target image in the image experience database whose height and / or width difference with the first target image is within a third threshold, determining an image information set 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; 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 storage space occupied by the sub-image being less than or equal to a second threshold, the second sub-image set is determined as the at least one sub-image.

6. The method according to claim 5, wherein: The method further comprises: In response to a target sub-image in the second sub-image set having a height greater than the first threshold and / or a width greater than the second threshold, performing a binary segmentation process on the target sub-image to obtain a sub-image set of the target sub-image; removing the target sub-image from the second sub-image set to obtain a sub-image set after removal; The sub-image set after the removal and the sub-image set of the target sub-image are determined as the at least one sub-image.

7. The method according to claim 5, wherein: The method further comprises: In response to the absence of at least one third target image in the image experience database whose height and / or width difference with the first target image is within a third threshold, binary segmentation is performed on the first target image to obtain the at least one sub-image.

8. The method according to claim 7, wherein: The performing binary segmentation processing on the first target image to obtain the at least one sub-image includes: The following image segmentation steps are performed on the first target image: Dividing the first target image into two equal parts according to height to obtain a third sub-image set; determining whether there is a first target sub-image in the third sub-image set that occupies a storage space greater than the second threshold; In response to the target sub-image in the third sub-image set occupying a storage space greater than the second threshold, determining the target sub-image as the first target image, and continuing to perform the image segmentation step; In response to the storage space occupied by each sub-image in the third sub-image set being less than or equal to the second threshold, determining whether there is a second target sub-image in the third sub-image set with a height greater than the first threshold; In response to determining that the second target sub-image does not exist in the third sub-image set, determining the third sub-image set 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 second target sub-image is determined to be the first target image, and the image segmentation step is continued.

9. The method according to any one of claims 4 or 6-7, wherein: The method further comprises: determining image information corresponding to the first target image; The image information corresponding to the first target image is stored in the image experience database.

10. An image segmentation device, comprising: an acquiring unit configured to acquire a height and a width of the 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 the pre-segmented images, the image information including: image height and image width; 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 the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

12. A computer-readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Multi-target threshold image segmentation method for fuzzy information and statistical information in fusion interval

    CN107220978A

  • Image segmentation method, image segmentation device, storage medium and electronic equipment

    CN111161256A