Image recognition scheme allocation method, device and readable storage medium
By judging the grayscale difference between two adjacent frames in the real-time video stream of the camera, the working status of the camera is determined, and the corresponding image recognition scheme is configured. This solves the problems of wasted computing performance and reduced recognition accuracy when the camera is moving or the image is abnormal, and achieves efficient image recognition results.
Patent Information
- Application Number
- CN202311354090.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-19
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-10-19
AI Technical Summary
In existing technologies, the image recognition schemes for cameras in the current technology of the devices lead to wasted computing power and reduced recognition accuracy when there is motion or abnormal image.
By judging the grayscale difference between two adjacent frames in the real-time video stream of the camera, the relative state between the images is determined, and the corresponding image recognition scheme is configured according to the state, including rotation, stillness and fine adjustment states, and close-up, far-view, static and dynamic recognition schemes are configured.
It improves the accuracy of image recognition, avoids wasting computing power, reduces the generation of abnormal data, and achieves efficient image recognition under different working conditions.
Smart Images

Figure CN117132873B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer vision technology, and in particular to an allocation method, apparatus and readable storage medium for an image recognition scheme. Background Technology
[0002] During real-time video stream analysis, cameras are typically configured with a uniform, indiscriminate image recognition scheme. Even when the camera is moving or experiencing abnormal visual conditions, the system continues to perform indiscriminate image recognition calculations. Clearly, this configuration, which disregards camera status, wastes significant computational resources and generates a large amount of abnormal data, impacting the accuracy of the analysis results.
[0003] In summary, configuring an appropriate image recognition solution based on the actual state of the camera can avoid the aforementioned shortcomings of indiscriminate analysis. Most cameras illuminate indicator lights when working. If the indicator light suddenly goes out or changes color, it may mean that the camera has been rotated or has malfunctioned. Therefore, related technologies typically determine the working status by observing the color of the camera's indicator light. However, the meanings of indicator lights vary greatly between different manufacturers and models of cameras, making it difficult to find a unified standard for judging the camera's status.
[0004] Of course, related technologies also propose inter-frame difference methods to determine the camera's state, by judging whether there are moving objects between adjacent frames to help determine the camera's rotation state. However, when encountering situations where the surface of a moving target has a large area of similar grayscale values, the above methods will produce "holes" when processing the image, affecting the accuracy of recognizing moving objects. Summary of the Invention
[0005] To address at least one of the aforementioned technical problems, this disclosure provides an image recognition scheme allocation method, apparatus, and readable storage medium.
[0006] According to one aspect of this disclosure, an image recognition scheme allocation method is proposed, comprising: determining the relative state between two adjacent frames of images based on the grayscale difference between them in a real-time video stream of an acquisition device, wherein the relative state includes consistency and difference; when the relative state is difference, analyzing feature points between the two frames of images to obtain the working state of the acquisition device, wherein the working state includes at least a rotation state, a stationary state, and a fine-tuning state; and configuring a corresponding image recognition scheme for the acquisition device based on the working state.
[0007] In some implementations, determining the relative state between two adjacent frames of images based on the grayscale difference between them in the real-time video stream of the acquisition device includes: when the grayscale difference is less than a grayscale difference threshold, determining that the relative state between the two adjacent frames is consistent; or when the grayscale difference is greater than the grayscale difference threshold, determining the attributes of a moving target between the two adjacent frames, so as to determine the relative state based on the attributes of the moving target.
[0008] In some implementations, when the grayscale difference is greater than the grayscale difference threshold, determining the attributes of a moving target between two adjacent image frames to determine the relative state based on the attributes of the moving target includes: analyzing the grayscale difference to determine the moving target and its outline in the two image frames; determining whether the outline of the moving target covers at least one of the boundary regions in the two image frames; when the outline of the moving target covers the boundary region, obtaining the attribute of the moving target as a moving object, and determining the relative state as consistent based on the attribute of the moving target as a moving object; or when the outline of the moving target does not cover the boundary region, obtaining the attribute of the moving target as the background environment of the image or the field of view of the acquisition device, and determining the relative state as different based on the attribute of the moving target as the background environment of the image or the field of view of the acquisition device.
[0009] In some implementations, the step of analyzing feature points between two frames of images to obtain the working state of the acquisition device when the relative states are different includes: analyzing feature points between two frames of images to obtain a feature point matching rate between the two frames of images when the relative states are different; analyzing the fine-tuning directions between pairs of feature points that are in corresponding positions and do not match each other in the two frames of images; and determining the working state of the acquisition device based on the feature point matching rate and each of the fine-tuning directions.
[0010] In some implementation methods, determining the working state of the acquisition device based on the feature point matching rate and each of the fine-tuning directions includes: determining the working state of the acquisition device as a rotating state when the feature point matching rate is lower than the lower limit of the matching rate; determining the working state of the acquisition device as a stationary state when the feature point matching rate is higher than the upper limit of the matching rate; and when the feature point matching rate is between the lower limit of the matching rate and the upper limit of the matching rate, statistically analyzing the fine-tuning rules among the various fine-tuning directions of the acquisition device to determine whether its working state is a fine-tuning state or a stationary state.
[0011] In some implementation methods, when the feature point matching rate is between the lower limit and the upper limit of the matching rate, the fine-tuning pattern among the various fine-tuning directions of the acquisition device is statistically analyzed to determine whether its working state is a fine-tuning state or a stationary state. This includes: when the fine-tuning pattern shows that all the fine-tuning directions are consistent, the acquisition device is determined to be in a rotational fine-tuning state or a translational fine-tuning state; when the fine-tuning pattern shows that all the fine-tuning directions point to or away from the center point of the image, the acquisition device is determined to be in a zoom-out fine-tuning state or a zoom-in fine-tuning state; and when the fine-tuning pattern shows no regular pointing, the acquisition device is determined to be in a stationary state.
[0012] In some implementation methods, the method further includes: when the working state of the acquisition device is a stationary state, determining the near-field and far-field modes of the acquisition device, wherein the near-field and far-field modes include at least a near-field mode and a far-field mode.
[0013] In some implementation methods, configuring a corresponding image recognition scheme for the acquisition device based on the working state includes: configuring a close-up static recognition scheme for the acquisition device in response to the working state being a static state and a close-up mode, wherein the close-up static recognition scheme includes at least a face recognition scheme and a license plate recognition scheme; configuring a distant static recognition scheme for the acquisition device in response to the working state being a static state and a distant view mode, wherein the distant static recognition scheme includes at least a target classification scheme and a hazard warning scheme; configuring a static recognition scheme for the acquisition device in response to the working state being a fine-tuning state; and configuring a dynamic recognition scheme for the acquisition device in response to the working state being a moving state, wherein the dynamic recognition scheme includes at least a camera linkage scheme and a target tracking scheme.
[0014] According to another aspect of this disclosure, an image recognition scheme allocation device is also proposed, comprising: an image change recognition module, configured to determine the relative state between two adjacent frames of images based on the grayscale difference between the two frames in the real-time video stream of the acquisition device, wherein the relative state includes consistency and difference; a working state determination module, configured to analyze feature points between the two frames of images when the relative state is difference, to obtain the working state of the acquisition device, wherein the working state includes at least a rotation state, a stationary state, and a fine-tuning state; and a scheme allocation module, configured to configure a corresponding image recognition scheme for the acquisition device based on the working state.
[0015] According to another aspect of this disclosure, a readable storage medium is also provided, wherein the readable storage medium stores executable instructions, which, when executed by a processor, are used to implement the allocation method of the image recognition scheme as described in any of the above embodiments.
[0016] The image recognition scheme, allocation method, and apparatus proposed in this disclosure can quickly determine the stationary state of the acquisition device by judging the relative state between two consecutive frames of images, thus avoiding the additional equipment cost of the recognition device. In addition, by calculating information such as feature point matching, the working state of the acquisition device can be accurately determined even when the acquired image is blurry. Furthermore, matching the corresponding image recognition scheme to the different working states of the acquisition device can avoid the waste of computing power caused by a "one-size-fits-all" approach, reduce the generation of abnormal data, and improve the accuracy of image recognition. Attached Figure Description
[0017] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0018] Figure 1 This is a flowchart illustrating an image recognition scheme allocation method according to an exemplary embodiment of the present disclosure;
[0019] Figure 2 This is an architecture diagram of an image recognition scheme allocation method according to an exemplary embodiment of the present disclosure;
[0020] Figure 3 A flowchart illustrating the working status determination of the data acquisition device according to an exemplary embodiment of this disclosure;
[0021] Figure 4 This is a block diagram of an image recognition scheme allocation device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0022] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0023] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.
[0025] The use of crosshairs and / or shading in the accompanying drawings is generally used to clarify the boundaries between adjacent components. Thus, unless otherwise stated, the presence or absence of crosshairs or shading does not convey or indicate any preference or requirement for the specific material, material properties, dimensions, proportions, commonalities between the illustrated components, or any other characteristics, properties, etc., of the components. Furthermore, in the accompanying drawings, the dimensions and relative dimensions of components may be exaggerated for clarity and / or descriptive purposes. When exemplary embodiments can be implemented differently, a specific process sequence may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in the reverse order of their description. Furthermore, the same reference numerals denote the same components.
[0026] When a component is referred to as being "on" or "above" another component, "connected to," or "joined to" another component, the component may be directly on, directly connected to, or directly joined to the other component, or there may be intermediate components. However, when a component is referred to as being "directly on" another component, "directly connected to," or "directly joined to" another component, there are no intermediate components. Therefore, the term "connection" can refer to a physical connection, an electrical connection, etc., and may or may not have intermediate components.
[0027] The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “the” are intended to include the plural forms as well. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values that would be recognized by one of ordinary skill in the art.
[0028] Figure 1 This is a flowchart illustrating an image recognition scheme allocation method according to an exemplary embodiment of the present disclosure; Figure 2 This is an architecture diagram of an image recognition scheme allocation method according to an exemplary embodiment of the present disclosure; Figure 3 A flowchart illustrating the working status determination of the data acquisition device according to an exemplary embodiment of this disclosure.
[0029] The following is combined Figures 1 to 3The steps of the allocation method S100 for the image recognition scheme are described in detail.
[0030] S102: Determine the relative state between two frames based on the grayscale difference between two adjacent frames in the real-time video stream of the acquisition device.
[0031] A capture device is used to record a target scene to obtain a real-time video stream. For example, a camera. Capture devices connect to multiple remote terminals and have the ability to be controlled to rotate and fine-tune; that is, the operating state of the capture device is random.
[0032] Real-time video streams are the results of acquisition devices capturing a target scene, composed of multiple frames strung together. The real-time video stream presents a different field of view depending on the operating state of the acquisition device. When the acquisition device is stationary, the field of view presented by the real-time video stream generally remains unchanged, but there may be moving objects or changes in the background environment, resulting in differences between adjacent frames. When the acquisition device is rotating, the field of view presented by the real-time video stream changes, inevitably leading to differences between adjacent frames. When the acquisition device is in a fine-tuning state, its field of view changes, again inevitably resulting in differences between adjacent frames. Clearly, different operating states of the acquisition device will cause corresponding results in the real-time video stream; therefore, a matching allocation scheme should be configured to avoid significant resource waste caused by a "one-size-fits-all" approach.
[0033] Two adjacent frames refer to any two adjacent images in a real-time video stream. By observing whether there are differences between two adjacent frames and the specific reasons for these differences, the working status of the acquisition device can be preliminarily determined. When two adjacent frames are identical, the acquisition device is necessarily in a static state; however, if there are differences, then step S104 needs to be triggered to further determine the working status of the acquisition device.
[0034] Gray-scale difference is used to characterize the difference in brightness between two adjacent frames. If the gray-scale difference is 0, it proves that the two images are the same, meaning there is no difference between them. However, real-world scenes may have interference from lighting, so a gray-scale difference threshold is pre-set. If the gray-scale difference between two frames is less than the threshold, they are considered to have no substantial change and are in a consistent state. Conversely, if the gray-scale difference is greater than the threshold, the attributes of the moving target are verified by determining whether the outline of the moving target covers at least one of the boundary regions of the two frames, thus determining the relative state between them. If the moving target is a moving object, the acquisition device is considered to be in a stationary state, and the relative state between the two frames is consistent. If the moving target is the background environment of the image or the field of view of the acquisition device, the acquisition device may be stationary, rotating, or fine-tuning. This requires further inference in step S104, and therefore the relative state between the two frames is different.
[0035] In addition, the grayscale difference is obtained through differential operations, and the grayscale difference is the absolute value of the result of the differential operation. The grayscale difference threshold is usually set to 10, but it can be set to other values as needed, and there are no restrictions here.
[0036] Relative state is used to characterize the changes between two adjacent image frames, including consistency or difference. When the relative state is consistent, it can be determined without a doubt that the acquisition device is stationary. When the grayscale difference is greater than the grayscale difference threshold, and the attribute of the moving target is the background environment of the image or the field of view of the acquisition device, further judgment is required. In this case, the relative state can be defined as difference.
[0037] Step S104: When the relative states are different, analyze the feature points between the two frames of images to obtain the working state of the acquisition device.
[0038] The operating states include rotating state, stationary state, and fine-tuning state. When the acquisition device is in different operating states, the dwell time on the same field of view varies, and the clarity of each frame of image acquired also varies. Therefore, it is necessary to first determine the operating state of the acquisition device during the recording period of two adjacent frames of images in order to assign an appropriate image recognition scheme to it.
[0039] Step S106: Based on the working status, configure the corresponding image recognition scheme for the acquisition device.
[0040] Image recognition solutions are processing and analysis methods for two or more consecutive frames of images, including target recognition, behavior recognition, hazard warning, and also camera linkage and target tracking.
[0041] When a camera is in different working states, the acquisition time and clarity of a certain field of view are different. In order to avoid the unnecessary workload caused by a "one-size-fits-all" approach, this disclosure proposes a scheme to configure image recognition according to the working state, thereby improving the image recognition accuracy when the working state of the acquisition device is random.
[0042] In some implementations, step S102 is specifically executed as follows: when the grayscale difference is less than the grayscale difference threshold, the relative state between the two frames is determined to be consistent; or when the grayscale difference is greater than the grayscale difference threshold, the attributes of the moving target between the two adjacent frames are determined, so as to determine the relative state based on the attributes of the moving target.
[0043] Specifically, when the grayscale difference is greater than the grayscale difference threshold, the relative state is determined as follows: the grayscale difference is analyzed to identify the moving target and its outline in the two frames of images; it is determined whether the outline of the moving target covers at least one of the boundary regions in the two frames of images; when the outline of the moving target covers the boundary region, the attribute of the moving target is obtained as a moving object, and the relative state is determined to be consistent based on the attribute of the moving target as a moving object; or when the outline of the moving target does not cover the boundary region, the attribute of the moving target is obtained as the background environment of the image or the field of view of the acquisition device, and the relative state is determined to be different based on the attribute of the moving target as the background environment of the image or the field of view of the acquisition device.
[0044] Specifically, the inter-frame difference method is used to determine the grayscale difference between two consecutive frames. The grayscale difference is essentially the absolute value of the result of the difference operation. By analyzing the grayscale difference, the brightness difference between the two frames can be determined, thus identifying whether they are identical or similar. After obtaining the grayscale difference, it is compared with a grayscale difference threshold. If the grayscale difference is less than the threshold, it proves that the two frames are identical or similar, and their relative state is consistent. Conversely, due to the presence of a moving target, grayscale changes will occur at the outline of the moving target. Therefore, the grayscale difference between the two frames will necessarily be greater than the grayscale difference threshold. The outline of the moving target can then be determined based on the grayscale difference. Further, it is determined whether the outline of the moving target covers at least one of the boundary regions of the two frames. If the outline of the moving target covers the boundary region, it proves that the moving target is a moving object, and the working state of the acquisition device is stationary, and the relative state between the two frames is consistent. If the outline of the moving target does not cover the boundary region, it proves that the moving target may be the background environment of the image or the field of view of the acquisition device. The working state of the acquisition device is difficult to determine, and the relative state between the two frames is set to difference, so as to make further judgments through step S104.
[0045] In some implementations, step S104 is performed as follows: when the relative states are different, the feature points between the two frames are analyzed to obtain the feature point matching rate between the two frames; the fine-tuning direction between each pair of feature points that are in the corresponding positions and do not match each other in the two frames is analyzed; and the working state of the acquisition device is determined according to the feature point matching rate and each fine-tuning direction.
[0046] Feature points are key points used to characterize the positions of key objects between images. By determining whether the same feature point is in the same position in consecutive images, the cause of the difference between two frames can be determined. If the cause is a change in the background environment, then the acquisition device is stationary; otherwise, it proves that the acquisition device is in a rotating or fine-tuning state.
[0047] The feature point matching rate is used to characterize the probability that the positions of feature points are the same between two frames of images. When the feature point matching rate is lower than the lower limit α, the working state of the acquisition device is determined to be a rotating state; when the feature point matching rate is higher than the upper limit β, the working state of the acquisition device is determined to be a stationary state; and when the feature point matching rate is between the lower limit α and the upper limit β, the fine-tuning rules between the various fine-tuning directions of the acquisition device are statistically analyzed to determine whether its working state is a fine-tuning state or a stationary state.
[0048] The fine-tuning direction refers to the direction of change between two mismatched feature points in corresponding positions. For example, if a feature point in a chronologically preceding image is closer to the image center than its corresponding feature point in a chronologically preceding image, then it proves that the fine-tuning direction of that pair of feature points points towards the image center. If the fine-tuning direction between most feature point pairs in two images points towards the image center, then it proves that there is a fine-tuning rule, and that the fine-tuning rule is that the fine-tuning direction points towards the image center, thus proving that the chronologically following image is obtained by reducing the pixel size of the chronologically following image.
[0049] Specifically, when the fine-tuning pattern shows that all fine-tuning directions are consistent, it is determined that the acquisition device is in a rotational fine-tuning state or a translational fine-tuning state; when the fine-tuning pattern shows that all fine-tuning directions point to or away from the center point of the image, it is determined that the acquisition device is in a zoom-out fine-tuning state or a zoom-in fine-tuning state; and when the fine-tuning pattern shows an irregular direction, it is determined that the acquisition device is in a stationary state, which may be due to interference from environmental factors (such as weather changes).
[0050] It should be noted that when the acquisition device is in the fine-tuning state, it is also regarded as a stationary state and the allocation is carried out according to the allocation method of the image recognition scheme in the stationary state.
[0051] The feature point matching rate and fine-tuning direction are obtained using LoFTR (Local Feature Transformers, a keypoint matching algorithm). LoFTR is a type of convolutional neural network with self-learning capabilities and excellent feature analysis performance. The LoFTR model can generate high-quality feature point matching in regions with low texture, motion blur, or blurred and repetitive images, solving the problems of inter-frame difference methods such as inability to distinguish similar background features and sensitivity to noisy data.
[0052] In some implementations, the method further includes: when the data acquisition device is in a stationary state, determining the near-field and far-field modes of the data acquisition device, wherein the near-field and far-field modes include at least a near-field mode and a far-field mode.
[0053] Specifically, the execution process of step S106 includes: in response to the working state being a static state and a close-up mode, configuring a close-up static recognition scheme for the acquisition device, wherein the close-up static recognition scheme includes at least a face recognition scheme and a license plate recognition scheme; in response to the working state being a static state and a far-up mode, configuring a far-up static recognition scheme for the acquisition device, wherein the far-up static recognition scheme includes at least a target classification scheme and a hazard warning scheme; in response to the working state being a fine-tuning state, configuring a static recognition scheme for the acquisition device; and in response to the working state being a moving state, configuring a dynamic recognition scheme for the acquisition device, wherein the dynamic recognition scheme includes at least a camera linkage scheme and a target tracking scheme.
[0054] Of course, if the acquisition device is not in a stationary or fine-tuning state, and is not in a rotating state, the frame difference method (i.e. the aforementioned difference method) is called again to determine the relative state, and other steps are executed in sequence until the working state of the acquisition device is determined.
[0055] The image recognition scheme proposed in this disclosure can quickly determine the stationary state of the acquisition device by judging the relative state between two consecutive frames of images, thus avoiding the additional equipment cost of the recognition device. In addition, by calculating relevant information such as feature point matching, it can overcome the difficulty of accurately determining the working state of the acquisition device in cases of blurred images. Furthermore, by matching the appropriate image recognition scheme to the working state of the acquisition device, it can avoid the waste of computing power caused by "one-size-fits-all" approaches, overcome the generation of abnormal data, and improve the accuracy of image recognition.
[0056] Figure 4 This is a block diagram of an image recognition scheme allocation device according to an exemplary embodiment of the present disclosure.
[0057] like Figure 4As shown, the image recognition scheme allocation device 1000 includes: an image change recognition module 1002, used to determine the relative state between two frames of images based on the grayscale difference between two adjacent frames of images in the real-time video stream of the acquisition device, wherein the relative state includes consistency and difference; a working state determination module 1004, used to analyze the feature points between the two frames of images when the relative state is difference, in order to obtain the working state of the acquisition device, wherein the working state includes at least rotation state, stationary state and fine-tuning state; and a scheme allocation module 1006, used to configure a corresponding image recognition scheme for the acquisition device based on the working state.
[0058] Each module of the image recognition scheme allocation device 1000 is set up to execute each step of the image recognition scheme allocation method. Its implementation method and principle can be referred to the foregoing and will not be repeated here.
[0059] The apparatus may include corresponding modules that perform one or more steps in the flowchart above. Therefore, each or more steps in the flowchart above may be performed by a corresponding module, and the apparatus may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform the corresponding step, or implemented by a processor 1200 configured to perform the corresponding step, or stored in a computer-readable medium for implementation by the processor 1200, or implemented by some combination thereof.
[0060] This hardware architecture can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses 1100 and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various other circuits 1400, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuitry, external antennas, etc.
[0061] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Bus 1100 can be categorized as an address bus, data bus, control bus, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or one type of bus 1100.
[0062] Any process or method description described in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. Processor 1200 performs the various methods and processes described above. For example, the method implementations of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory 1300. In some embodiments, part or all of the software program may be loaded and / or installed via memory 1300 and / or a communication interface. When the software program is loaded into memory 1300 and executed by processor 1200, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, processor 1200 may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).
[0063] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a system including processor 1200 or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0064] The image recognition scheme proposed in this disclosure can quickly determine the stationary state of the acquisition device by judging the relative state between two consecutive frames of images, thus avoiding the additional equipment cost of the recognition device. In addition, by calculating relevant information such as feature point matching, it can overcome the difficulty of accurately determining the working state of the acquisition device in cases of blurred images. Furthermore, by matching the appropriate image recognition scheme to the working state of the acquisition device, it can avoid the waste of computing power caused by "one-size-fits-all" approaches, overcome the generation of abnormal data, and improve the accuracy of image recognition.
[0065] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.
[0066] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0067] Those skilled in the art will understand that all or part of the steps of the methods described above can be implemented by a program instructing related hardware, and the program can be stored in a readable storage medium. When executed, the program includes one or a combination of the steps of the method implementation.
[0068] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0069] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A method of allocating an image recognition scheme, characterized by, The method comprises: determining a relative state between two images in a real-time video stream of a collection device according to a gray value difference between the two images, wherein the relative state comprises consistency and difference; when the relative state is difference, analyzing feature points between the two images to obtain a working state of the collection device, wherein the working state comprises a rotating state, a stationary state and a fine-tuning state; and configuring a corresponding image recognition scheme for the collection device based on the working state; when the relative state is difference, analyzing feature points between the two images to obtain a feature point matching rate between the two images; analyzing fine-tuning directions between each pair of feature points in the two images that are in corresponding positions and do not match each other; and determining the working state of the collection device according to the feature point matching rate and the fine-tuning directions; when the feature point matching rate is lower than a lower limit value of the matching rate, determining that the working state of the collection device is the rotating state; when the feature point matching rate is higher than an upper limit value of the matching rate, determining that the working state of the collection device is the stationary state; and when the feature point matching rate is between the lower limit value and the upper limit value of the matching rate, counting a fine-tuning rule between the fine-tuning directions of the collection device to determine that the working state of the collection device is the fine-tuning state or the stationary state; when the fine-tuning rule presents consistency in the fine-tuning directions, determining that the collection device is in a rotating fine-tuning state or a translating fine-tuning state; when the fine-tuning rule presents that the fine-tuning directions all point to or all point away from a center point of the images, determining that the collection device is in a zooming-in fine-tuning state or a zooming-out fine-tuning state; and when the fine-tuning rule presents no regular direction, determining that the collection device is in the stationary state. determining the relative state between two images in a real-time video stream of a collection device according to a gray value difference between the two images, comprises: when the gray value difference is less than a gray value difference threshold, determining that the relative state between the two images is consistency; or when the gray value difference is greater than the gray value difference threshold, judging an attribute of a moving target between the two images to determine the relative state according to the attribute of the moving target.
2. The method of claim 1, wherein, when the gray value difference is greater than the gray value difference threshold, judging an attribute of a moving target between the two images to determine the relative state according to the attribute of the moving target, comprises: analyzing the gray value difference to determine the moving target and its contour in the two images; 3. The method of claim 2, wherein, determining whether the contour of the moving target covers a boundary region of at least one of the two frames of images; when the contour of the moving target covers the boundary region, obtaining that the attribute of the moving target is a moving object, determining that the relative state is consistent according to that the attribute of the moving target is the moving object; or when the contour of the moving target does not cover the boundary region, obtaining that the attribute of the moving target is a background environment of the images or a field of view of the acquisition device, determining that the relative state is difference according to that the attribute of the moving target is the background environment of the images or the field of view of the acquisition device.
4. The method of claim 1, wherein, Further comprising: when the working state of the acquisition device is the stationary state, determining a close-up mode of the acquisition device, wherein the close-up mode includes a close-up mode and a long shot mode.
5. The method of claim 4, wherein, the image recognition scheme configured for the acquisition device based on the working state, including: in response to the working state being the stationary state and the close-up mode, configuring a close-up static recognition scheme for the acquisition device, wherein the close-up static recognition scheme includes a face recognition scheme and a license plate recognition scheme; in response to the working state being the stationary state and the long shot mode, configuring a long shot static recognition scheme for the acquisition device, wherein the long shot static recognition scheme includes a target classification scheme and a danger warning scheme; in response to the working state being the fine-tuning state, configuring a static recognition scheme for the acquisition device; in response to the working state being the motion state, configuring a dynamic recognition scheme for the acquisition device, wherein the dynamic recognition scheme includes a camera linkage scheme and a target tracking scheme.
6. An allocation apparatus of an image recognition scheme, characterized by, including: an image change recognition module, configured to determine a relative state between two frames of images according to a gray value difference between adjacent two frames of images in a real-time video stream of an acquisition device, wherein the relative state includes consistency and difference; a working state determination module, configured to analyze feature points between the two frames of images when the relative state is difference, to obtain a working state of the acquisition device, wherein the working state includes a rotation state, a stationary state and a fine-tuning state; and a scheme allocation module, configured to configure an image recognition scheme for the acquisition device based on the working state; when the relative state is difference, analyzing feature points between the two frames of images to obtain a working state of the acquisition device, including: when the relative state is difference, analyzing feature points between the two frames of images to obtain a feature point matching rate between the two frames of images; analyzing fine-tuning directions between each pair of feature points in corresponding positions and not matching each other in the two frames of images; and determining the working state of the acquisition device according to the feature point matching rate and each fine-tuning direction; the determination of the working state of the acquisition device according to the feature point matching rate and each fine-tuning direction, including: when the feature point matching rate is lower than a lower limit value of the matching rate, determining that the working state of the acquisition device is the rotation state; when the feature point matching rate is higher than an upper limit value of the matching rate, determining that the working state of the acquisition device is the stationary state; and When the feature point matching rate is between the matching rate lower limit value and the matching rate upper limit value, a fine adjustment rule between each fine adjustment direction of the acquisition device is counted to determine a working state of the acquisition device as a fine adjustment state or a static state; When the feature point matching rate is between the matching rate lower limit value and the matching rate upper limit value, a fine adjustment rule between each fine adjustment direction of the acquisition device is counted to determine a working state of the acquisition device as a fine adjustment state or a static state, including: When the fine adjustment rule presents as each fine adjustment direction is consistent, it is determined that the acquisition device is in a rotating fine adjustment state or a translating fine adjustment state; When the fine adjustment rule presents as each fine adjustment direction points to or is away from the center point of the image, it is determined that the acquisition device is in a zooming-in fine adjustment state or a zooming-out fine adjustment state; and When the fine adjustment rule presents as no rule direction, it is determined that the acquisition device is in a static state.
7. A readable storage medium characterized by, The readable storage medium has stored therein execution instructions, which, when executed by a processor, are used to implement the allocation method of the image recognition scheme in any one of claims 1 to 5.
Citation Information
Patent Citations
Image shooting method and device, computer readable medium and electronic equipment
CN115988340A
Medical image registration method based on LOFTR network model and improved particle swarm algorithm
CN116883462A