A method, device and equipment for identifying dangerous objects based on image recognition
Image recognition technology automatically recognizes the distance between the object above the luggage rack and the edge line, solving the problem of safety hazards in luggage storage above the luggage rack in public transportation, and improving inspection efficiency and safety.
Patent Information
- Application Number
- CN202111456714.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2041-12-01
AI Technical Summary
In public transportation, the luggage above the luggage rack is stored in low efficiency and easy to miss due to the low efficiency of manual inspection, which poses safety hazards, making it difficult to achieve convenient and safe identification of hazardous objects.
Using an image recognition method, by obtaining the video stream of the luggage rack, extracting the target frame picture, determining the edge line of the luggage rack, identifying the edge line of the object above the edge line, and determining whether the distance between the object and the edge line of the luggage rack exceeds the preset Safe distance, automatically identify suspected dangerous objects.
It realizes automatic identification of safety hazards on the luggage rack, improves the inspection efficiency of flight attendants, and enhances the safety and convenience of travel.
Smart Images

Figure CN114241365B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method, device and equipment for identifying dangerous objects based on image recognition. Background Art
[0002] When traveling by public transportation such as high-speed rail, bullet trains, trains, and long-distance buses, the luggage storage above the seats is often open. Sometimes the luggage exceeds the luggage rack and hangs in the air. At this time, the crew members are required to patrol and inspect regularly, which is very inconvenient and inefficient. There will inevitably be omissions, leading to safety hazards.
[0003] Based on this, a more secure and convenient hazardous material identification solution is needed in public transportation. Summary of the invention
[0004] One or more embodiments of the present specification provide a method, device, equipment and storage medium for identifying dangerous objects based on image recognition to solve the following technical problem: a safer and more convenient dangerous object identification solution is needed in public transportation.
[0005] To solve the above technical problems, one or more embodiments of this specification are implemented as follows:
[0006] In a first aspect, an embodiment of the present specification provides a dangerous object identification method based on image recognition, which is applied to a carriage including a luggage rack, and the method includes: obtaining a video stream including the luggage rack, and extracting a target frame image from the video stream; determining an edge line of the luggage rack in the target frame image; identifying an object edge line of a target object above the edge line of the luggage rack; and when the distance between the object edge line and the edge line of the luggage rack exceeds a preset safety distance, determining the target object as a suspected dangerous object.
[0007] In the second aspect, an embodiment of the present specification provides a dangerous object identification device based on image recognition, which is applied to a carriage including a luggage rack, and the device includes: an acquisition module, which acquires a video stream including the luggage rack and extracts a target frame image from the video stream; a determination module, which determines the edge line of the luggage rack in the target frame image; an identification module, which identifies the object edge line of the target object above the edge line of the luggage rack; and a judgment module, which determines the target object as a suspected dangerous object when the distance between the object edge line and the edge line of the luggage rack exceeds a preset safety distance.
[0008] In a third aspect, an embodiment of the present specification provides an electronic device, including:
[0009] at least one processor; and,
[0010] a memory communicatively connected to the at least one processor; wherein,
[0011] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
[0012] In a fourth aspect, an embodiment of the present specification provides a non-volatile computer storage medium storing computer executable instructions. When a computer reads the computer executable instructions in the storage medium, the instructions cause one or more processors to execute the method described in the first aspect.
[0013] At least one of the above technical solutions adopted in one or more embodiments of this specification can achieve the following beneficial effects: by acquiring a video stream containing the luggage rack, extracting a target frame image from the video stream; determining the edge line of the luggage rack in the target frame image; identifying the object edge line of the target object above the edge line of the luggage rack; when the distance between the object edge line and the edge line of the luggage rack exceeds a preset safety distance, determining the target object as a suspected dangerous object. This realizes automatic identification of dangerous luggage with safety hazards on the luggage rack, improves the efficiency of luggage rack inspection by flight attendants, and is safer and more convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0015] Figure 1 A flowchart of a dangerous object identification method based on image recognition provided in an embodiment of this specification;
[0016] Figure 2 A schematic diagram of an object edge line and a luggage rack edge line provided in an embodiment of this specification;
[0017] Figure 3 A schematic diagram of the relative position relationship between an edge line of an object and an edge line of a luggage rack provided in an embodiment of this specification;
[0018] Figure 4 A schematic diagram of the structure of a dangerous object identification device based on image recognition provided in an embodiment of this specification;
[0019] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0020] The embodiments of this specification provide a method, device, equipment and storage medium for identifying dangerous objects based on image recognition.
[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0022] In a carriage with a luggage rack, the luggage storage above the seat is open. Even if the initial placement of the luggage is completely in compliance with the standards and safe, as the vehicle moves, the luggage may still move, causing the luggage to exceed the edge of the luggage rack and hang in the air. This requires crew members to patrol regularly to check for luggage that may be dangerous. This manual inspection method is inefficient and easy to miss. Based on this, the embodiments of this specification provide a dangerous object identification solution based on image recognition to achieve more efficient and safe identification of dangerous objects.
[0023] In a first aspect, the embodiments of this specification provide a method for identifying dangerous objects based on image recognition, which is applied to a compartment including a luggage rack. Figure 1 As shown, Figure 1 A flowchart of a dangerous object identification method based on image recognition provided in an embodiment of this specification includes:
[0024] S101, obtaining a video stream containing the luggage rack, and extracting a target frame image from the video stream.
[0025] The video stream consists of multiple consecutive frames of images and can be captured by a camera installed on the top of the car or above the luggage rack.
[0026] The target frame image can be extracted from the video stream based on a preset management cycle. For example, a target frame image is extracted every 3 minutes; or a target frame image is extracted at a specified time (for example, when the train needs to accelerate or turn).
[0027] S103, determining the edge line of the luggage rack in the target frame image.
[0028] Image segmentation and feature extraction can be used to detect image lines in the target frame. For example, since the edge of the luggage rack is generally empty, in the target frame image, other pixels around the luggage rack pixel corresponding to the edge line of the luggage rack will be significantly different from the edge line of the luggage rack in terms of brightness or grayscale. Usually, the brightness of other pixels is higher than that of the luggage rack pixel, and the grayscale is lower than that of the luggage rack pixel.
[0029] Therefore, by identifying the pixel points with obvious brightness or grayscale changes in the target frame image, the contour lines of all objects contained in the target frame image can be obtained, and the longest straight line or several longest straight lines that are parallel to each other and close enough can be identified from the obtained contour lines to obtain the edge line of the luggage rack in the target frame image.
[0030] S105: Identify the object edge line of the target object above the edge line of the luggage rack.
[0031] It is easy to understand that the luggage is always above the luggage rack. Therefore, after the edge line of the luggage rack is identified, only the target objects above the edge line of the luggage rack can be identified (that is, the target frame image can be directly segmented based on the edge line of the luggage rack, and only the part of the image above the edge line of the luggage rack can be detected), so that multiple target objects placed on the luggage rack can be detected, and then the object edge line of each target object can be detected.
[0032] In this process, the edge line of the luggage rack can be detected in the manner described above, and the edge line of each target object can be identified from the target frame image in turn. Figure 2 As shown, Figure 2 This is a schematic diagram of an object edge line and a luggage rack edge line provided in an embodiment of this specification. In this schematic diagram, a certain distance (i.e. Figure 2 For a portion of the image (the seating area below the middle dashed line), edge lines may no longer be detected.
[0033] S107: When the distance between the edge line of the object and the edge line of the luggage rack exceeds a preset safety distance, the target object is determined as a suspected dangerous object.
[0034] The object edge line includes the edge strip inside or outside the luggage rack edge line. In the embodiment of this specification, the target of judgment refers to the object edge line outside the luggage rack edge line. Figure 2As shown in , when the edge line of the object is inside the edge line of the luggage rack, it can usually be considered that the target object is still safe. When the edge line of the object exceeds the edge line of the luggage rack and is outside, the distance it exceeds can be determined. When the distance between the edge line of the object and the outside of the edge line of the luggage rack exceeds the preset safety distance, the target object can be determined as a suspected dangerous object. Therefore, a danger warning can be directly issued based on the suspected dangerous object, or the crew can manually confirm the suspected dangerous object again.
[0035] By acquiring a video stream containing the luggage rack, extracting a target frame image from the video stream; determining the edge line of the luggage rack in the target frame image; identifying the object edge line of the target object above the edge line of the luggage rack; and determining the target object as a suspected dangerous object when the distance between the object edge line and the edge line of the luggage rack exceeds a preset safety distance. This realizes automatic identification of dangerous luggage with safety hazards on the luggage rack, improves the efficiency of luggage rack inspection by flight attendants, and is safer and more convenient.
[0036] In one embodiment, after the suspected dangerous object has been identified, the monitoring system can issue a prompt message to the seat number under the suspected dangerous object. Specifically, the following method can be adopted: determine the spatial position of the target object, and determine the seat number corresponding to the spatial position in the car; issue a prompt message containing the spatial position of the target object and the seat number in the car. In this way, the seat number near the suspected dangerous object can be accurately identified, and prompt information can be accurately issued to it, so that passengers near the suspected dangerous object can adjust their posture in time and accurately prevent risks.
[0037] For example, multiple seat numbers can be detected directly from the target frame image based on image recognition technology, and the pixel coordinates of each seat number in the target frame image can be determined, and the distance between the pixel coordinates of each seat number and the pixel coordinates of the target object can be calculated, and the seat number with the closest distance can be determined as the seat number corresponding to the spatial position of the target object in the carriage.
[0038] For another example, the luggage rack can be first calibrated based on its spatial position in the car, and then the object pixel coordinates of the target object in the image can be obtained based on the calibrated spatial position of the luggage rack and the luggage pixel coordinates of the edge line of the luggage rack in the image. Thus, the spatial position of each target object can be inferred based on the luggage pixel coordinates, the object pixel coordinates and the calibrated spatial position of the luggage rack.
[0039] It should be noted that since the spatial position in the carriage and the seat number usually correspond to a range, that is, a certain seat number corresponds to a spatial range. In order to reduce potential risks, the seat numbers determined based on the spatial position of the target object can be multiple, for example, the first three seat numbers whose spatial positions corresponding to the seat numbers are closest to the spatial position of the target object can be used.
[0040] In the carriage, the seat corresponding to each seat number is also fixed. Therefore, the seat number corresponding to the target object can be determined based on its spatial position, thereby issuing a prompt message containing the spatial position of the target object and the seat number in the carriage. For example, a text prompt "The luggage above No. xx has exceeded the luggage rack" can be issued on the scrolling display screen in front of the vehicle; or, the prompt message containing the spatial position of the target object can be displayed on the display screen above the corresponding seat number in the carriage, that is, a text prompt "The luggage above your seat has exceeded the luggage rack" and so on can be issued on the screen above the seat number. The prompt message containing the spatial position of the target object is displayed on the display screen above the corresponding seat number in the carriage.
[0041] In one embodiment, in order to more accurately determine the spatial position of the target object, the following method may be used: determine the relative position of the edge line of the object in the edge line of the luggage rack; determine the spatial position of the target object based on the absolute coordinates of the pre-calibrated edge line of the luggage rack and the relative position. Figure 3 As shown, Figure 3 A schematic diagram of the relative position relationship between an edge line of an object and an edge line of a luggage rack provided in an embodiment of this specification.
[0042] In the target frame image, the pixel coordinates of the luggage rack edge line and the object edge line can be obtained respectively. It is easy to understand that when the object edge line exceeds the outside of the luggage edge line, based on this, the partial pixel coordinates of the partial object edge line that exceeds the outside of the luggage edge line can also be obtained. At this time, the relative position of the partial object edge line in the luggage rack edge line can be determined based on the pixel coordinates of the luggage rack edge line and the partial pixel coordinates. Figure 3 As shown in , if the edge line of the luggage rack is divided into multiple segments (i.e. Figure 3The area defined by each dotted line in the image can be calibrated in advance based on actual needs), then it can be clearly seen that the edge line of the partial object is between the second segment of the edge line of the luggage rack. The absolute coordinates of the edge line of the luggage rack can be calibrated in advance, that is, the spatial position of the second segment in the luggage rack can be obtained based on the absolute coordinates of the edge line of the luggage rack, that is, the spatial position of the target object can be determined based on the pre-calibrated absolute coordinates of the edge line of the luggage rack and the relative position. In this way, it is only necessary to pre-calibrate multiple segments of the luggage rack, that is, the spatial position of the target object can be quickly obtained, which is more accurate and efficient.
[0043] In one embodiment, one camera may not be sufficient to capture the entire luggage rack. In this case, the luggage rack can be split into multiple sub-luggage racks, and a correspondence between each sub-luggage rack and a seat number can be established in advance, so that multiple cameras can be used to synchronously capture sub-video streams corresponding to the sub-luggage racks. Further, the seat number corresponding to the spatial position in the car can be determined based on the correspondence between the sub-luggage racks and the seat numbers contained in the sub-video streams.
[0044] For example, the luggage rack can be pre-divided into four sub-luggage racks, and the seat numbers in the carriage can be divided into four number sets, each of which corresponds to a number set. Thus, when determining the seat number corresponding to the spatial position in the carriage, the sub-luggage rack contained in the sub-video stream can be directly obtained, and the correspondence between the sub-luggage rack contained in the sub-video stream and the seat number can be queried to determine the seat number corresponding to the spatial position in the carriage. In this way, the seat number corresponding to the spatial position in the carriage can be obtained more accurately.
[0045] In one embodiment, since there is only one extracted target frame image and it is not fully representative, after determining the suspected dangerous object from the target frame image, other frame images within a specified time range of the target frame image can also be obtained; when the statistical value of the distance between the edge line of the object and the edge line of the luggage rack in the target frame image and the other frame images exceeds the preset safety distance, the target object is determined as a suspected dangerous object.
[0046] The specified time range may be, for example, a number of seconds before and after the target frame image (for example, 3 seconds), or a number of frames before and after the target frame image (for example, 100 frames), so that image recognition can be performed on other frame images within the specified time range, and multiple distances between the object edge line of the target object at the same position in other frame images and the edge line of the luggage rack can be obtained, and multiple distances can be counted to obtain statistical values. The statistical value of the distance between the object edge line and the edge line of the luggage rack can be a value such as a mean, a median, etc. When the statistical value of the multiple distances exceeds the preset safety distance, the target object can be determined as a suspected dangerous object, otherwise, the target object is not determined as a suspected dangerous object.
[0047] Alternatively, it is also possible to count whether the number of images in which the distance between the edge line of the object and the edge line of the luggage rack exceeds the preset safety distance in the target frame image and the other frame images reaches a preset proportion or a preset number, for example, whether the number of images in which the distance between the edge line of the object and the edge line of the luggage rack exceeds the preset safety distance reaches 80%. If so, the target object is determined as a suspected dangerous object, otherwise, the target object is not determined as a suspected dangerous object. By counting whether the target object crosses the line in the target frame and other frames around it, the accuracy of whether a target object is a dangerous object can be more accurately determined to avoid misjudgment.
[0048] In one embodiment, during driving, it is possible that passengers or crew members need to adjust the posture of luggage or use luggage, that is, when someone is in continuous contact with the luggage box, the target object should be considered safe. Specifically, the character images in the target frame image and other frame images (that is, other frame images within the preset market range of the target frame image) can be identified, and the contour line of the character image can be determined. When the overlap time between the contour line and the edge line of the object does not exceed the preset time length, the target object is determined as a suspected dangerous object, otherwise, the target object is determined as a safe object. In this way, it is possible to avoid erroneous identification of dangerous objects when passengers or crew members operate luggage, and avoid erroneous prompts.
[0049] Based on the same idea, one or more embodiments of this specification also provide devices and apparatuses corresponding to the above methods, such as Figure 4 , Figure 5 shown.
[0050] In the second aspect, Figure 4 shown. Figure 4 A schematic diagram of a dangerous object identification device based on image recognition provided in an embodiment of this specification is applied to a carriage including a luggage rack, and the device includes:
[0051] An acquisition module 401 acquires a video stream containing the luggage rack and extracts a target frame image from the video stream;
[0052] A determination module 403 determines an edge line of the luggage rack in the target frame image;
[0053] The recognition module 405 recognizes the object edge line of the target object above the edge line of the luggage rack;
[0054] The judgment module 407 determines the target object as a suspected dangerous object when the distance between the edge line of the object and the edge line of the luggage rack exceeds a preset safety distance.
[0055] Optionally, the device also includes a prompt module 409, which determines the spatial position of the target object and the seat number corresponding to the spatial position in the carriage; and issues a prompt message containing the spatial position of the target object and the seat number in the carriage.
[0056] Optionally, the prompt module 409 determines the relative position of the edge line of the object in the edge line of the luggage rack; and determines the spatial position of the target object based on the pre-calibrated absolute coordinates of the edge line of the luggage rack and the relative position.
[0057] Optionally, the acquisition module 401 pre-establishes a correspondence between sub-luggage racks and seat numbers, splits the luggage rack into multiple sub-luggage racks, and acquires a sub-video stream containing the sub-luggage racks; correspondingly, the prompt module determines the seat number corresponding to the spatial position in the carriage based on the correspondence between the sub-luggage racks and seat numbers contained in the sub-video stream.
[0058] Optionally, the prompt module 409 displays prompt information including the spatial position of the target object on a display screen on the corresponding seat number in the carriage.
[0059] Optionally, the judgment module 407 obtains other frame images within a specified time range of the target frame image; when the statistical value of the distance between the edge line of the object and the edge line of the luggage rack in the target frame image and the other frame images exceeds a preset safety distance, the target object is determined to be a suspected dangerous object.
[0060] Optionally, the device also includes a character recognition module 411, which identifies the character images in the target frame picture and the other frame images, and determines the contour line of the character image; when the overlapping time of the contour line and the edge line of the object does not exceed a preset time length, the target object is determined as a suspected dangerous object, otherwise, the target object is determined as a safe object.
[0061] In the third aspect, Figure 5 As shown, Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification, the device includes:
[0062] at least one processor; and,
[0063] a memory communicatively connected to the at least one processor; wherein,
[0064] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.
[0065] Based on the same idea, in the fourth aspect, the embodiment of this specification also provides a non-volatile computer storage medium corresponding to the above method, storing computer executable instructions. When the computer reads the computer executable instructions in the storage medium, the instructions enable one or more processors to execute the method described in the first aspect.
[0066] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0067] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0068] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0069] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0070] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0071] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0074] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0075] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0076] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0077] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0078] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0079] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0080] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for identifying dangerous objects based on image recognition, applied to a carriage including a luggage rack, the method comprising: Acquire a video stream containing the luggage rack, and extract a target frame image from the video stream; Determine the luggage rack edge line in the target frame image; Identifying an object edge line of a target object above the edge line of the luggage rack; When the distance between the edge line of the object and the edge line of the luggage rack exceeds the preset safety distance, the target object is determined as a suspected dangerous object, including: acquiring other frame images within a specified time range of the target frame image, and when the statistical value of the distance between the edge line of the object and the edge line of the luggage rack in the target frame image and the other frame images exceeds the preset safety distance, the target object is determined as a suspected dangerous object; Wherein, the method further comprises: Identify the character images in the target frame image and the other frame images, and determine the contour lines of the character images; When the overlapping time between the contour line and the edge line of the object does not exceed a preset time length, the target object is determined as a suspected dangerous object; otherwise, the target object is determined as a safe object.
2. The method of claim 1, wherein: The method further comprises: Determine the spatial position of the target object, and determine the seat number corresponding to the spatial position in the carriage; A prompt message including the spatial position of the target object and the seat number is issued in the carriage.
3. The method of claim 2, wherein: Determining the spatial position of the target object includes: Determining the relative position of the object edge line within the luggage rack edge line; The spatial position of the target object is determined based on the pre-calibrated absolute coordinates of the luggage rack edge line and the relative position.
4. The method of claim 2, wherein: Obtain a video stream containing the luggage rack, including: Establish the correspondence between the luggage rack and the seat number in advance. Splitting the luggage rack into a plurality of sub-luggage racks, and acquiring a sub-video stream including the sub-luggage racks; Correspondingly, determining the seat number corresponding to the spatial position in the carriage includes: determining the seat number corresponding to the spatial position in the carriage according to the correspondence between the sub-luggage rack and the seat number contained in the sub-video stream.
5. The method of claim 2, wherein: Sending a prompt message including the spatial position and the seat number in the carriage includes: The prompt information including the spatial position of the target object is displayed on the display screen on the corresponding seat number in the carriage.
6. A dangerous object identification device based on image recognition, applied to a compartment including a luggage rack, the device comprising: An acquisition module, which acquires a video stream containing the luggage rack and extracts a target frame image from the video stream; A determination module determines an edge line of the luggage rack in the target frame image; A recognition module, which recognizes an object edge line of a target object above the edge line of the luggage rack; A judgment module, when the distance between the edge line of the object and the edge line of the luggage rack exceeds a preset safety distance, determines the target object as a suspected dangerous object; The judgment module obtains other frame images within a specified time range of the target frame image; when the statistical value of the distance between the edge line of the object and the edge line of the luggage rack in the target frame image and the other frame images exceeds a preset safety distance, the target object is determined as a suspected dangerous object; Among them, the device also includes a character recognition module, which identifies the character images in the target frame picture and the other frame images, and determines the contour line of the character image; when the overlapping time of the contour line and the edge line of the object does not exceed a preset time length, the target object is determined as a suspected dangerous object, otherwise, the target object is determined as a safe object.
7. The device as described in claim 6 further includes a prompt module, which determines the spatial position of the target object and the seat number corresponding to the spatial position in the carriage; and issues a prompt message containing the spatial position of the target object and the seat number in the carriage.
8. The device according to claim 7, wherein: The prompt module determines the relative position of the edge line of the object in the edge line of the luggage rack; and determines the spatial position of the target object based on the pre-calibrated absolute coordinates of the edge line of the luggage rack and the relative position.
9. The device according to claim 7, wherein: The acquisition module pre-establishes a correspondence between the sub-luggage racks and the seat numbers, splits the luggage rack into multiple sub-luggage racks, and acquires a sub-video stream containing the sub-luggage racks; correspondingly, the prompt module determines the seat number corresponding to the spatial position in the carriage according to the correspondence between the sub-luggage racks and the seat numbers contained in the sub-video stream.
10. The device according to claim 7, wherein: The prompt module displays prompt information including the spatial position of the target object on a display screen on the corresponding seat number in the carriage.
11. An electronic device, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
