CN114581672B - Image recognition method and device and electronic equipment - Google Patents
Image recognition method and device and electronic equipment Download PDFInfo
- Publication number
- CN114581672B CN114581672B CN202210231187.0A CN202210231187A CN114581672B CN 114581672 B CN114581672 B CN 114581672B CN 202210231187 A CN202210231187 A CN 202210231187A CN 114581672 B CN114581672 B CN 114581672B
- Authority
- CN
- China
- Prior art keywords
- target
- target image
- image
- line
- segmentation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000011218 segmentation Effects 0.000 claims description 62
- 238000010586 diagram Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 10
- 238000003708 edge detection Methods 0.000 claims description 10
- 238000012545 processing Methods 0.000 abstract description 8
- 230000008859 change Effects 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 5
- 238000001514 detection method Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000003709 image segmentation Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
The disclosure provides an image recognition method, an image recognition device and electronic equipment, relates to the technical field of computer vision, and particularly relates to the technical field of image processing. The specific implementation scheme is as follows: acquiring a target image and energy values of a plurality of pixel points in the target image; determining a target cutting line in the target image, wherein the energy value of a pixel point where the target cutting line is located is smaller than a first threshold value; cutting the target image by using the target cutting line to obtain a plurality of cut images; and respectively identifying the plurality of segmented images to obtain an identification result of the target image. The method and the device can improve the accuracy of image recognition.
Description
Technical Field
The disclosure relates to the technical field of computer vision, in particular to the technical field of image processing, and specifically relates to an image recognition method, an image recognition device and electronic equipment.
Background
With the development and progress of science and technology, when the image content is identified, a computer vision model can be adopted to identify the image. When an image with a larger size needs to be identified, a large image is usually scaled to a small size and then input into an identification model for identification.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, and storage medium for image recognition.
According to a first aspect of the present disclosure, there is provided an image recognition method including:
acquiring a target image and energy values of a plurality of pixel points in the target image;
Determining a target cutting line in the target image, wherein the energy value of a pixel point where the target cutting line is located is smaller than a first threshold value;
cutting the target image by using the target cutting line to obtain a plurality of cut images;
And respectively identifying the plurality of segmented images to obtain an identification result of the target image.
According to a second aspect of the present disclosure, there is provided an image recognition apparatus including:
The acquisition module is used for acquiring a target image and energy values of a plurality of pixel points in the target image;
The determining module is used for determining a target cutting line in the target image, and the energy value of a pixel point where the target cutting line is located is smaller than a first threshold value;
The segmentation module is used for segmenting the target image by using the target segmentation line so as to obtain a plurality of segmented images;
and the identification module is used for respectively identifying the plurality of segmented images so as to obtain an identification result of the target image.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the methods of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform any of the methods of the first aspect.
In the embodiment of the disclosure, the target image is segmented by using the target segmentation line in the target image, and the energy value of the pixel point where the target segmentation line is located is smaller than the first threshold value, so that a plurality of segmented images obtained by segmentation are identified, and the accuracy of image identification can be improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flow chart of an image recognition method according to a first embodiment of the present disclosure;
FIG. 2 is one of the schematic diagrams of image segmentation according to a first embodiment of the present disclosure;
FIG. 3 is a second schematic view of image segmentation according to a first embodiment of the present disclosure;
FIG. 4 is a flow diagram of risk identification according to a second embodiment of the present disclosure;
Fig. 5 is a schematic structural view of an image recognition apparatus according to a third embodiment of the present disclosure;
fig. 6 is a block diagram of an electronic device for implementing an image recognition method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, the present disclosure provides an image recognition method, including the steps of:
step S101: and acquiring a target image and energy values of a plurality of pixel points in the target image.
In this embodiment, the image recognition method may be applied to a risk content auditing scenario. For example: when it is required to check whether the risk content exists in the image, a larger-size image may exist for identification, or the risk content part exists in the image and only occupies a smaller part, and the target image is the image to be identified.
The energy value of each pixel point can represent the degree of change between each pixel point and surrounding pixel points, and if the pixel value difference between a certain pixel point and the surrounding pixel points is smaller, the change between the pixel point and the surrounding pixel points is smaller, and the position of the pixel point has no important content; if the difference between the pixel value of a certain pixel point and the pixel points around is large, it can be understood that the change between the pixel point and the pixel points around is large, and the position of the pixel point has important content.
Step S102: and determining a target cutting line in the target image, wherein the energy value of a pixel point where the target cutting line is positioned is smaller than a first threshold value.
The first threshold may be preset, for example: the first threshold may be adjusted in size according to the accuracy of the image segmentation or set directly according to an empirical value. By determining the target segmentation lines with the energy values of the pixel points smaller than the first threshold, it is ensured that important content does not exist on the target segmentation lines, and the target segmentation lines can be used as the segmentation lines of the image.
Step S103: and segmenting the target image by using the target segmentation line to obtain a plurality of segmented images.
It is understood that the target dividing line may be one or more, if there is only one target dividing line in the target image, the target image is divided into two divided images; if a plurality of target cutting lines exist in the target image, a plurality of cutting images can be obtained after the target image is cut. When the target image is segmented by using the plurality of segmentation lines, the target image may be segmented multiple times in the order of the target segmentation lines, or the target image may be segmented by using the plurality of segmentation lines at the same time, so as to obtain a plurality of segmented images, and the specific segmentation mode is not limited in the disclosure.
Step S104: and respectively identifying the plurality of segmented images to obtain an identification result of the target image.
After the target image is segmented into a plurality of segmented images, the images can be identified one by one, and the segmented images can be respectively sent into a plurality of image identification models for identification according to identification types. For example: in order to confirm whether a certain identification target exists in the target image, the plurality of segmented images can be identified one by one, and if one segmented image exists in the identification target, the target image can be considered to exist in the identification target; or the areas of the plurality of segmented images may be determined in advance, a partial segmented image corresponding to the area where the recognition target may exist may be selected, and the recognition target may be recognized only for the partial segmented image.
In the embodiment of the disclosure, a target cutting line with the energy value of the pixel point in the target image smaller than a first threshold value is determined based on the energy values of a plurality of pixel points in the target image, the target image is cut by using the target cutting line, the plurality of cut images are identified, and an identification result of the target image is obtained. In this way, the target image can be segmented into a plurality of smaller-sized images, and the target segmentation line based on the pixel point with the energy value smaller than the first threshold value can avoid the segmentation of the content to be identified into two segmented images, so that the segmentation of the target image is realized, and the accuracy of the identification result after the segmentation of the target image is improved.
In addition, the target image is segmented into a plurality of segmented images, and the segmented images are respectively identified, so that the proportion of the target to be identified in the image to be identified can be increased, and the accuracy rate and recall rate of image identification are improved.
Optionally, the target split line includes a first direction split line and a second direction split line;
The segmenting the target image by using the target segmentation line in the step 103 to obtain a plurality of segmented images may specifically include:
And respectively segmenting the target image by using the segmentation line in the first direction and the segmentation line in the second direction to obtain a plurality of segmented images.
The first direction and the second direction may be understood as a lateral direction and a longitudinal direction of the image, respectively, so that the size of the obtained cut image is rectangular when the target image is cut. The length of the dividing line in the transverse direction of the target image may be equal to or smaller than the transverse dimension of the target image, and the length of the dividing line in the longitudinal direction of the target image may be equal to or smaller than the longitudinal dimension of the target image.
It is understood that the tangential lines in the first direction and the tangential lines in the second direction may be any number, and the specific number needs to be determined based on different images. In the process of dividing the target image by using the dividing line in the first direction and the dividing line in the second direction, dividing may be switched between dividing by using the dividing line in the first direction and dividing by using the dividing line in the second direction, for example: as shown in fig. 2, the image 1 represents the target image, the first-direction dividing lines 1 and 2 represent the first-direction dividing lines, the dividing lines 3,4 and 5 represent the second-direction dividing lines, the first-time dividing may divide the image 1 by using the dividing lines 1 and 2 in the first direction, the length of the dividing line 2 may not divide the image 1, so that the image 1 may actually be divided by using the dividing line 1 this time, the second-time dividing may divide by using the dividing lines 3,4 and 5 in the second direction, the same may actually be divided by using the dividing lines 3 and 5 this time, the third-time dividing may divide the image 1 by using the dividing line 2 which is not used in the first direction again, the fourth-time dividing may divide the image 1 by using the dividing line 4 which is not used in the second direction, and the fourth-time dividing may obtain 10 divided images by the fourth-time dividing. In addition, the above-mentioned segmentation can use the segmentation line of the first direction to carry on the segmentation first, can also use the segmentation line of the second direction to carry on the segmentation first.
In this embodiment, the target image is segmented by using the segmentation line in the first direction and the segmentation line in the second direction, respectively, so that a plurality of segmented images can be obtained quickly.
Optionally, the determining the target cutting line in the target image in step 102 may specifically include the following steps:
Acquiring a plurality of cutting lines of the target image and a plurality of areas formed by the cutting lines, wherein the energy values of pixel points where the cutting lines are positioned are smaller than the first threshold value;
determining the target cut line based on the plurality of cut lines and the plurality of regions;
Wherein the target cut line comprises at least one of:
A first parting line of the plurality of parting lines that is entirely located at an edge line of one region;
And a second parting line of the plurality of parting lines is partially parted, and only the second parting line is partially parted to an edge line of one area.
Taking fig. 3 as an example, the image 2 represents the target image, and a plurality of broken lines in fig. 3 represent a plurality of cut lines, and the image 2 may be divided into a region a, a region B, a region C, a region D, a region E, a region F, and a region G based on the plurality of cut lines. It will be appreciated that the energy values of the pixel points where the plurality of slicing lines in fig. 3 are located are smaller than the first threshold, but not every slicing line may be used to slice an image, for example: for the cut line in fig. 3 that passes through the region D and the region G and is partially cut while being located on the edge lines of the region E and the region F, only the partial cut of the edge lines located on the region E and the region F can be taken as the target cut line of the image 2; similarly, a cut line that passes through the region C and partially cuts the edge line of the region E, and partially cuts the edge line of the region F, and only the partial cut of the edge line of the region E and the partial cut of the edge line of the region F can be used as the target cut line of the image 2.
In this embodiment, the target dividing lines are determined based on the plurality of dividing lines and the plurality of regions, so that the target dividing line among the plurality of dividing lines can be quickly determined, and the target image can be divided.
Optionally, determining the target cut line in the target image in step 102 may specifically include:
acquiring a plurality of adjacent lines of which the energy values of pixel points in the target image are smaller than the first threshold value;
and determining a line positioned at the edge of the plurality of adjacent lines as the target cutting line.
In the determining of the target tangent line, if the energy values of the pixel points where a plurality of adjacent lines are located are all smaller than the first threshold, only the line located at the edge may be taken as the target tangent line, specifically, when it is detected that the energy values of the pixel points where a plurality of continuous lines are located are all smaller than the first threshold, two lines located at the edge may be identified, and if one line located at the edge may be simultaneously the line located at the edge of the target image, only the line not located at the edge of the image may be taken as the target tangent line.
In this embodiment, by acquiring a plurality of adjacent lines in which the energy value of the pixel point is smaller than the first threshold value in the target image, and determining the line at the edge of the plurality of adjacent lines as the target cutting line, it is possible to reduce excessive cutting of the target image when a plurality of adjacent cutting lines exist, and to increase the cutting speed.
Optionally, energy values of a plurality of pixel points in the target image are obtained based on an energy map of the target image;
The energy map of the target image comprises any one of the following:
Performing edge detection on the target image to obtain an energy diagram;
an energy map obtained by detecting the saliency area of the target image;
And carrying out texture recognition on the target image to obtain an energy diagram.
It can be understood that the energy value is a value of a pixel in the energy map, and by acquiring values of a plurality of pixels in the energy map, it can be determined whether the positions of the plurality of pixels have important content and can be used as the positions of the slicing lines.
In the energy map obtained by the edge detection, that is, a result obtained by identifying the target image by the edge detection algorithm, in the edge detection process, for a region with a large change in pixel value, the region may be considered to have a large number of edges, for example: edge detection of the target image can be achieved by using a Sobel operator (Sobel operator) and a Canny operator (Canny operator).
The salient region may be understood as a region where the pixel point changes greatly, and the result obtained by detecting the salient region of the target image may be used as an energy map of the target image, for example: detection algorithms such as HC (Histogram-based Contrast) algorithm, RC (Region-based Contrast) algorithm, and the like realize salient Region detection of the image. Similarly, the texture recognition result of the target image may reflect the degree of change of the pixel point in the target image, and thus the present disclosure may also use the texture recognition result as an energy map of the target image.
In this embodiment, the energy map of the target image may be obtained by performing edge detection, saliency region detection, or texture recognition on the target image, that is, the obtained energy map may reflect the degree of change in the pixel value of the pixel point in the target image.
Optionally, in step S104, the identifying the plurality of segmented images to obtain the identification result of the target image may specifically include:
Acquiring target segmentation images in the plurality of segmentation images;
inputting the target segmentation image into an image recognition model for recognition to obtain a recognition result of the target image;
And the sum of the energy values of the pixel points in the target segmentation image is smaller than a second threshold value.
It can be understood that the energy value of the pixel point can be used to determine whether the pixel point has important content, and for a certain area, whether the important content exists or not can be determined by the sum of the energy values of all the pixel points in the area, if the sum of the energy values of the pixel points in the area is smaller, it can be considered that the important content does not exist in the area.
Before the target segmentation image is input into the image recognition model, the target segmentation image may be scaled according to the size of the target segmentation image so that the size of the target segmentation image conforms to the image recognition model.
In this embodiment, the target segmented image with the sum of the energy values of the pixel points smaller than the second threshold is identified, and the obtained identification result is used as the identification result of the target image, so that the image with the identifiable content part can be extracted for identification, the data amount of image identification is reduced, and the identification efficiency of the target image is improved.
As shown in fig. 4, the present disclosure provides a flowchart for risk identification based on picture segmentation, including the following procedures:
the picture input unit is used for acquiring a large picture to be audited from a local image library or a network environment;
the energy map generating unit is used for generating an energy map of the large map, and judging the complexity degree of the regional content in the map;
the picture segmentation unit is used for segmenting the large picture according to the result of the energy picture;
and the risk judging unit is used for carrying out risk identification on the cut pictures.
The energy diagram generating unit and the picture segmentation unit can be realized through a picture segmentation model. In the energy map generating unit, the generated energy map may represent the degree of change of the pixel value of each pixel point and the surrounding pixel points in the image, that is, the higher the value in the energy map, the larger the change of the pixel value around the pixel point in the image, otherwise, the smaller the change of the pixel value around the pixel point in the image. Specifically, the generation of the energy map may be implemented using an image edge detection operator or an image saliency region extraction algorithm.
If the values of all the pixels on a certain line in the energy map are smaller in the energy map, the pixel values on the certain line in the picture can be considered to be basically unchanged, i.e. no key content exists on the certain line, and the method can be used for cutting the map. The line may be a line extending through the entire picture or a line segment extending through only a part of the picture.
In this embodiment, in the process of splitting the picture, the selection may be firstly performed according to a horizontal line, that is, if the values of the pixels of a horizontal line in the energy map are all smaller than a threshold value, the horizontal line may be first split, and then the sum of the values of all the pixels of each region obtained by the splitting in the energy map is calculated, and if the sum is smaller than another threshold value, the sum is discarded; for the cut horizontal line, a column with a pixel point value smaller than a threshold value of a column in the energy diagram can be selected for longitudinal cutting. Likewise, if the sum of the values of all the pixel points in the energy map in the cut area is smaller than another threshold value, discarding the sum; and the content of the cut picture is reserved to the greatest extent, and the size of the cut picture can be sent to an image recognition model after being scaled. For example: in the current auditing flow, different risk identification models are provided for different risks, so that pictures obtained by cutting can be sequentially sent into the risk identification models, and the risk condition judgment of the whole picture is realized.
In the embodiment of the disclosure, aiming at the problem of difficult recognition of the large long-graph, the images are segmented based on the energy graph, the segmented images are respectively recognized, the size of the images is reduced, and meanwhile, the complete content is prevented from being segmented into different images, so that the accuracy and recall rate of an image recognition method can be improved, and the risk of the large long-graph in the risk content is reduced.
As shown in fig. 5, the present disclosure further provides an image recognition apparatus, including:
an obtaining module 501, configured to obtain a target image, and energy values of a plurality of pixels in the target image;
A determining module 502, configured to determine a target cutting line in the target image, where an energy value of a pixel point where the target cutting line is located is smaller than a first threshold;
A segmentation module 503, configured to segment the target image using the target segmentation line to obtain a plurality of segmented images;
And the recognition module 504 is configured to recognize the plurality of segmented images respectively, so as to obtain a recognition result of the target image.
Optionally, the target split line includes a first direction split line and a second direction split line;
the splitting module 503 may specifically include:
And the segmentation unit is used for respectively segmenting the target image by using the segmentation line in the first direction and the segmentation line in the second direction so as to obtain a plurality of segmented images.
Optionally, the determining module 502 may specifically include:
The first acquisition unit is used for acquiring a plurality of cutting lines of the target image and a plurality of areas formed by the cutting lines, and the energy values of pixel points where the cutting lines are positioned are smaller than the first threshold value;
a first determining unit configured to determine the target cut line based on the plurality of cut lines and the plurality of areas;
Wherein the target cut line comprises at least one of:
A first parting line of the plurality of parting lines that is entirely located at an edge line of one region;
And a second dividing line of the plurality of dividing lines is used for dividing the first dividing line into a plurality of partial dividing lines, wherein the second dividing line is used for dividing the first dividing line into a plurality of partial dividing lines.
Optionally, the determining module 502 may specifically include:
A second obtaining unit, configured to obtain a plurality of adjacent lines where energy values of pixel points in the target image are smaller than the first threshold;
And a second determining unit configured to determine a line located at an edge of the plurality of adjacent lines as the target cut line.
Optionally, the identifying module 504 may specifically include:
a third acquisition unit configured to acquire a target cut image from among the plurality of cut images;
the recognition unit is used for inputting the target segmentation image into the image recognition model for recognition so as to obtain a recognition result of the target image;
And the sum of the energy values of the pixel points in the target segmentation image is smaller than a second threshold value.
Optionally, the energy value of each pixel point in the target image is obtained based on the energy map of the target image;
The energy map of the target image comprises any one of the following:
Performing edge detection on the target image to obtain an energy diagram;
performing salient region identification on the target image to obtain an energy map;
And carrying out texture recognition on the target image to obtain an energy diagram.
The image recognition device 500 provided in the present disclosure can implement each process of the image recognition method embodiment, and can achieve the same technical effects, and for avoiding repetition, a detailed description is omitted herein.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM 602, and RAM 603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the respective methods and processes described above, such as an image recognition method. For example, in some embodiments, the image recognition method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the image recognition method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the image recognition method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (13)
1. An image recognition method, comprising:
acquiring a target image and energy values of a plurality of pixel points in the target image;
Determining a target cutting line in the target image, wherein the energy value of a pixel point where the target cutting line is located is smaller than a first threshold value;
cutting the target image by using the target cutting line to obtain a plurality of cut images;
respectively identifying the plurality of segmented images to obtain an identification result of the target image;
Wherein the determining a target cut line in the target image includes:
Acquiring a plurality of cutting lines of the target image and a plurality of areas formed by the cutting lines, wherein the energy values of pixel points where the cutting lines are positioned are smaller than the first threshold value;
determining the target cut line based on the plurality of cut lines and the plurality of regions;
wherein the target split line includes a partial split in a second split line of the plurality of split lines, the second split line having only the partial split located at an edge line of an area.
2. The method of claim 1, wherein the target cut line comprises a first direction cut line and a second direction cut line;
the target image is segmented by using the target segmentation line to obtain a plurality of segmented images, which comprises the following steps:
And respectively segmenting the target image by using the segmentation line in the first direction and the segmentation line in the second direction to obtain a plurality of segmented images.
3. The method of claim 1, wherein the determining a target cut line in the target image comprises:
acquiring a plurality of adjacent lines of which the energy values of pixel points in the target image are smaller than the first threshold value;
and determining a line positioned at the edge of the plurality of adjacent lines as the target cutting line.
4. The method according to claim 1, wherein the identifying the plurality of segmented images to obtain the identification result of the target image includes:
acquiring a target segmentation image in a plurality of segmentation images;
inputting the target segmentation image into an image recognition model for recognition to obtain a recognition result of the target image;
And the sum of the energy values of the pixel points in the target segmentation image is smaller than a second threshold value.
5. The method of any one of claims 1 to 4, wherein the energy value of each pixel in the target image is derived based on an energy map of the target image;
The energy map of the target image comprises any one of the following:
Performing edge detection on the target image to obtain an energy diagram;
performing salient region identification on the target image to obtain an energy map;
And carrying out texture recognition on the target image to obtain an energy diagram.
6. An image recognition apparatus comprising:
The acquisition module is used for acquiring a target image and energy values of a plurality of pixel points in the target image;
The determining module is used for determining a target cutting line in the target image, and the energy value of a pixel point where the target cutting line is located is smaller than a first threshold value;
The segmentation module is used for segmenting the target image by using the target segmentation line so as to obtain a plurality of segmented images;
the identification module is used for respectively identifying the plurality of segmented images to obtain an identification result of the target image;
wherein, the determining module includes:
The first acquisition unit is used for acquiring a plurality of cutting lines of the target image and a plurality of areas formed by the cutting lines, and the energy values of pixel points where the cutting lines are positioned are smaller than the first threshold value;
a first determining unit configured to determine the target cut line based on the plurality of cut lines and the plurality of areas;
wherein the target split line includes a partial split in a second split line of the plurality of split lines, the second split line having only the partial split located at an edge line of an area.
7. The apparatus of claim 6, wherein the target cut line comprises a first direction cut line and a second direction cut line;
The segmentation module comprises:
And the segmentation unit is used for respectively segmenting the target image by using the segmentation line in the first direction and the segmentation line in the second direction so as to obtain a plurality of segmented images.
8. The apparatus of claim 6, wherein the means for determining comprises:
A second obtaining unit, configured to obtain a plurality of adjacent lines where energy values of pixel points in the target image are smaller than the first threshold;
And a second determining unit configured to determine a line located at an edge of the plurality of adjacent lines as the target cut line.
9. The apparatus of claim 6, wherein the identification module comprises:
a third acquisition unit configured to acquire a target cut image from among the plurality of cut images;
the identification unit is used for inputting the target segmentation image into an image identification model for identification so as to obtain an identification result of the target image;
And the sum of the energy values of the pixel points in the target segmentation image is smaller than a second threshold value.
10. The apparatus of any one of claims 6 to 9, wherein the energy value of each pixel in the target image is derived based on an energy map of the target image;
The energy map of the target image comprises any one of the following:
Performing edge detection on the target image to obtain an energy diagram;
performing salient region identification on the target image to obtain an energy map;
And carrying out texture recognition on the target image to obtain an energy diagram.
11. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210231187.0A CN114581672B (en) | 2022-03-10 | 2022-03-10 | Image recognition method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210231187.0A CN114581672B (en) | 2022-03-10 | 2022-03-10 | Image recognition method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114581672A CN114581672A (en) | 2022-06-03 |
CN114581672B true CN114581672B (en) | 2024-08-16 |
Family
ID=81773239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210231187.0A Active CN114581672B (en) | 2022-03-10 | 2022-03-10 | Image recognition method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114581672B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113724137A (en) * | 2021-09-08 | 2021-11-30 | 深圳壹账通智能科技有限公司 | Image recognition method, device and equipment based on image segmentation and storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060029275A1 (en) * | 2004-08-06 | 2006-02-09 | Microsoft Corporation | Systems and methods for image data separation |
US9311716B2 (en) * | 2014-05-14 | 2016-04-12 | International Business Machines Corporation | Static image segmentation |
US9684967B2 (en) * | 2015-10-23 | 2017-06-20 | International Business Machines Corporation | Imaging segmentation using multi-scale machine learning approach |
CN111553339B (en) * | 2019-02-11 | 2025-05-23 | 北京京东尚科信息技术有限公司 | Image unit determination method, small target detection method and computer device |
CN112541911A (en) * | 2020-12-23 | 2021-03-23 | 北京百度网讯科技有限公司 | Image processing method and device |
CN113822150A (en) * | 2021-08-06 | 2021-12-21 | 北京百度网讯科技有限公司 | Image recognition method and device, electronic equipment and storage medium |
CN114066900A (en) * | 2021-11-12 | 2022-02-18 | 北京百度网讯科技有限公司 | Image segmentation method and device, electronic equipment and storage medium |
-
2022
- 2022-03-10 CN CN202210231187.0A patent/CN114581672B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113724137A (en) * | 2021-09-08 | 2021-11-30 | 深圳壹账通智能科技有限公司 | Image recognition method, device and equipment based on image segmentation and storage medium |
Non-Patent Citations (1)
Title |
---|
Seam Carving for Content-Aware Image Resizing;Shai Avidan et al.;《ACM Transactions on Graphics》;20170729;1-9 * |
Also Published As
Publication number | Publication date |
---|---|
CN114581672A (en) | 2022-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112560862B (en) | Text recognition method and device and electronic equipment | |
EP3876201B1 (en) | Object detection and candidate filtering system | |
CN113378696B (en) | Image processing method, device, equipment and storage medium | |
CN113780297B (en) | Image processing method, device, equipment and storage medium | |
CN113313083B (en) | Text detection method and device | |
EP3876197A2 (en) | Portrait extracting method and apparatus, electronic device and storage medium | |
CN113205041A (en) | Structured information extraction method, device, equipment and storage medium | |
CN112562069A (en) | Three-dimensional model construction method, device, equipment and storage medium | |
CN113378855A (en) | Method for processing multitask, related device and computer program product | |
CN112488060B (en) | Target detection method, device, equipment and medium | |
CN115719356A (en) | Image processing method, apparatus, device and medium | |
CN113379750A (en) | Semi-supervised learning method of semantic segmentation model, related device and product | |
CN114283398A (en) | Method and device for processing lane line and electronic equipment | |
CN113836462A (en) | Method, device, device and storage medium for generating page description file | |
CN113032071A (en) | Page element positioning method, page testing method, device, equipment and medium | |
CN113971728B (en) | Image recognition method, training method, device, equipment and medium for model | |
CN113837194B (en) | Image processing method, image processing apparatus, electronic device, and storage medium | |
CN114581672B (en) | Image recognition method and device and electronic equipment | |
CN115690143B (en) | Image segmentation method, device, electronic equipment and storage medium | |
CN115409856B (en) | Lung medical image processing method, device, equipment and storage medium | |
CN117557777A (en) | Sample image determining method and device, electronic equipment and storage medium | |
CN114511863B (en) | Table structure extraction method and device, electronic equipment and storage medium | |
CN113947146A (en) | Sample data generation method, model training method, image detection method and device | |
CN112991451A (en) | Image recognition method, related device and computer program product | |
CN113239224A (en) | Abnormal document identification method, device, equipment 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |