CN118195999A - Image detection method, device, equipment and medium - Google Patents

Image detection method, device, equipment and medium Download PDF

Info

Publication number
CN118195999A
CN118195999A CN202311800061.1A CN202311800061A CN118195999A CN 118195999 A CN118195999 A CN 118195999A CN 202311800061 A CN202311800061 A CN 202311800061A CN 118195999 A CN118195999 A CN 118195999A
Authority
CN
China
Prior art keywords
image
detected
target
pixel point
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311800061.1A
Other languages
Chinese (zh)
Inventor
田伟娟
包沉浮
高梦晗
崔恺旭
王国秋
吕中厚
张华正
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202311800061.1A priority Critical patent/CN118195999A/en
Publication of CN118195999A publication Critical patent/CN118195999A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The disclosure provides an image detection method, an image detection device, image detection equipment and an image detection medium, relates to the technical field of computers, and particularly relates to the technical field of image processing. The implementation scheme is as follows: acquiring an image to be detected comprising a target object; predicting at least one target pixel point which does not belong to the target object in the image to be detected; for each target pixel point in the at least one target pixel point, subtracting the pixel value of the target pixel point from the pixel value of each pixel point in the image to be detected to obtain a first image corresponding to the target pixel point; predicting a target area comprising the target object in the first image based on the pixel value of each pixel point in the first image; and determining a detection result for the image to be detected based on the size of the target area, wherein the detection result comprises pass and fail.

Description

Image detection method, device, equipment and medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to the field of image processing technology, and in particular, to an image detection method, an apparatus, an electronic device, a computer readable storage medium, and a computer program product.
Background
With the development of internet technology, more and more picture contents are distributed on the internet platform. In the operation process of the internet platform, a large amount of picture content needs to be detected so as to avoid that pictures comprising cheating content influence the experience of a user.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, the problems mentioned in this section should not be considered as having been recognized in any prior art unless otherwise indicated.
Disclosure of Invention
The present disclosure provides an image detection method, apparatus, electronic device, computer-readable storage medium, and computer program product.
According to an aspect of the present disclosure, there is provided an image detection method including: acquiring an image to be detected comprising a target object; predicting at least one target pixel point which does not belong to the target object in the image to be detected; for each target pixel point in the at least one target pixel point, subtracting the pixel value of the target pixel point from the pixel value of each pixel point in the image to be detected to obtain a first image corresponding to the target pixel point; predicting a target area comprising the target object in the first image based on the pixel value of each pixel point in the first image; and determining a detection result for the image to be detected based on the size of the target area, wherein the detection result comprises pass and fail.
According to another aspect of the present disclosure, there is provided an image detection apparatus including: an acquisition unit configured to acquire an image to be detected including a target object; a first prediction unit configured to predict at least one target pixel point in the image to be detected, which does not belong to the target object; an image processing unit configured to obtain, for each target pixel point in the at least one target pixel point, a first image corresponding to the target pixel point by subtracting a pixel value of the target pixel point from a pixel value of each pixel point in the image to be detected; a second prediction unit configured to predict a target region including the target object in the first image based on a pixel value of each pixel point in the first image; and a detection unit configured to determine a detection result for the image to be detected based on the size of the target area, the detection result including pass and fail.
According to another aspect of the present disclosure, there is provided an electronic device including: 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 image detection method described above.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the above-described image detection method.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program, wherein the computer program is capable of implementing the above-described image detection method when being executed by a processor.
According to one or more embodiments of the present disclosure, efficiency and convenience of image detection may 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 accompanying drawings illustrate exemplary embodiments and, together with the description, serve to explain exemplary implementations of the embodiments. The illustrated embodiments are for exemplary purposes only and do not limit the scope of the claims. Throughout the drawings, identical reference numerals designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a schematic diagram of an exemplary system in which various methods described herein may be implemented, according to an exemplary embodiment of the present disclosure;
FIG. 2 illustrates a flowchart of an image detection method according to an exemplary embodiment of the present disclosure;
FIG. 3 illustrates a flowchart of an image detection method according to an exemplary embodiment of the present disclosure;
Fig. 4 shows a block diagram of an image detection apparatus according to an exemplary embodiment of the present disclosure;
fig. 5 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments 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 of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, the use of the terms "first," "second," and the like to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of the elements, unless otherwise indicated, and such terms are merely used to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on the description of the context.
The terminology used in the description of the various illustrated examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, the elements may be one or more if the number of the elements is not specifically limited. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
In the related art, background information of an image is usually required to be removed based on a relatively complex algorithm so as to extract a foreground region of the image and detect the foreground region, and the detection efficiency of the method is low and occupies more hardware resources.
Based on the above, the disclosure provides an image detection method, which determines at least one target pixel point from an image to be detected, uses a pixel value of the target pixel point as assumed background information, further obtains a first image from which the assumed background information is removed, extracts a target region including a target object based on the first image, and determines an image detection result by detecting the size of the target region, thereby improving the efficiency and convenience of image detection
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 illustrates a schematic diagram of an exemplary system 100 in which various methods and apparatus described herein may be implemented, in accordance with an embodiment of the present disclosure. Referring to fig. 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. Client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.
In embodiments of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the image detection method.
In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual environments and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, for example, provided to users of client devices 101, 102, 103, 104, 105, and/or 106 under a software as a service (SaaS) model.
In the configuration shown in fig. 1, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or a combination thereof that are executable by one or more processors. A user operating client devices 101, 102, 103, 104, 105, and/or 106 may in turn utilize one or more client applications to interact with server 120 to utilize the services provided by these components. It should be appreciated that a variety of different system configurations are possible, which may differ from system 100. Accordingly, FIG. 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
The user may use client devices 101, 102, 103, 104, 105, and/or 106 to send the image to be detected. The client device may provide an interface that enables a user of the client device to interact with the client device. The client device may also output information to the user via the interface. Although fig. 1 depicts only six client devices, those skilled in the art will appreciate that the present disclosure may support any number of client devices.
Client devices 101, 102, 103, 104, 105, and/or 106 may include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, and the like. These computer devices may run various classes and versions of software applications and operating systems, such as MICROSOFT Windows, appli OS, UNIX-like operating systems, linux, or Linux-like operating systems (e.g., GOOGLE Chrome OS); or include various mobile operating systems such as MICROSOFT Windows Mobile OS, iOS, windows Phone, android. Portable handheld devices may include cellular telephones, smart phones, tablet computers, personal Digital Assistants (PDAs), and the like. Wearable devices may include head mounted displays (such as smart glasses) and other devices. The gaming system may include various handheld gaming devices, internet-enabled gaming devices, and the like. The client device is capable of executing a variety of different applications, such as various Internet-related applications, communication applications (e.g., email applications), short Message Service (SMS) applications, and may use a variety of communication protocols.
Network 110 may be any of a variety of networks known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP/IP, SNA, IPX, etc. For example only, the one or more networks 110 may be a Local Area Network (LAN), an ethernet-based network, a token ring, a Wide Area Network (WAN), the internet, a virtual network, a Virtual Private Network (VPN), an intranet, an extranet, a blockchain network, a Public Switched Telephone Network (PSTN), an infrared network, a wireless network (e.g., bluetooth, WIFI), and/or any combination of these and/or other networks.
The server 120 may include one or more general purpose computers, special purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-end servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and/or combination. The server 120 may include one or more virtual machines running a virtual operating system, or other computing architecture that involves virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain virtual storage devices of the server). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
The computing units in server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. Server 120 may also run any of a variety of additional server applications and/or middle tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and/or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and/or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
In some implementations, the server 120 may be a server of a distributed system or a server that incorporates a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service expansibility in the traditional physical host and Virtual special server (VPS PRIVATE SERVER) service.
The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of databases 130 may be used to store information such as audio files and video files. Database 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. Database 130 may be of different categories. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve the databases and data from the databases in response to the commands.
In some embodiments, one or more of databases 130 may also be used by applications to store application data. The databases used by the application may be different types of databases, such as key value stores, object stores, or conventional stores supported by the file system.
The system 100 of fig. 1 may be configured and operated in various ways to enable application of the various methods and apparatus described in accordance with the present disclosure.
Fig. 2 shows a flowchart of an image detection method according to an exemplary embodiment of the present disclosure. As shown in fig. 2, the method 200 includes:
step S201, obtaining an image to be detected comprising a target object;
step S202, predicting at least one target pixel point which does not belong to the target object in the image to be detected;
Step S203, for each target pixel point in the at least one target pixel point, obtaining a first image corresponding to the target pixel point by subtracting the pixel value of the target pixel point from the pixel value of each pixel point in the image to be detected;
Step S204, predicting a target area including the target object in the first image based on the pixel value of each pixel point in the first image; and
Step S205, determining a detection result for the image to be detected based on the size of the target area, where the detection result includes pass and fail.
By applying the image detection method 200, at least one assumed background value can be simply, conveniently and quickly obtained by preliminarily predicting at least one target pixel point, and then a first image with the assumed background information removed is obtained by subtracting the pixel values, and a target area comprising a target object is extracted based on the first image, namely, the extraction efficiency of the target area (namely, the foreground area of the image) can be effectively improved, and then the image detection result is determined by detecting the size of the target area, so that the image detection efficiency and convenience are further improved.
In some examples, a preset condition related to the size of the target area may be preconfigured, based on which a detection result of whether the image detection passes or fails is obtained. For example, the detection threshold may be set for various types of size information such as the width, length, aspect ratio, area, number of pixels, etc. of the target region, and the detection result may be determined based on the relative size relationship between at least one of the various types of size information and the corresponding detection threshold.
In some examples, the detection result may include more information, for example, for an image to be detected for which the detection result is not passing, the location of the target area in the image may be returned to obtain a more comprehensive detection result to indicate cheating information in the image.
In some examples, in step S202, a plurality of target pixel points may be predicted, that is, equivalent to obtaining a plurality of assumed background values, so that the probability of hitting the actual background value may be improved, and thus the extraction accuracy of the target region may be improved, so as to obtain a more accurate image detection result.
According to some embodiments, predicting at least one target pixel point in the image to be detected that does not belong to the target object in step S202 includes: determining the at least one target pixel point from a preset position of the image to be detected, wherein the preset position comprises at least one of an image edge and an image corner. Therefore, the target pixel point can be determined by utilizing a simple preset rule, for example, the pixel value of the image edge or corner is assumed to be background information, and the efficiency is further improved.
In some examples, statistical features of pixel values of respective pixels in the image to be detected may be acquired in step S202, based on which the target pixel is predicted. For example, the mode value of the pixel value of each pixel point may be counted, the pixel point corresponding to the mode value is used as the target pixel point, that is, the mode value is assumed to be the background value of the image to be detected, on the basis, the value with the second largest occurrence number in the pixel value of each pixel point may be used as another assumed background value, and the accuracy of extracting the background information is improved by determining a larger number of assumed background values.
According to some embodiments, predicting the target area in the first image including the target object based on the pixel value of each pixel point in the first image in step S204 includes: in response to determining that a plurality of non-zero pixels are included in the first image, the target region is predicted based on the locations of the plurality of non-zero pixels. Thus, the non-zero pixel point can be detected in the first image from which the background information is removed, and the target area can be simply and accurately indicated by using the position of the non-zero pixel point.
In some examples, a plurality of pixels in the first image may be filtered based on the absolute values of the pixel values in step S204, and the target region may be predicted based on the positions of the filtered pixels. Thus, each pixel point possibly belonging to the target object can be screened more accurately on the basis of the first image, so that the target area can be extracted more accurately.
It will be appreciated that the method 200 is based on the relative size of the target object in the image to be detected for the detection of the cheating image, in which case the size of the target area is indicative of the relative size of the target object.
Based on this, according to some embodiments, predicting the target region based on the locations of the plurality of non-zero pixels comprises: determining a minimum bounding box bounding the plurality of non-zero pixel points; and predicting the target region based on the minimum bounding box. Therefore, the minimum bounding box can be obtained according to the non-zero pixel points to serve as a target area, and the method is simple, convenient and quick.
According to some embodiments, determining the detection result for the image to be detected based on the size of the target area in step S205 includes: determining a detection result for the image to be detected based on at least one of: a first ratio of the length of the minimum bounding box to the length of the image to be detected, a second ratio of the width of the minimum bounding box to the width of the image to be detected, and a third ratio of the area of the minimum bounding box to the area of the image to be detected. Thus, in the case where the target area is determined based on the minimum bounding box having a regular rectangular shape, the length-width or area information of the target area can be simply and quickly calculated, and the detection result can be determined based on the size ratio.
For example, a preset threshold may be set for at least one of the first ratio, the second ratio, and the third ratio, and the image detection result may be determined by comparing the relative magnitude relation of the size ratio and the preset threshold.
It should be appreciated that steps S204-S205 may also be implemented in other ways. For example, in some examples, each non-zero pixel point may be directly used as a target area, and the size of the target area may be determined based on the proportion of the number of the plurality of non-zero pixel points to the total number of the pixel points in the image, so as to determine the image detection result simply, conveniently and quickly.
For another example, in some examples, at least one connectable region may be determined based on a plurality of non-zero pixel points in the first image, and then the connectable region with the largest area may be used as the target region, so as to extract the foreground information of the image more accurately.
According to some embodiments, determining the detection result for the image to be detected based on the size of the target area in step S205 includes: and determining a detection result aiming at the image to be detected based on the size of the target area and the relative position of the target area in the image to be detected. Therefore, the relative position of the target area can be further combined to detect, so that the accuracy of image detection is improved. For example, it may be determined that the detection result of an image in which the target area is too small and the target area is too close to the edge is not passed.
In some examples, distance information of the target region from each edge of the image may be calculated as relative position information. For example, the image detection result may be determined by comparing the relative magnitude relation of the relative position information with the corresponding preset threshold value.
In a practical application scenario, there is a need for image detection for a moving image (i.e., an image sequence composed of a plurality of frame images). In this case, the multi-frame images in the moving image sequence may be extracted, and the above image detection method 200 is applied to each frame of image under the condition that the number of images to be detected is large, so that efficient image detection is implemented by using fewer hardware resources, so as to fully meet the requirements of practical application scenarios.
According to some embodiments, when the image to be detected is extracted from an image sequence composed of a plurality of frames of images, determining the detection result for the image to be detected based on the size of the target area in step S205 includes: and determining a detection result aiming at the image to be detected based on the size of the target area and the position of the image to be detected in the image sequence. In this way, in the case of image detection for a moving image sequence, a more accurate detection result can be obtained by further combining the positions of the images to be detected in the moving image sequence.
In a practical application scenario, the following possibilities exist: the image format of the cheating image is maliciously tampered with, for example, by modifying the suffix of the image file to fool the image detection means.
Based on this, in some examples, the correct image format may be further detected according to the encoding information of the image file after the image to be detected is acquired, and when the image format of the image to be detected is found to be maliciously tampered, correction may be performed, so as to achieve more efficient image detection. For example, the correct image format may be determined by checking the encoding information of a specific bit in the binary file of the image, for example, when the first 5 bits of the binary file are "GIF89" or "GIF87", the image is judged to be a GIF image, so that the GIF image needs to be parsed to extract a plurality of frames of static images therein and detect the static images respectively.
Fig. 3 shows a flowchart of an image detection method 300 according to an exemplary embodiment of the present disclosure. As shown in fig. 3, the method 300 includes:
step S301, obtaining an image to be detected comprising a target object;
Step S302, determining at least one target pixel point from a preset position of the image to be detected, wherein the preset position comprises at least one of an image edge and an image corner;
step S303, for each target pixel point in the at least one target pixel point, obtaining a first image corresponding to the target pixel point by subtracting the pixel value of the target pixel point from the pixel value of each pixel point in the image to be detected;
Step S304, in response to determining that a plurality of non-zero pixel points are included in the first image, determining a minimum bounding box bounding the plurality of non-zero pixel points;
Step S305, determining a target area based on the minimum bounding box; and
Step S306, determining a detection result for the image to be detected based on the size of the target area, where the detection result includes pass and fail.
By applying the method 300, the target pixel point can be predicted by using a simple and convenient preset rule, namely, at least one assumed background value is simply and quickly obtained, then a first image with the assumed background information removed is obtained by subtracting the pixel values, and the target area is simply and accurately indicated by using the position of the non-zero pixel point in the first image, namely, the extraction efficiency of the target area can be effectively improved, and the image detection result is determined by detecting the size of the target area, so that the image detection efficiency and convenience are further improved.
According to an aspect of the present disclosure, there is also provided an image detection apparatus. Fig. 4 shows a block diagram of an image detection apparatus 400 according to an exemplary embodiment of the present disclosure. As shown in fig. 4, the apparatus 400 includes:
an acquisition unit 401 configured to acquire an image to be detected including a target object;
A first prediction unit 402 configured to predict at least one target pixel point in the image to be detected that does not belong to the target object;
An image processing unit 403 configured to obtain, for each target pixel point of the at least one target pixel point, a first image corresponding to the target pixel point by subtracting the pixel value of the target pixel point from the pixel value of each pixel point in the image to be detected;
A second prediction unit 404 configured to predict a target area including the target object in the first image based on a pixel value of each pixel point in the first image; and
A detection unit 405 configured to determine a detection result for the image to be detected based on the size of the target area, the detection result including pass and fail.
According to some embodiments, the first prediction unit 402 is configured to: determining the at least one target pixel point from a preset position of the image to be detected, wherein the preset position comprises at least one of an image edge and an image corner.
According to some embodiments, the second prediction unit 404 is configured to: in response to determining that a plurality of non-zero pixels are included in the first image, the target region is predicted based on the locations of the plurality of non-zero pixels.
According to some embodiments, the second prediction unit 404 comprises: a determining subunit configured to determine a minimum bounding box bounding the plurality of non-zero pixel points; and a prediction subunit configured to predict the target region based on the minimum bounding box.
According to some embodiments, the detection unit is configured to: determining a detection result for the image to be detected based on at least one of: a first ratio of the length of the minimum bounding box to the length of the image to be detected, a second ratio of the width of the minimum bounding box to the width of the image to be detected, and a third ratio of the area of the minimum bounding box to the area of the image to be detected.
According to some embodiments, the detection unit 405 is configured to: and determining a detection result aiming at the image to be detected based on the size of the target area and the relative position of the target area in the image to be detected.
According to some embodiments, the image to be detected is extracted from an image sequence composed of a plurality of frames of images, and the detection unit 405 is configured to: and determining a detection result aiming at the image to be detected based on the size of the target area and the position of the image to be detected in the image sequence.
It should be understood that the operations of the respective units of the image detection apparatus 400 shown in fig. 4 may correspond to the respective steps in the image processing method 200 described in fig. 2. Thus, the operations, features and advantages described above with respect to method 200 are equally applicable to apparatus 400 and the various units it comprises. For brevity, certain operations, features and advantages are not described in detail herein.
According to another aspect of the present disclosure, there is also provided an electronic apparatus including: 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 image detection method described above.
According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the above-described image detection method.
According to another aspect of the present disclosure, there is also provided a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned image detection method.
Referring to fig. 5, a block diagram of an electronic device 500 that may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable 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. 5, the apparatus 500 includes a computing unit 501 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, ROM 502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Various components in the device 500 are connected to the I/O interface 505, including: an input unit 506, an output unit 507, a storage unit 508, and a communication unit 509. The input unit 506 may be any type of device capable of inputting information to the device 500, the input unit 506 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone, and/or a remote control. The output unit 507 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 508 may include, but is not limited to, magnetic disks, optical disks. The communication unit 509 allows the device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth devices, 802.11 devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 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 501 performs the respective methods and processes described above, such as an image detection method. For example, in some embodiments, the image detection method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When a computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the image detection method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the image detection 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), complex 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), the internet, and blockchain networks.
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.
While embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the methods, systems, and apparatus described above are merely illustrative embodiments or examples and that the scope of the present disclosure is not limited by these embodiments or examples. Various elements of the embodiments or examples may be omitted or replaced with equivalent elements thereof. Furthermore, the steps may be performed in a different order than described in the present disclosure. Further, various elements of the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after the disclosure.

Claims (17)

1. An image detection method, comprising:
acquiring an image to be detected comprising a target object;
Predicting at least one target pixel point which does not belong to the target object in the image to be detected;
for each of the at least one target pixel point,
Subtracting the pixel value of the target pixel point from the pixel value of each pixel point in the image to be detected to obtain a first image corresponding to the target pixel point;
predicting a target area comprising the target object in the first image based on the pixel value of each pixel point in the first image; and
And determining a detection result for the image to be detected based on the size of the target area, wherein the detection result comprises pass and fail.
2. The method of claim 1, wherein said predicting at least one target pixel in the image to be detected that does not belong to the target object comprises:
determining the at least one target pixel point from a preset position of the image to be detected, wherein the preset position comprises at least one of an image edge and an image corner.
3. The method of claim 1 or 2, wherein predicting a target region in the first image that includes the target object based on pixel values of each pixel point in the first image comprises:
In response to determining that a plurality of non-zero pixels are included in the first image, the target region is predicted based on the locations of the plurality of non-zero pixels.
4. The method of claim 3, wherein the predicting the target region based on the locations of the plurality of non-zero pixels comprises:
determining a minimum bounding box bounding the plurality of non-zero pixel points; and
And predicting the target area based on the minimum bounding box.
5. The method of claim 4, wherein the determining a detection result for the image to be detected based on the size of the target area comprises:
Determining a detection result for the image to be detected based on at least one of: a first ratio of the length of the minimum bounding box to the length of the image to be detected, a second ratio of the width of the minimum bounding box to the width of the image to be detected, and a third ratio of the area of the minimum bounding box to the area of the image to be detected.
6. The method of any of claims 1-5, wherein the determining a detection result for the image to be detected based on the size of the target area comprises:
and determining a detection result aiming at the image to be detected based on the size of the target area and the relative position of the target area in the image to be detected.
7. The method of any of claims 1-6, wherein the image to be detected is extracted from an image sequence of multiple frames of images, and wherein the determining a detection result for the image to be detected based on the size of the target region comprises:
And determining a detection result aiming at the image to be detected based on the size of the target area and the position of the image to be detected in the image sequence.
8. An image detection apparatus comprising:
an acquisition unit configured to acquire an image to be detected including a target object;
A first prediction unit configured to predict at least one target pixel point in the image to be detected, which does not belong to the target object;
An image processing unit configured to obtain, for each target pixel point in the at least one target pixel point, a first image corresponding to the target pixel point by subtracting a pixel value of the target pixel point from a pixel value of each pixel point in the image to be detected;
A second prediction unit configured to predict a target region including the target object in the first image based on a pixel value of each pixel point in the first image; and
And a detection unit configured to determine a detection result for the image to be detected based on the size of the target area, the detection result including pass and fail.
9. The apparatus of claim 8, wherein the first prediction unit is configured to:
determining the at least one target pixel point from a preset position of the image to be detected, wherein the preset position comprises at least one of an image edge and an image corner.
10. The apparatus of claim 8 or 9, wherein the second prediction unit is configured to:
In response to determining that a plurality of non-zero pixels are included in the first image, the target region is predicted based on the locations of the plurality of non-zero pixels.
11. The apparatus of claim 10, wherein the second prediction unit comprises:
a determining subunit configured to determine a minimum bounding box bounding the plurality of non-zero pixel points; and
And a prediction subunit configured to predict the target region based on the minimum bounding box.
12. The apparatus of claim 11, wherein the detection unit is configured to:
Determining a detection result for the image to be detected based on at least one of: a first ratio of the length of the minimum bounding box to the length of the image to be detected, a second ratio of the width of the minimum bounding box to the width of the image to be detected, and a third ratio of the area of the minimum bounding box to the area of the image to be detected.
13. The apparatus of any of claims 8-12, wherein the detection unit is configured to:
and determining a detection result aiming at the image to be detected based on the size of the target area and the relative position of the target area in the image to be detected.
14. The apparatus according to any one of claims 8-13, wherein the image to be detected is extracted from an image sequence consisting of a plurality of frame images, and wherein the detection unit is configured to:
And determining a detection result aiming at the image to be detected based on the size of the target area and the position of the image to be detected in the image sequence.
15. An electronic device, comprising:
At least one processor; and
A memory communicatively coupled to the at least one processor; wherein the method comprises the steps of
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-7.
16. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to any of claims 1-7.
CN202311800061.1A 2023-12-25 2023-12-25 Image detection method, device, equipment and medium Pending CN118195999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311800061.1A CN118195999A (en) 2023-12-25 2023-12-25 Image detection method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311800061.1A CN118195999A (en) 2023-12-25 2023-12-25 Image detection method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN118195999A true CN118195999A (en) 2024-06-14

Family

ID=91414568

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311800061.1A Pending CN118195999A (en) 2023-12-25 2023-12-25 Image detection method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN118195999A (en)

Similar Documents

Publication Publication Date Title
CN112857268B (en) Object area measuring method, device, electronic equipment and storage medium
CN112749685B (en) Video classification method, apparatus and medium
CN113256583A (en) Image quality detection method and apparatus, computer device, and medium
CN112712498A (en) Vehicle damage assessment method and device executed by mobile terminal, mobile terminal and medium
CN113810765B (en) Video processing method, device, equipment and medium
CN113723305A (en) Image and video detection method, device, electronic equipment and medium
CN112860566B (en) Applet detection method, device, electronic equipment and readable medium
CN116152607A (en) Target detection method, method and device for training target detection model
CN114140852B (en) Image detection method and device
CN113139542B (en) Object detection method, device, equipment and computer readable storage medium
CN113839944B (en) Method, device, electronic equipment and medium for coping with network attack
CN114510308B (en) Method, device, equipment and medium for storing application page by mobile terminal
CN114842476A (en) Watermark detection method and device and model training method and device
CN113627534A (en) Method and device for identifying type of dynamic image and electronic equipment
CN118195999A (en) Image detection method, device, equipment and medium
CN113486853A (en) Video detection method and device, electronic equipment and medium
CN115512131B (en) Image detection method and training method of image detection model
CN115170536B (en) Image detection method, training method and device of model
CN114140851B (en) Image detection method and method for training image detection model
CN115620271B (en) Image processing and model training method and device
CN113627330B (en) Method and device for identifying target type dynamic image and electronic equipment
CN114821233B (en) Training method, device, equipment and medium of target detection model
CN116070711B (en) Data processing method, device, electronic equipment and storage medium
CN114842474B (en) Character recognition method, device, electronic equipment and medium
CN114511694B (en) Image recognition method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication