Image recognition method, device, storage medium and apparatus
By adopting a layered image recognition method in the smart water system, image processing functions are distributed to each layer of the architecture. Pseudocode is determined based on water operations and the target function is called to achieve local image recognition, which solves the problem of high cost and improves the system's autonomous analysis capability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN SHANGU TECH CO LTD
- Filing Date
- 2022-12-01
- Publication Date
- 2026-05-29
AI Technical Summary
In the smart water management system, real-time image recognition processing of video streams from tens of thousands of monitoring points is required, resulting in extremely high requirements for network transmission bandwidth, system storage capacity, and system computing power, which increases the platform's construction cost.
A layered image recognition method is adopted, in which various image processing functions are designed into each layer of the system architecture. The corresponding pseudocode is determined according to different water affairs operations, the target function in each layer of the system architecture is called, and it is encapsulated into the target image recognition function to realize local image recognition processing.
By using local image recognition processing, the platform's construction costs are reduced, hardware resource requirements are lowered, and the system's autonomous analysis and decision-making capabilities are enhanced.
Smart Images

Figure CN116229302B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an image recognition method, device, storage medium and apparatus. Background Technology
[0002] Smart water management systems utilize extensive video surveillance applications. Typically, surveillance cameras capture video on-site and transmit the video streams to the platform via the network. The platform then employs AI algorithms to intelligently identify abnormal events and initiate subsequent processing and responses. Performing AI image recognition on a smart water management system platform requires uploading and analyzing video streams from tens of thousands of monitoring points within the area in real time. This places extremely high demands on network bandwidth, system storage capacity, and system computing power, significantly increasing the platform's construction costs.
[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this invention is to provide an image recognition method, device, storage medium, and apparatus, which aims to solve the technical problem that the need to process tens of thousands of videos for image recognition increases the construction cost of the platform.
[0005] To achieve the above objectives, the present invention provides an image recognition method, which includes the following steps:
[0006] The corresponding pseudocode is determined according to different water affairs operations, and the target pseudocode is determined from the pseudocode according to the current water affairs operation;
[0007] The target pseudocode is parsed, and each target function is called based on the parsed target pseudocode;
[0008] Each objective function is encapsulated into a target image recognition function;
[0009] Image recognition is performed on the target waterworks operation image based on the target image recognition function.
[0010] Optionally, the target image recognition function includes: a data acquisition function, a data decoding function, an image preprocessing function, and an image recognition function;
[0011] The step of performing image recognition on the target waterworks operation image according to the target image recognition function includes:
[0012] The water management operation video is obtained based on the data acquisition function and the current water management operation.
[0013] The waterworks operation video is decoded according to the data decoding function to obtain waterworks operation images;
[0014] The waterworks operation image is preprocessed according to the image preprocessing function to obtain the target waterworks operation image;
[0015] The target waterworks operation image is recognized using the image recognition function.
[0016] Optionally, the data acquisition function is applied to the transport layer;
[0017] The step of obtaining the water operation video based on the data acquisition function and the current water operation includes:
[0018] Based on the transport layer and according to the network communication interface of the target platform, the data acquisition function of the target device is determined;
[0019] The water management operation video is obtained based on the data acquisition function and the current water management operation.
[0020] Optionally, the data decoding function is applied to the encoding / decoding layer;
[0021] The step of decoding the waterworks operation video according to the data decoding function to obtain the waterworks operation image includes:
[0022] The data decoding function is determined based on the encoding / decoding layer and according to the video stream format of the target device;
[0023] The waterworks operation video is decoded using the data decoding function to obtain waterworks operation images.
[0024] Optionally, the image preprocessing function is applied to the preprocessing layer;
[0025] The step of performing image preprocessing on the waterworks operation image according to the image preprocessing function to obtain the target waterworks operation image includes:
[0026] The image preprocessing function is determined based on the preprocessing layer and according to a preset image preprocessing method;
[0027] The waterworks operation image is preprocessed according to the image preprocessing function to obtain the target waterworks operation image.
[0028] Optionally, the image recognition function is applied to the recognition algorithm layer;
[0029] The step of performing image recognition on the target waterworks operation image according to the image recognition function includes:
[0030] Based on the aforementioned recognition algorithm layer, and according to the different waterworks operations, the corresponding image recognition function is determined;
[0031] The target image recognition function is determined from the image recognition function based on the parsed target pseudocode.
[0032] The target waterworks operation image is recognized using the target image recognition function.
[0033] Optionally, the pseudocode is applied to the application layer;
[0034] The step of determining the corresponding pseudocode based on different waterworks operations includes:
[0035] The first pseudocode is determined based on the application layer and according to the data acquisition function, the data decoding function, and the image preprocessing function;
[0036] Based on the application layer and according to the image recognition function corresponding to the different water affairs operations, each second pseudocode is determined;
[0037] The pseudocode is determined based on the application layer and according to the first pseudocode and each of the second pseudocodes.
[0038] Furthermore, to achieve the above objectives, the present invention also proposes an image recognition device, which includes a memory, a processor, and an image recognition program stored in the memory and capable of running on the processor, the image recognition program being configured to implement the image recognition method as described above.
[0039] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing an image recognition program, which, when executed by a processor, implements the image recognition method as described above.
[0040] Furthermore, to achieve the above objectives, the present invention also proposes an image recognition device, which includes: a code determination module, a function determination module, a function encapsulation module, and an image recognition module;
[0041] The code determination module is used to determine the corresponding pseudocode according to different water affairs operations, and to determine the target pseudocode from the pseudocode according to the current water affairs operation;
[0042] The function determination module is used to parse the target pseudocode and call each target function according to the parsed target pseudocode;
[0043] The function encapsulation module is used to encapsulate each target function into a target image recognition function.
[0044] This invention discloses an image recognition method, device, storage medium, and apparatus. The method includes:
[0045] This invention determines corresponding pseudocode based on different water affairs operations, and then identifies the target pseudocode from the pseudocode based on the current water affairs operation. The target pseudocode is parsed, and each target function is called based on the parsed target pseudocode. Each target function is then encapsulated into a target image recognition function. Finally, the target image of the water affairs operation is recognized using the target image recognition function. In the layered design of the system, each layer of the architecture has a corresponding target function. Based on the current water affairs operation, the corresponding target pseudocode is determined, and the target functions in each layer of the architecture are called according to the target pseudocode. The called target functions are then encapsulated into a target image recognition function in the order of their calls. The target image recognition function then performs image recognition on the target water affairs operation image. Therefore, the platform only needs to analyze the image recognition results, reducing the platform's construction costs. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the structure of an image recognition device in the hardware operating environment involved in the embodiments of the present invention;
[0047] Figure 2 This is a flowchart illustrating the first embodiment of the image recognition method of the present invention;
[0048] Figure 3 This is a flowchart illustrating the second embodiment of the image recognition method of the present invention;
[0049] Figure 4 This is a flowchart illustrating the third embodiment of the image recognition method of the present invention;
[0050] Figure 5 This is a pseudocode call flowchart for an embodiment of the image recognition method of the present invention, showing the discharge outlet sewage discharge and flow detection.
[0051] Figure 6 This is a system architecture diagram of an embodiment of the image recognition method of the present invention;
[0052] Figure 7 This is a structural block diagram of the first embodiment of the image recognition device of the present invention.
[0053] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0054] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0055] Reference Figure 1 , Figure 1This is a schematic diagram of the image recognition device structure in the hardware operating environment involved in the embodiments of the present invention.
[0056] like Figure 1 As shown, the image recognition device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface or a wireless interface. In this invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0057] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the image recognition device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0058] like Figure 1 As shown, the memory 1005, which is identified as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an image recognition program.
[0059] exist Figure 1 In the image recognition device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the user equipment; the image recognition device calls the image recognition program stored in the memory 1005 through the processor 1001 and executes the image recognition method provided in the embodiment of the present invention.
[0060] Based on the above hardware structure, embodiments of the image recognition method of the present invention are proposed.
[0061] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the image recognition method of the present invention, which presents the first embodiment of the image recognition method of the present invention.
[0062] Step S10: Determine the corresponding pseudocode according to different water affairs operations, and determine the target pseudocode from the pseudocode according to the current water affairs operation.
[0063] It should be noted that the executing entity in this embodiment may be a computer software service device with data processing, network communication and program running functions, such as an image recognition device, or other electronic devices that can achieve the same or similar functions. This embodiment does not limit this.
[0064] It should be understood that in existing smart water solutions, the application of artificial intelligence technology is mainly concentrated on the platform: that is, through the integration of all-element monitoring data and the platformization of water data, artificial intelligence big data analysis and online real-time simulation analysis are carried out on the platform to realize online management of facilities and equipment of the water management system, full-process control of safe production, and intelligent identification of abnormal events, thereby establishing a dynamic monitoring and intelligent management model with full chain, full process and full coverage.
[0065] The advancement of artificial intelligence (AI) technology is rapid. With increasingly mature development tools and environments, coupled with continuously improving chip performance, AI algorithms can now be directly applied to embedded devices, using trained models to perform inferences and realize various intelligent applications. Furthermore, training models is becoming increasingly easier, with some companies and technology research firms even launching DIY model training platforms. The integration of AI into embedded devices has become an inevitable trend. Embedded AI extends artificial intelligence from the cloud to the device and edge, finding widespread application in smart homes, mobile robots, and industrial manufacturing.
[0066] Smart water management systems utilize extensive video surveillance applications. Typically, surveillance cameras capture video on-site and transmit the video streams to the platform via the network. The platform then employs AI algorithms to intelligently identify abnormal events and initiate subsequent processing and responses. Performing AI image recognition on a smart water management system platform requires uploading and analyzing video streams from tens of thousands of monitoring points within the area in real time. This places extremely high demands on network bandwidth, system storage capacity, and system computing power, significantly increasing the platform's construction costs.
[0067] To overcome the above-mentioned shortcomings, this embodiment designs various functions that require image processing into each layer of the system architecture when designing the system in layers. It also determines the corresponding pseudocode according to different water affairs operations, determines the target pseudocode corresponding to the current water affairs operation from various pseudocodes, calls the target function in each layer of the system architecture according to the target pseudocode, and encapsulates the target function in the target image recognition function. The target image recognition function is then used to recognize the target water affairs operation image.
[0068] It's important to note that developing embedded AI applications is an extremely complex undertaking. Developers need to comprehensively consider factors such as processor selection, neural network model design, optimization, and deployment to effectively address numerous performance requirements and limitations related to computing power and power consumption. Furthermore, the fragmented application scenarios naturally generate a large number of non-standard demands, often requiring customized solutions. This presents significant challenges to the technological innovation and large-scale deployment of embedded AI. In the smart water management field, embedded application development faces this typical small-batch, high-variety market, which is the fundamental reason why existing smart water management systems primarily apply AI on platform-based systems. This embodiment utilizes embedded AI to bring artificial intelligence down from the cloud platform to the device and edge, enabling local image recognition and processing at each monitoring point, achieving local intelligence at these points. Meanwhile, the platform invests more hardware resources in comprehensive big data analysis and processing, becoming the "brain" of the entire system with self-analysis, self-decision-making, and self-optimization capabilities—a superior technological approach.
[0069] It is understandable that there are many types of water management operations. Therefore, the videos obtained by the monitoring cameras are different depending on the type of water management operation. So, in order to process the images corresponding to these videos, it is necessary to design pseudocodes for various water management operations and match them with the water management operation that needs to be processed to obtain the target pseudocode corresponding to the current water management operation.
[0070] Understandably, the system only needs to write pseudocode at the application layer to make simple calls to the underlying layer. It can dynamically generate the system execution code required by a specific application and compile it into the final running program, thus reducing the complexity of application development.
[0071] Step S20: Parse the target pseudocode and call each target function according to the parsed target pseudocode.
[0072] It should be noted that in order to dynamically generate executable code after the pseudocode is written, a scripting software needs to be developed that can dynamically generate the final executable code required to implement the application functions based on the calling statements of the pseudocode.
[0073] In the specific implementation, a new executable code file is created to parse the target pseudocode. Based on the parsed pseudocode, the target function and its corresponding parameters are called, and the source code of the calling function is extracted from the source code file of the corresponding layer of each target function.
[0074] It should be noted that each objective function can be a data acquisition function driving the surveillance camera in the transport layer; a data decoding function decoding the video in the encoding / decoding layer; an image preprocessing function performing preprocessing operations on the image in the preprocessing layer; or an image recognition function performing image feature extraction and recognition in the algorithm recognition layer.
[0075] Step S30: Encapsulate each objective function into a target image recognition function.
[0076] Understandably, the pseudocode is written according to the image recognition process, and therefore the functions called are also called sequentially according to the image recognition process. The target functions called sequentially are encapsulated within the image recognition function.
[0077] Understandably, the target image recognition function is the complete executable code required for image recognition. The target image recognition function can be downloaded to the embedded hardware platform to ultimately complete the development of embedded artificial intelligence image recognition applications for specific application needs.
[0078] Step S40: Perform image recognition on the target waterworks operation image according to the target image recognition function.
[0079] It should be noted that the video of the current waterworks operation is obtained by acquiring the video of the current waterworks operation through the surveillance camera, and the video of the current waterworks operation is decoded to obtain the target waterworks operation image corresponding to the video of the current waterworks operation.
[0080] This embodiment determines corresponding pseudocode based on different water affairs operations, and identifies target pseudocode from the pseudocode based on the current water affairs operation; it parses the target pseudocode and calls each target function based on the parsed target pseudocode; it encapsulates each target function into a target image recognition function; and it performs image recognition on the target water affairs operation image based on the target image recognition function. In the layered design of the system, this invention designs corresponding target functions for each layer of the system architecture, determines the corresponding target pseudocode based on the current water affairs operation, and calls the target functions in each layer of the system architecture based on the target pseudocode. The called target functions are encapsulated into a target image recognition function according to the calling order. The target image recognition function then performs image recognition on the target water affairs operation image, thus the platform only needs to analyze the image recognition results, reducing the platform's construction costs.
[0081] Reference Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the image recognition method of the present invention, based on the above. Figure 2 The first embodiment shown is followed by a second embodiment of the image recognition method of the present invention.
[0082] In the second embodiment, step S40 includes:
[0083] Step S401: Obtain the water operation video according to the data acquisition function and the current water operation.
[0084] It's important to note that in its layered design, the system shares common functional requirements across fragmented application scenarios at the bottom layer, while relocating unique, customized requirements specific to those scenarios to higher layers. Different application scenarios can share the underlying functionalities, requiring only the development of differentiated recognition algorithms and applications. Code related to embedded hardware platform interface calls is implemented at the bottom layer. To migrate applications across different hardware platforms, only the underlying interface call code needs modification, facilitating rapid system portability for application development.
[0085] It should be noted that building a development system first requires selecting an embedded hardware platform. This platform must use an ARM-based embedded low-power processor with a built-in GPU, be able to run a Linux kernel-based operating system, and be compatible with video stream decoding from surveillance cameras, such as Rockchip's RK3399. Next, a source code file is created for each layer to form a code library.
[0086] It is understood that this embodiment mainly includes a layered code library; the system code library is divided into five layers according to function, from the bottom layer to the top layer, namely the transmission layer, encoding and decoding layer, preprocessing layer, recognition algorithm layer, and application layer. Each layer completes a certain function and directly provides services to the layer above it, and all layers support each other.
[0087] Furthermore, in order to reduce hardware performance requirements and costs, step S401 of this embodiment may include:
[0088] Based on the transport layer and according to the network communication interface of the target platform, the data acquisition function of the target device is determined;
[0089] The water management operation video is obtained based on the data acquisition function and the current water management operation.
[0090] Understandably, the data acquisition function is applied in the system's transport layer, which is used to access the monitoring camera, acquire water operation videos, and transmit equipment status and image recognition results to the intelligent water management platform.
[0091] It should be noted that, at the transport layer, based on the network communication interface of the hardware platform, network driver code for the monitoring camera is written to realize the function of the transport layer to acquire video streams from the monitoring system camera; based on the network communication interface of the smart water management system platform, code for interacting with the management system platform is written to realize data communication with the management system platform.
[0092] It should be understood that, based on the current waterworks operation, the data acquisition function of the transport layer can drive the camera monitoring the current waterworks operation to acquire waterworks operation video.
[0093] Step S402: Decode the waterworks operation video according to the data decoding function to obtain the waterworks operation image.
[0094] Understandably, the data decoding function is applied to the encoding / decoding layer, which is mainly used for real-time decoding of waterworks operation videos.
[0095] Furthermore, in order to reduce hardware performance requirements and costs, step S401 of this embodiment may include:
[0096] The data decoding function is determined based on the encoding / decoding layer and according to the video stream format of the target device;
[0097] The waterworks operation video is decoded using the data decoding function to obtain waterworks operation images.
[0098] It should be noted that at the codec layer, code is written to decode the video stream according to the video stream format of the surveillance camera. This should include decoding of mainstream surveillance camera video encoding types such as H.264 and H.265.
[0099] Step S403: Perform image preprocessing on the waterworks operation image according to the image preprocessing function to obtain the target waterworks operation image.
[0100] It should be noted that the image preprocessing function is applied in the preprocessing layer. The preprocessing layer mainly performs preprocessing on the decoded image, including grayscale conversion and binarization, image enhancement, and image noise reduction.
[0101] Furthermore, in order to reduce hardware performance requirements and costs, step S401 of this embodiment may include:
[0102] The image preprocessing function is determined based on the preprocessing layer and according to a preset image preprocessing method;
[0103] The waterworks operation image is preprocessed according to the image preprocessing function to obtain the target waterworks operation image.
[0104] It should be noted that various image preprocessing functions are written in the preprocessing layer to perform image preprocessing on the water operation images. The functions of the image preprocessing functions include grayscale conversion, binarization, and common image enhancement and noise reduction methods. The image enhancement methods mainly include grayscale transformation, image smoothing, and image sharpening, while the noise reduction methods mainly include spatial domain filtering and frequency domain filtering.
[0105] Step S404: Perform image recognition on the target waterworks operation image according to the image recognition function.
[0106] It should be noted that the image recognition function is applied in the recognition algorithm layer. Different image recognition functions are used in the recognition algorithm layer for different water affairs operations. The corresponding image recognition function is determined based on the current water affairs operation to perform image recognition on the target water affairs operation.
[0107] Furthermore, in order to reduce hardware performance requirements and costs, step S401 of this embodiment may include:
[0108] Based on the aforementioned recognition algorithm layer, and according to the different waterworks operations, the corresponding image recognition function is determined;
[0109] The target image recognition function is determined from the image recognition function based on the parsed target pseudocode.
[0110] The target waterworks operation image is recognized using the target image recognition function.
[0111] It is understandable that waterworks operations may include surface water detection, pipeline leakage detection, pump pit overflow detection, outlet sewage detection, outlet flow detection, floating object detection, water flow velocity detection, and water level recognition. Should we determine the corresponding image recognition function based on different waterworks operations? For example, can we write a surface water detection function based on the waterworks operation of surface water detection?
[0112] It is understandable that the target pseudocode contains the functions that need to be called for the current water treatment operation, and the target image function corresponding to the current water treatment operation is determined from the image recognition function through the target pseudocode.
[0113] It should be noted that the recognition algorithm layer can be extended according to user needs, that is, new functions can be continuously written based on user requirements.
[0114] This embodiment acquires waterworks operation video based on the data acquisition function and the current waterworks operation; decodes the waterworks operation video using the data decoding function to obtain a waterworks operation image; preprocesses the waterworks operation image using the image preprocessing function to obtain a target waterworks operation image; and performs image recognition on the target waterworks operation image using the image recognition function. This embodiment acquires waterworks video from a monitoring camera using a data acquisition function designed in the transmission layer, decodes the waterworks video using a data encoding / decoding function designed in the encoding / decoding layer to obtain a waterworks operation image, preprocesses the waterworks operation image using an image preprocessing function designed in the preprocessing layer, and designs different image recognition functions in the recognition algorithm layer. Based on the target image recognition function corresponding to the waterworks operation, the preprocessed waterworks operation image is recognized. By designing shared functional requirements at the lower level of the system and different scenario functional requirements at the higher level, the same underlying functions can be called for functional requirements in different scenarios, thereby reducing the complexity of customized development for non-standard requirements, as well as the performance requirements and costs of the hardware.
[0115] Reference Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the image recognition method of the present invention, based on the above. Figure 2 The first embodiment shown is followed by a third embodiment of the image recognition method of the present invention.
[0116] In the third embodiment, step S10 includes:
[0117] Step S101: Determine the first pseudocode based on the application layer and according to the data acquisition function, the data decoding function and the image preprocessing function.
[0118] It should be noted that at the application layer, based on the actual application scenario's requirements for AI recognition, the communication interface between the embedded hardware platform and the management system platform, and the video stream encoding format of the surveillance camera, corresponding functions from the aforementioned layers are selected. Pseudocode is then written to call these functions sequentially, thus implementing a complete AI image recognition application function. For ease of understanding, refer to... Figure 5 To explain, Figure 5 The pseudocode call flowchart for discharge outlet sewage discharge and flow detection is as follows: First, the video stream (IP + port) is acquired. Second, the video stream is decoded according to the H.265 video encoding type of the monitoring camera to obtain the image. Then, the image is preprocessed by binarization, sharpening, and high-pass filtering. Next, the image is subjected to discharge outlet sewage discharge detection and discharge outlet flow detection to obtain the sewage discharge image and flow marker artificial intelligence image recognition results. Finally, the artificial intelligence image recognition results are transmitted.
[0119] It is understandable that the data acquisition function, data decoding function, and image preprocessing function will not change due to different water management operations. Therefore, the data acquisition function, data decoding function, and image preprocessing function can be written as a first pseudocode that can be used repeatedly without having to write it every time.
[0120] Step S102: Determine each second pseudocode based on the application layer and according to the image recognition function corresponding to the different water affairs operations.
[0121] It should be noted that the second pseudocode requires different image recognition functions depending on the different water treatment operations. Therefore, the second pseudocode contains pseudocodes for various image recognition functions, and the corresponding pseudocode needs to be determined for each water treatment operation.
[0122] Step S103: Determine the pseudocode based on the application layer and according to the first pseudocode and each of the second pseudocodes.
[0123] It should be understood that each time a waterworks operation is performed, only the second pseudocode part needs to be modified, without modifying the first pseudocode part.
[0124] For ease of understanding, please refer to Figure 6 To explain, Figure 6 This is a diagram of an image recognition system architecture. The diagram includes a transmission layer, a decoding layer, a preprocessing layer, a recognition algorithm layer, and an application layer. The transmission layer acquires video streams from cameras and transmits AI image recognition results. The decoding layer decodes video streams and transmits AI image recognition results, supporting mainstream surveillance camera video encoding types such as H.264, H.265, M-JPEG, and MPEG4. The preprocessing layer performs image processing such as grayscale conversion, binarization, image enhancement (grayscale changes, image smoothing, image sharpening, etc.), and noise reduction (spatial domain filtering and frequency domain filtering). The recognition algorithm layer performs functions such as ground water accumulation detection, pipe leakage detection, pump overflow detection, sewage discharge detection, discharge flow rate detection, floating object detection, water flow velocity detection, water level recognition detection, and water flow color detection. The application layer allows for the writing of pseudocode to call processes based on specific scenario functional requirements.
[0125] This embodiment determines the first pseudocode based on the application layer and according to the data acquisition function, the data decoding function, and the image preprocessing function; it determines each second pseudocode based on the application layer and according to the image recognition functions corresponding to different waterworks operations; and it determines the pseudocode based on the application layer and according to the first pseudocode and each second pseudocode. This embodiment determines the first pseudocode based on the data acquisition function, the data decoding function, and the image preprocessing function, and determines each second pseudocode based on the image recognition functions corresponding to different waterworks operations. Each time, only the corresponding second pseudocode needs to be determined based on the waterworks operation, and then the system functions at each layer are called in combination with the first and second pseudocodes, thereby improving development efficiency.
[0126] Furthermore, this embodiment of the invention also proposes a storage medium storing an image recognition program, which, when executed by a processor, implements the image recognition method as described above.
[0127] In addition, refer to Figure 7 The present invention also proposes an image recognition device, which includes: a code determination module 10, a function determination module 20, a function encapsulation module 30, and an image recognition module 40;
[0128] The code determination module 10 is used to determine the corresponding pseudocode according to different water affairs operations, and to determine the target pseudocode from the pseudocode according to the current water affairs operation;
[0129] The function determination module 20 is used to parse the target pseudocode and call each target function according to the parsed target pseudocode;
[0130] The function encapsulation module 30 is used to encapsulate each target function into a target image recognition function;
[0131] The image recognition module 40 is used to perform image recognition on the target waterworks operation image according to the target image recognition function.
[0132] This embodiment determines corresponding pseudocode based on different water affairs operations, and identifies target pseudocode from the pseudocode based on the current water affairs operation; it parses the target pseudocode and calls each target function based on the parsed target pseudocode; it encapsulates each target function into a target image recognition function; and it performs image recognition on the target water affairs operation image based on the target image recognition function. In the layered design of the system, this invention designs corresponding target functions for each layer of the system architecture, determines the corresponding target pseudocode based on the current water affairs operation, and calls the target functions in each layer of the system architecture based on the target pseudocode. The called target functions are encapsulated into a target image recognition function according to the calling order. The target image recognition function then performs image recognition on the target water affairs operation image, thus the platform only needs to analyze the image recognition results, reducing the platform's construction costs.
[0133] Based on the first embodiment of the image recognition device of the present invention described above, a second embodiment of the image recognition device of the present invention is proposed.
[0134] In this embodiment, the image recognition module 40 is used to acquire water operation video based on the data acquisition function and the current water operation.
[0135] Furthermore, the image recognition module 40 is also used to decode the waterworks operation video according to the data decoding function to obtain a waterworks operation image.
[0136] Furthermore, the image recognition module 40 is also used to perform image preprocessing on the waterworks operation image according to the image preprocessing function to obtain the target waterworks operation image.
[0137] Furthermore, the image recognition module 40 is also used to perform image recognition on the target waterworks operation image according to the image recognition function.
[0138] Furthermore, the image recognition module 40 is also used to determine the data acquisition function of the target device based on the transport layer and according to the network communication interface of the target platform.
[0139] Furthermore, the image recognition module 40 is also used to acquire water operation video based on the data acquisition function and the current water operation.
[0140] Furthermore, the image recognition module 40 is also used to determine the data decoding function based on the codec layer and according to the video stream format of the target device.
[0141] Furthermore, the image recognition module 40 is also used to decode the waterworks operation video according to the data decoding function to obtain a waterworks operation image.
[0142] Furthermore, the image recognition module 40 is also used to determine the image preprocessing function based on the preprocessing layer and according to a preset image preprocessing method.
[0143] Furthermore, the image recognition module 40 is also used to perform image preprocessing on the waterworks operation image according to the image preprocessing function to obtain the target waterworks operation image.
[0144] Furthermore, the image recognition module 40 is also used to determine the corresponding image recognition function based on the recognition algorithm layer and according to the different water affairs operations.
[0145] Furthermore, the image recognition module 40 is also used to determine the target image recognition function from the image recognition function based on the parsed target pseudocode.
[0146] Furthermore, the image recognition module 40 is also used to perform image recognition on the target waterworks operation image according to the target image recognition function.
[0147] Furthermore, the code determination module 10 is also used to determine the first pseudocode based on the application layer and according to the data acquisition function, the data decoding function and the image preprocessing function.
[0148] Furthermore, the code determination module 10 is also used to determine each second pseudocode based on the application layer and according to the image recognition function corresponding to the different water affairs operations.
[0149] Furthermore, the code determination module 10 is also used to determine the pseudocode based on the application layer and according to the first pseudocode and each of the second pseudocodes.
[0150] Other embodiments or specific implementations of the image recognition device described in this invention can be found in the above-described method embodiments, and will not be repeated here.
[0151] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0152] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0154] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An image recognition method, characterized in that, The image recognition method includes the following steps: The corresponding pseudocode is determined according to different water affairs operations, and the target pseudocode is determined from the pseudocode according to the current water affairs operation. The target pseudocode contains the function that needs to be called for the current water affairs operation. The target pseudocode is parsed, and each target function is called based on the parsed target pseudocode; Each objective function is encapsulated into a target image recognition function, which is then called sequentially according to the image recognition process. Image recognition is performed on the target waterworks operation image according to the target image recognition function; The target image recognition function includes: a data acquisition function, a data decoding function, an image preprocessing function, and an image recognition function; The step of performing image recognition on the target waterworks operation image according to the target image recognition function includes: The water management operation video is obtained based on the data acquisition function and the current water management operation. The waterworks operation video is decoded according to the data decoding function to obtain waterworks operation images; The waterworks operation image is preprocessed according to the image preprocessing function to obtain the target waterworks operation image; The target waterworks operation image is recognized using the image recognition function.
2. The image recognition method as described in claim 1, characterized in that, The data acquisition function is applied to the transport layer; The step of obtaining the water operation video based on the data acquisition function and the current water operation includes: Based on the transport layer and according to the network communication interface of the target platform, the data acquisition function of the target device is determined. The water management operation video is obtained based on the data acquisition function and the current water management operation.
3. The image recognition method as described in claim 2, characterized in that, The data decoding function is applied to the encoding / decoding layer; The step of decoding the waterworks operation video according to the data decoding function to obtain the waterworks operation image includes: The data decoding function is determined based on the encoding / decoding layer and according to the video stream format of the target device; The waterworks operation video is decoded using the data decoding function to obtain waterworks operation images.
4. The image recognition method as described in claim 1, characterized in that, The image preprocessing function is applied to the preprocessing layer; The step of performing image preprocessing on the waterworks operation image according to the image preprocessing function to obtain the target waterworks operation image includes: The image preprocessing function is determined based on the preprocessing layer and according to a preset image preprocessing method; The waterworks operation image is preprocessed according to the image preprocessing function to obtain the target waterworks operation image.
5. The image recognition method as described in claim 1, characterized in that, The image recognition function is applied to the recognition algorithm layer; The step of performing image recognition on the target waterworks operation image according to the image recognition function includes: Based on the aforementioned recognition algorithm layer, and according to the different waterworks operations, the corresponding image recognition function is determined; The target image recognition function is determined from the image recognition function based on the parsed target pseudocode. The target waterworks operation image is recognized using the target image recognition function.
6. The image recognition method according to any one of claims 1 to 5, characterized in that, The pseudocode is applied to the application layer; The step of determining the corresponding pseudocode based on different waterworks operations includes: The first pseudocode is determined based on the application layer and according to the data acquisition function, the data decoding function, and the image preprocessing function; Based on the application layer and according to the image recognition function corresponding to the different water affairs operations, each second pseudocode is determined; The pseudocode is determined based on the application layer and according to the first pseudocode and each of the second pseudocodes.
7. An image recognition device, characterized in that, The image recognition device includes: a memory, a processor, and an image recognition program stored in the memory and executable on the processor, wherein the image recognition program, when executed by the processor, implements the steps of the image recognition method as described in any one of claims 1 to 6.
8. A storage medium, characterized in that, The storage medium stores an image recognition program, which, when executed by a processor, implements the steps of the image recognition method as described in any one of claims 1 to 6.
9. An image recognition device, characterized in that, The image recognition device includes: a code determination module, a function determination module, a function encapsulation module, and an image recognition module; The code determination module is used to determine the corresponding pseudocode according to different water affairs operations, and to determine the target pseudocode from the pseudocode according to the current water affairs operation. The target pseudocode contains the function that needs to be called for the current water affairs operation. The function determination module is used to parse the target pseudocode and call each target function according to the parsed target pseudocode; The function encapsulation module is used to encapsulate each target function into a target image recognition function, and the target function is called sequentially according to the image recognition process; The image recognition module is used to perform image recognition on the target waterworks operation image according to the target image recognition function; The target image recognition function includes: a data acquisition function, a data decoding function, an image preprocessing function, and an image recognition function; The image recognition module is further configured to: acquire a water operation video based on the data acquisition function and the current water operation; decode the water operation video based on the data decoding function to obtain a water operation image; perform image preprocessing on the water operation image based on the image preprocessing function to obtain a target water operation image; and perform image recognition on the target water operation image based on the image recognition function.