CN112215242A - Occlusion detection method and device based on region segmentation - Google Patents
Occlusion detection method and device based on region segmentation Download PDFInfo
- Publication number
- CN112215242A CN112215242A CN202011134093.9A CN202011134093A CN112215242A CN 112215242 A CN112215242 A CN 112215242A CN 202011134093 A CN202011134093 A CN 202011134093A CN 112215242 A CN112215242 A CN 112215242A
- Authority
- CN
- China
- Prior art keywords
- detected
- region
- elements
- aspect ratio
- grid
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 67
- 230000011218 segmentation Effects 0.000 title claims abstract description 42
- 238000000034 method Methods 0.000 claims abstract description 56
- 238000012545 processing Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 abstract description 22
- 238000004364 calculation method Methods 0.000 abstract description 12
- 238000005516 engineering process Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000010079 rubber tapping Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000005236 sound signal Effects 0.000 description 1
- 238000010897 surface acoustic wave method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20021—Dividing image into blocks, subimages or windows
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Life Sciences & Earth Sciences (AREA)
- Animal Behavior & Ethology (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Geometry (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a method and a device for shielding detection based on region segmentation. Wherein, the method comprises the following steps: determining shape characteristics of a plurality of elements to be detected in a fixed area; dividing the fixed area into a plurality of grid areas according to the shape characteristics; and carrying out occlusion detection on each element to be detected in the grid area. The invention solves the technical problem of high time complexity of the calculation process due to the fact that element shielding detection in the related technology needs to carry out shielding detection on all elements.
Description
Technical Field
The invention relates to the technical field of databases, in particular to a method and a device for occlusion detection based on region segmentation.
Background
Under the condition that a large number of node elements are randomly arranged in one region of the knowledge graph, the elements or characters are shielded from each other, so that information disorder and visual redundancy are caused. In order to solve the problem that the elements are mutually shielded and cannot be seen clearly, shielding detection is required to be carried out according to the levels of the elements, the shielded elements are hidden or the transparency is reduced, and the visual redundancy is reduced.
The method for detecting whether the two elements are mutually shielded is as follows:
the two rectangles with the size to be detected are provided, the positions of the two rectangles of AB on the upper side, the lower side, the left side and the right side are known, any one of the following four conditions is satisfied, if the rectangles are not mutually shielded, shielding occurs, the left side of the element A > the right side of the element B, the right side of the element A < the left side of the element B, the upper side of the element A > the lower side of the element B, and the lower side of the element A < the upper side. This calculation method is hereinafter referred to as primary occlusion detection calculation. When the elements are circles and circles, the circles and the rectangles both have corresponding shielding detection calculation methods.
In carrying out the present invention, the applicant has found that at least the following technical problems exist in the related art.
For example, when there are 1000 elements in a rectangular space, it is necessary to calculate whether the elements are occluded, the first element needs to perform occlusion detection calculation with the remaining 999 elements, the second element needs to perform occlusion detection with the remaining 999 elements, and so on, 1000 × 999 calculations are required to perform occlusion detection on all the elements, i.e., the time complexity is N2. In the related art, when the number of nodes to be subjected to occlusion detection is N, the time complexity of performing occlusion detection calculation for one time is N2The calculation amount is huge, and the time complexity of the calculation method for the occlusion detection in the space is high.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for occlusion detection based on region segmentation, which at least solve the technical problem of high time complexity of a calculation process due to the fact that occlusion detection of all elements is required in the occlusion detection of the elements in the related technology.
According to an aspect of the embodiments of the present invention, there is provided a method for occlusion detection based on region segmentation, including: determining shape characteristics of a plurality of elements to be detected in a fixed area; segmenting the fixed region into a plurality of grid regions according to the shape features; and carrying out shielding detection on each element to be detected in the grid area.
According to another aspect of the embodiments of the present invention, there is also provided an occlusion detection apparatus based on region segmentation, including: the determining unit is used for determining the shape characteristics of a plurality of elements to be detected in the fixed area; the processing unit is used for segmenting the fixed region into a plurality of grid regions according to the shape characteristics; and the detection unit is used for carrying out shielding detection on each element to be detected in the grid area.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a processor, a memory, and a program or instructions stored on the memory and executable on the processor, where the program or instructions, when executed by the processor, implement the steps of the method for occlusion detection based on region segmentation as described above.
According to another aspect of the embodiments of the present invention, there is also provided a readable storage medium, on which a program or instructions are stored, which when executed by a processor, implement the steps of the method for occlusion detection based on region segmentation as described above.
In the embodiment of the invention, the shape characteristics of a plurality of elements to be detected in the fixed area are determined; dividing the fixed area into a plurality of grid areas according to the shape characteristics; the method has the advantages that the shielding detection is carried out on each element to be detected in the grid region, the purpose of rapidly calculating the shielding detection of region segmentation is achieved, the technical effect of reducing the shielding detection calculated amount is achieved, and the technical problem that the time complexity of the calculation process is high due to the fact that the shielding detection needs to be carried out on all elements in the element shielding detection in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of a hardware environment of an alternative region segmentation-based occlusion detection method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an alternative occlusion detection method based on region segmentation according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an alternative conversion of an element to be detected into a target element, according to an embodiment of the invention;
FIG. 4 is a schematic illustration of an alternative fixed area segmentation in accordance with embodiments of the present invention;
FIG. 4a is a schematic illustration of yet another alternative fixed area segmentation in accordance with an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an alternative occlusion detection apparatus based on region segmentation according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an alternative electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
According to an aspect of the embodiments of the present invention, an embodiment of an occlusion detection method based on region segmentation is provided, and in this embodiment, an occlusion detection method based on region segmentation is provided, and optionally, as an optional implementation manner, the occlusion detection method based on region segmentation may be applied, but is not limited to, in an environment as shown in fig. 1. Fig. 1 is a schematic diagram of a hardware environment of an occlusion detection method based on region segmentation according to an embodiment of the present invention. As shown in fig. 1, a processor 100 in a server 10 obtains a knowledge graph from its own database 102 or a remote server 20, where the knowledge graph includes a plurality of elements to be detected, and the server has a data processing function and a data storage function and is connected to other servers through a communication network.
In this embodiment, the server 10 obtains a knowledge graph in which a plurality of elements to be detected exist, the plurality of elements to be detected are located in a fixed region of the knowledge graph, and the processor 100 obtains shape characteristics of the plurality of elements to be detected in the fixed region; dividing the fixed area into a plurality of grid areas according to the shape characteristics; and (3) carrying out occlusion detection on each element to be detected in the grid region so as to achieve the purpose of rapidly calculating occlusion detection of region segmentation and realize the technical effect of reducing occlusion detection calculated amount.
Fig. 2 is a schematic flowchart of an occlusion detection method based on region segmentation according to an embodiment of the present invention, and as shown in fig. 2, the method may specifically include the following steps:
s202, determining the shape characteristics of a plurality of elements to be detected in a fixed area;
in this embodiment, the elements to be detected include elements such as characters, pictures, and characters, and the shape characteristics include parameters such as a shape, a size, and an area of the elements to be detected. In the fixed region, the elements to be detected include multiple elements, and the shapes, sizes, areas, and the like of the multiple elements are different, so in this embodiment, the elements to be detected are converted into the same preset shape, for example, all the elements to be detected are converted into a rectangle, or all the elements to be detected are converted into a circle, then the length and width of the rectangular elements to be detected are determined, or the radius of the circular elements to be detected is determined, and the splitting manner of the fixed region is determined according to the length and width of the rectangular elements to be detected, or the radius of the circular elements to be detected.
For example, the fixed region is divided into a plurality of rectangular grid regions based on the length and width of the rectangular elements to be detected, the length and width of the rectangular grid regions are substantially the same as the average length and average width of the rectangular elements to be detected, and the width and height of the rectangular grid regions and the average width and height of the rectangular elements to be detected conform to a certain relationship.
As a preferred technical solution, in this embodiment, the shape characteristics of the multiple elements to be detected in the fixed region are determined, including but not limited to: converting the shapes of the elements to be detected into a plurality of target elements, wherein the target elements are rectangular elements to be detected; an average width and an average height of the plurality of target elements are determined.
Specifically, for example, as shown in fig. 3, an element 300 to be detected of a character type composed of characters is converted into a target element 302 including a plurality of characters. Then, the length and width of the target element 302 are obtained, i.e. the average width and the average height of the element to be detected are obtained.
S204, dividing the fixed area into a plurality of grid areas according to the shape characteristics;
specifically, after the element to be detected is uniformly converted into a preset shape, the fixed region is segmented according to the converted shape characteristics, and the fixed region is segmented into a plurality of grid regions with shapes corresponding to the shapes of the element to be detected. For example, if the element to be detected is rectangular, the fixed region may be divided into a plurality of rectangular grid regions, and if the element to be detected is circular, the fixed region may be divided into a plurality of square grid regions. The cutting directions of the grid regions in the fixed region are determined by the shape characteristics of the fixed region and the element to be detected, for example, the cutting directions of the rectangular fixed region are the X-axis direction and the Y-axis direction.
As a preferred technical solution, in this embodiment, the element to be detected is rectangular, and the shape feature includes an average width and an average height of the element to be detected, wherein the fixing region is divided into a plurality of grid regions according to the shape feature, including but not limited to: determining a first aspect ratio corresponding to the plurality of elements to be detected according to the average width and the average height; determining a splitting direction according to the first aspect ratio and a second aspect ratio corresponding to the fixed area; and splitting the fixed region into a plurality of grid regions according to the first aspect ratio, the second aspect ratio and the splitting direction.
Specifically, according to the shape characteristics of the element to be detected, the average width and the average width of the element to be detected are obtained, the first aspect ratio of the element to be detected is further obtained, and meanwhile, the second aspect ratio of the fixed area where the element to be detected is located is determined. Determining the splitting direction through the shape characteristics of the elements to be detected and the shape characteristics of the fixed region, namely comparing the first aspect ratio with the second aspect ratio to determine the splitting direction. The fixed region is then sliced into a plurality of grid regions based on the first aspect ratio, the second aspect ratio, and the slicing direction.
As a preferred technical solution, in this embodiment, the current region to be cut includes a fixed region, wherein the cutting direction is determined according to the first aspect ratio and a second aspect ratio corresponding to the fixed region, including but not limited to: if the third aspect ratio of the current area to be cut is larger than the first aspect ratio, determining the cutting direction as vertical cutting; and if the third aspect ratio is smaller than the first aspect ratio, determining the splitting direction as transverse splitting.
Specifically, since the shape feature of the element to be detected is a rectangle, the splitting orientation is determined to be vertical and horizontal. And acquiring a first width-height ratio of the element to be detected and a third width-height ratio of the current area to be cut, if the first width-height ratio is smaller than the third width-height ratio, indicating that the current area to be cut is flatter relative to the element to be detected, and performing vertical cutting. And if the first aspect ratio is larger than the third aspect ratio, the fixed area is narrower relative to the element to be detected, and then transverse segmentation is carried out.
In an example, referring to fig. 4, a schematic diagram of element distribution in a knowledge graph is shown, where the element to be detected is a character element composed of characters, a first aspect ratio of the character element and a second aspect ratio of a canvas 40 in a fixed region in the knowledge graph are obtained, where the first aspect ratio is smaller than the second aspect ratio, and the canvas is vertically split to obtain a grid region 42 and a grid region 44. Grid region 42 and grid region 44 have a third aspect ratio that is less than the first aspect ratio, and grid region 42 and grid region 44 are transversely split to obtain four grid regions split from the canvas.
In the above embodiment, the fast segmentation of the current region to be cut is realized by determining the segmentation direction based on the third aspect ratio of the current region to be cut and the first aspect ratio of the element to be detected, so as to obtain a plurality of grid regions.
As a preferred technical solution, in the present embodiment, the fixed region is divided into a plurality of grid regions according to the first aspect ratio, the second aspect ratio and the dividing direction, which includes but is not limited to: detecting whether the elements to be detected exist in the current grid area; under the condition that the elements to be detected exist in the current grid area, segmenting the current grid area according to the fourth aspect ratio, the first aspect ratio and the segmenting direction of the current grid area to obtain a plurality of next-level grid areas; and stopping segmenting the current grid region under the condition that the elements to be detected do not exist in the current grid region.
In a specific application scenario, in the process of grid segmentation, a plurality of grid regions are obtained by performing stepwise region segmentation starting from a fixed region based on a first aspect ratio, a second aspect ratio and a segmentation direction, in the process of region segmentation, the fixed region is segmented to a secondary grid region, the secondary grid region is segmented to a next-stage grid region, and the next-stage grid region is segmented to a final grid region. In this embodiment, whether an element to be detected exists in the current grid region is detected, and under the condition that the element to be detected exists, the current grid region is segmented according to the fourth aspect ratio of the current grid region, the first aspect ratio of the element to be detected, and the segmentation direction, so as to obtain a next-stage grid region. And stopping the segmentation of the grid region if the element to be detected does not exist in the current grid region.
Specifically, still taking the example of fig. 4 as an example for illustration, the grid region 42 and the grid region 44 are divided to obtain the grid region 420, the grid region 422, the grid region 440, and the grid region 442 which are divided by the canvas 40 and are shown in fig. 4 a. If there are character elements in the grid region 422, the grid region 440, and the grid region 442, the splitting direction may be determined based on the average aspect ratio of the grid region 422, the grid region 440, and the grid region 442 and the second aspect ratio of the canvas, further splitting may be performed based on the average aspect ratio, the second aspect ratio, and the splitting direction, and if there are no character elements in 420, that is, there are no elements to be detected, splitting of the grid region 420 may be stopped.
As a preferable technical solution, in this embodiment, after segmenting the current grid region according to the fourth aspect ratio, the first aspect ratio and the segmenting direction of the current grid region, the method further includes, but is not limited to: and stopping segmenting the current grid region under the condition that the width and the average width of the current grid region accord with a first preset relation and the height and the average height of the current grid region accord with a second preset relation.
Specifically, in this embodiment, in the process of segmenting the fixed region or the current grid region, it is determined whether the width of the current grid is less than 4 times the average width of the element to be detected, and whether the height of the current grid is less than 4 times the average height of the element to be detected. And if the width of the current grid is less than 4 times of the average width of the elements to be detected and the height of the current grid is less than 4 times of the average height of the elements to be detected, the grid region is considered to be completely segmented, and the segmentation of the current grid region is stopped.
S206, carrying out occlusion detection on each element to be detected in the grid area.
As a preferred technical solution, in this embodiment, the performing occlusion detection on each element to be detected in the grid region includes: determining a target grid area where a target element to be detected is located; and sequentially carrying out shielding detection on the elements to be detected of the target and each element to be detected in the target grid region.
Specifically, after the fixed region is divided into a plurality of grid regions, the grid region 01 where the element a to be detected, which needs to be subjected to occlusion detection, is located is determined, and then the element a to be detected is calculated to be compared with other elements in the grid region 01.
By the embodiment, the shape characteristics of the elements to be detected in the fixed area are determined; dividing the fixed area into a plurality of grid areas according to the shape characteristics; the method has the advantages that the shielding detection is carried out on each element to be detected in the grid region, the purpose of rapidly calculating the shielding detection of region segmentation is achieved, the technical effect of reducing the shielding detection calculated amount is achieved, and the technical problem that the time complexity of the calculation process is high due to the fact that the shielding detection needs to be carried out on all elements in the element shielding detection in the related technology is solved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to an embodiment of the present invention, there is also provided an occlusion detection apparatus based on region segmentation, for implementing the occlusion detection method based on region segmentation, as shown in fig. 5, the apparatus includes:
1) a determining unit 50 for determining shape characteristics of a plurality of elements to be detected in the fixed region;
2) a processing unit 52, configured to divide the fixed region into a plurality of grid regions according to the shape features;
3) a detecting unit 54, configured to perform occlusion detection on each element to be detected in the grid region.
Optionally, the specific example in this embodiment may refer to the example described in embodiment 1 above, and this embodiment is not described again here.
Example 3
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention.
Referring to fig. 6, the electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 6 does not constitute a limitation of the electronic device, and that the electronic device may include more or fewer components than shown, or some components may be combined, or a different arrangement of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 601 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 610; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 601 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. Further, the radio frequency unit 601 may also communicate with a network and other devices through a wireless communication system.
The electronic device provides wireless broadband internet access to the user via the network module 602, such as assisting the user in sending and receiving e-mails, browsing web pages, and accessing streaming media.
The audio output unit 603 may convert audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output as sound. Also, the audio output unit 603 may also provide audio output related to a specific function performed by the electronic apparatus 600 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, a receiver, and the like.
The input unit 604 is used to receive audio or video signals. The input Unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042, and the Graphics processor 6041 processes image data of a still picture or video obtained by an image capturing apparatus (such as a camera) in a video capture mode or an image capture mode. The processed image frames may be displayed on the display unit 606. The image frames processed by the graphic processor 6041 may be stored in the memory 609 (or other storage medium) or transmitted via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sound, and can process such sound into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 601 in case of the phone call mode.
The electronic device 600 also includes at least one sensor 605, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 6061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 6061 and/or the backlight when the electronic apparatus 600 is moved to the ear. As one type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of an electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), and vibration identification related functions (such as pedometer, tapping); the sensors 605 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 606 is used to display information input by the user or information provided to the user. The Display unit 606 may include a Display panel 6061, and the Display panel 6061 may be configured by a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 607 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. Touch panel 6071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 6071 using a finger, stylus, or any suitable object or accessory). The touch panel 6071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 610, receives a command from the processor 610, and executes the command. In addition, the touch panel 6071 can be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The user input unit 607 may include other input devices 6072 in addition to the touch panel 6071. Specifically, the other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a track ball, a mouse, and a joystick, which are not described herein again.
Further, the touch panel 6071 can be overlaid on the display panel 6061, and when the touch panel 6071 detects a touch operation on or near the touch panel 6071, the touch operation is transmitted to the processor 610 to determine the type of the touch event, and then the processor 610 provides a corresponding visual output on the display panel 6061 according to the type of the touch event. Although the touch panel 6071 and the display panel 6061 are shown in fig. 6 as two separate components to implement the input and output functions of the electronic device, in some embodiments, the touch panel 6071 and the display panel 6061 may be integrated to implement the input and output functions of the electronic device, and this is not limited here.
The interface unit 608 is an interface for connecting an external device to the electronic apparatus 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 608 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 600 or may be used to transmit data between the electronic device 600 and external devices.
The memory 609 may be used to store software programs as well as various data. The memory 609 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 609 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 610 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 609, and calling data stored in the memory 609, thereby performing overall monitoring of the electronic device. Processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 610.
The electronic device 600 may further include a power supply 611 (e.g., a battery) for supplying power to the various components, and preferably, the power supply 611 may be logically connected to the processor 610 via a power management system, such that the power management system may be used to manage charging, discharging, and power consumption.
In addition, the electronic device 600 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides an electronic device, including: the processor 610, the memory 609, and a computer program stored in the memory 609 and capable of running on the processor 610, where the computer program, when executed by the processor 610, implements each process of the foregoing occlusion detection method embodiment based on region segmentation, and can achieve the same technical effect, and are not described herein again to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the foregoing occlusion detection method embodiment based on region segmentation, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for occlusion detection based on region segmentation, comprising:
determining shape characteristics of a plurality of elements to be detected in a fixed area;
segmenting the fixed region into a plurality of grid regions according to the shape features;
and carrying out shielding detection on each element to be detected in the grid area.
2. The method according to claim 1, characterized in that the elements to be detected are rectangular and the shape features comprise an average width and an average height of the elements to be detected, wherein,
segmenting the fixed region into a plurality of grid regions according to the shape features, including:
determining a first aspect ratio corresponding to the plurality of elements to be detected according to the average width and the average height;
determining a cutting direction according to the first aspect ratio and a second aspect ratio corresponding to the fixed area;
and segmenting the fixed region into the plurality of grid regions according to the first aspect ratio, the second aspect ratio and the segmenting direction.
3. The method according to claim 2, characterized in that the area currently to be cut comprises the fixed area, wherein,
determining a cutting direction according to the first aspect ratio and a second aspect ratio corresponding to the fixed region, including:
if the third aspect ratio of the current area to be cut is larger than the first aspect ratio, determining that the cutting direction is vertical cutting;
and if the third aspect ratio is smaller than the first aspect ratio, determining that the splitting direction is transverse splitting.
4. The method of claim 2 or 3, wherein segmenting the fixed region into the plurality of grid regions according to the first aspect ratio, the second aspect ratio, and the segmentation direction comprises:
detecting whether the elements to be detected exist in the current grid area;
under the condition that the elements to be detected exist in the current grid region, segmenting the current grid region according to a fourth aspect ratio, the first aspect ratio and the segmenting direction of the current grid region to obtain a plurality of next-level grid regions;
and stopping segmenting the current grid region under the condition that the element to be detected does not exist in the current grid region.
5. The method of claim 4, wherein after segmenting the current grid region according to the fourth aspect ratio, the first aspect ratio and the segmentation direction of the current grid region, further comprising:
and stopping segmenting the current grid region under the condition that the width of the current grid region and the average width accord with a first preset relation and the height of the current grid region and the average height accord with a second preset relation.
6. The method according to claim 1, wherein the occlusion detection of each element to be detected in the grid area comprises:
determining a target grid area where a target element to be detected is located;
and sequentially carrying out shielding detection on the target elements to be detected and each element to be detected in the target grid region.
7. The method of claim 1, wherein determining shape characteristics of a plurality of elements to be detected in a fixed region comprises:
converting the shapes of the elements to be detected into a plurality of target elements, wherein the target elements are rectangular elements to be detected;
an average width and an average height of the plurality of target elements are determined.
8. An apparatus for occlusion detection based on region segmentation, comprising:
the determining unit is used for determining the shape characteristics of a plurality of elements to be detected in the fixed area;
the processing unit is used for segmenting the fixed region into a plurality of grid regions according to the shape characteristics;
and the detection unit is used for carrying out shielding detection on each element to be detected in the grid area.
9. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the method for occlusion detection based on region segmentation according to claims 1-7.
10. A readable storage medium, on which a program or instructions are stored, which, when executed by a processor, carry out the steps of the method for occlusion detection based on region segmentation as claimed in claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011134093.9A CN112215242A (en) | 2020-10-21 | 2020-10-21 | Occlusion detection method and device based on region segmentation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011134093.9A CN112215242A (en) | 2020-10-21 | 2020-10-21 | Occlusion detection method and device based on region segmentation |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112215242A true CN112215242A (en) | 2021-01-12 |
Family
ID=74056375
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011134093.9A Pending CN112215242A (en) | 2020-10-21 | 2020-10-21 | Occlusion detection method and device based on region segmentation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112215242A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110052076A1 (en) * | 2009-09-02 | 2011-03-03 | Canon Kabushiki Kaisha | Image processing apparatus and subject discrimination method |
US20200034657A1 (en) * | 2017-07-27 | 2020-01-30 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for occlusion detection on target object, electronic device, and storage medium |
-
2020
- 2020-10-21 CN CN202011134093.9A patent/CN112215242A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110052076A1 (en) * | 2009-09-02 | 2011-03-03 | Canon Kabushiki Kaisha | Image processing apparatus and subject discrimination method |
US20200034657A1 (en) * | 2017-07-27 | 2020-01-30 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for occlusion detection on target object, electronic device, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108182043B (en) | Information display method and mobile terminal | |
CN108089767B (en) | Fingerprint identification area dividing method and mobile terminal | |
CN110096326B (en) | Screen capturing method, terminal equipment and computer readable storage medium | |
CN107977652B (en) | Method for extracting screen display content and mobile terminal | |
CN105989572B (en) | Picture processing method and device | |
CN109739429B (en) | Screen switching processing method and mobile terminal equipment | |
CN110399000B (en) | Mobile terminal and temperature control method thereof | |
EP4131067A1 (en) | Detection result output method, electronic device, and medium | |
CN109145731B (en) | Fingerprint identification method and device and mobile terminal | |
CN110990172A (en) | Application sharing method, first electronic device and computer-readable storage medium | |
CN107608606A (en) | A kind of image display method, mobile terminal and computer-readable recording medium | |
CN109542321B (en) | Control method and device for screen display content | |
CN108196781B (en) | Interface display method and mobile terminal | |
CN110309003B (en) | Information prompting method and mobile terminal | |
CN110022551B (en) | Information interaction method and terminal equipment | |
CN109782970B (en) | Display method and terminal | |
CN110764650A (en) | Key trigger detection method and electronic equipment | |
CN109343811B (en) | Display adjustment method and terminal equipment | |
CN111240451A (en) | Heat dissipation method, electronic device and computer-readable storage medium | |
CN110851219A (en) | Information processing method and electronic equipment | |
CN108063869B (en) | Safety early warning method and mobile terminal | |
CN108419283B (en) | WIFI hotspot scanning method and mobile terminal | |
CN109327605B (en) | Display control method and device and mobile terminal | |
CN109446033B (en) | Method and device for displaying downloading progress | |
CN109240531B (en) | Touch data sampling compensation method and device, mobile terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |