Image recognition method, device, equipment and medium
Through multi-camera shooting and splicing and fusion processing, the problem of image distortion caused by adjusting the focus of a single camera is solved, the image recognition rate is improved, the hardware parameter design requirements are reduced, and a more efficient image recognition effect is achieved.
Patent Information
- Application Number
- CN202111316119.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-11-08
AI Technical Summary
When the existing technology improves the image recognition range by adjusting the shooting focal length of a single camera, it will cause large image distortion, affect the recognition rate, and impose high design requirements on camera hardware parameters.
Multiple cameras are used to shoot simultaneously and perform splicing and fusion processing to expand the field of view of the image, reduce the design requirements for camera hardware parameters, and improve the image recognition rate.
Through the cooperation of multiple cameras, the image field of view is expanded, the image shooting quality is ensured, the image recognition rate is improved, and the difficulty of designing camera hardware parameters is reduced.
Smart Images

Figure CN114022662B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image recognition method, device, equipment and medium. Background Art
[0002] Generally, in a recognition scenario such as optical character recognition (OCR) on an image, an image of an object to be recognized is captured by a camera, and recognition is performed based on the image. The field of view of the captured image limits the image recognition range.
[0003] In the related art, an image is acquired by shooting an object to be identified with a single camera, and the shooting field of view of the camera is improved by adjusting the shooting focal length of the single camera, thereby improving the image recognition range.
[0004] However, the above method of improving the shooting field of view by adjusting the shooting focal length not only has high design requirements on the hardware parameters of the camera, but also causes large distortion of the image shooting, thereby affecting the recognition rate of the image. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an image recognition method, device, equipment and medium, thereby expanding the field of view of the captured image based on the selection and cooperation of multiple cameras, with low design requirements for the hardware parameters of the camera. On the basis of expanding the range of the captured image, the image capture quality is guaranteed, which further facilitates improving the image recognition rate.
[0006] The present disclosure provides an image recognition method, the method comprising:
[0007] In response to a request for photographing and identifying a target object, controlling a plurality of predetermined target cameras in the camera module to simultaneously photograph the target object to obtain a plurality of candidate images;
[0008] The multiple candidate images are spliced and fused to obtain a target image, and image recognition processing is performed based on the target image.
[0009] The disclosed embodiment also provides an image recognition device, which includes: a shooting module, which is used to respond to a shooting and recognition request for a target object, control a plurality of target cameras predetermined in a camera module to simultaneously shoot the target object to obtain a plurality of candidate images; a recognition module, which is used to splice and fuse the plurality of candidate images to obtain a target image, and perform image recognition processing based on the target image.
[0010] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the image recognition method provided by the embodiment of the present disclosure.
[0011] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the image recognition method provided by the embodiment of the present disclosure.
[0012] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0013] The image recognition solution provided by the embodiment of the present disclosure, in response to a request to shoot a target object, determines multiple target cameras associated with the required imaging field angle from multiple candidate cameras spaced apart in the camera module, controls the multiple target cameras in the camera module to simultaneously shoot the target object to obtain multiple candidate images, and then splices and fuses the multiple candidate images to obtain the target image, and performs image recognition processing based on the target image. Thus, based on the selection and coordination of multiple cameras to expand the field of view of the captured image, the design requirements for the hardware parameters of the camera are relatively low, and on the basis of expanding the range of the captured image, the image shooting quality is guaranteed, which further facilitates the improvement of the image recognition rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0015] Figure 1 A flowchart of an image recognition method provided by an embodiment of the present disclosure;
[0016] FIG. 2( a ) is a schematic diagram of a camera arrangement of a camera module provided in an embodiment of the present disclosure;
[0017] FIG2( b ) is a schematic diagram of camera arrangement of another camera module provided in an embodiment of the present disclosure;
[0018] Figure 3 A schematic diagram of an application scenario of a camera module provided by an embodiment of the present disclosure;
[0019] Figure 4 A schematic diagram of a field of view angle range provided in an embodiment of the present disclosure;
[0020] Figure 5A schematic diagram of another field of view angle range provided for an embodiment of the present disclosure;
[0021] Figure 6 A flowchart of another image recognition method provided by an embodiment of the present disclosure;
[0022] Figure 7 A flowchart of another image recognition method provided by an embodiment of the present disclosure;
[0023] Figure 8 A schematic diagram of an image recognition scenario provided by an embodiment of the present disclosure;
[0024] FIG9( a ) is a schematic diagram of another image recognition scenario provided by an embodiment of the present disclosure;
[0025] FIG9( b ) is a schematic diagram of another image recognition scenario provided by an embodiment of the present disclosure;
[0026] Fig.10 A schematic diagram of the structure of an image recognition device provided by an embodiment of the present disclosure;
[0027] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] In order to solve the above-mentioned problem that in order to improve the image recognition rate, increasing the shooting field of view by means of changing the shooting focal length of the camera, etc. may cause large image distortion, thereby reducing the image recognition rate, the embodiment of the present disclosure provides an image recognition method, in which the field of view is expanded based on the selection and coordination of multiple cameras, rather than by means of changing the focal length of the camera, etc., thereby reducing the restrictions on the hardware parameters of the camera. Since the shooting field of view of multiple cameras is larger than that of a single camera, it has a significant effect on improving the image recognition rate.
[0035] The method is introduced below in conjunction with specific embodiments.
[0036] Figure 1 The following is a flow chart of an image recognition method provided by an embodiment of the present disclosure. The method can be executed by an image recognition device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:
[0037] Step 101 , in response to a request for photographing and identifying a target object, a plurality of predetermined target cameras in a camera module are controlled to simultaneously photograph the target object to obtain a plurality of candidate images.
[0038] It can be understood that the camera module in this embodiment includes multiple cameras, and the multiple cameras and the plane where the target object is located can be arranged at intervals in the same plane (as shown in FIG. 2(a)), or can be arranged at intervals in different planes (as shown in FIG. 2(b)), wherein the intervals between the cameras arranged at intervals can be the same or different. In some possible embodiments, for example, Figure 3As shown, the camera module can be set in an image recognition device, on which the camera module and an object placement element (which can be a desktop, etc.) are set. The object placement element carries the target object to be identified, and the camera module faces the object placement element to facilitate shooting of the corresponding target object.
[0039] In this embodiment, the target object's imaging required field of view relative to the camera module is obtained, which can be understood as the field of view corresponding to the imaging range that can be completely photographed for the target object, or the field of view corresponding to the imaging range that can be completely photographed for the identified part of the target object. The single-camera standard field of view threshold can be understood as the field of view range for clear imaging of a single camera within the imaging range of the camera module, or the field of view range for clear imaging under the default shooting mode. For a single camera, the camera of the camera module is taken as the vertex, and the angle range formed by the two edges of the maximum range of the captured object that can pass through the lens is taken as the field of view, such as Figure 4 As shown, the field of view angle range limits the area where clear imaging can be achieved. When the photographed object exceeds the standard field of view angle threshold of a single camera, the corresponding single camera cannot capture the corresponding area and form an image. This is because for a single camera, if the field of view angle is expanded by adjusting the relevant hardware modules of the camera to capture images, the pixel value per unit area of the captured image will be reduced, and even the captured image will be distorted, thereby affecting the OCR recognition rate of the captured image. Therefore, this method of expanding the field of view angle of a single camera to capture images requires increasing the image sensor pixels of the single camera to increase the pixel value per unit area of the image. At the same time, image distortion elimination calculations are required to dedistort the captured image, which increases the difficulty of designing and manufacturing single cameras, as well as the difficulty of subsequent algorithm calculations.
[0040] It should be noted that the single camera corresponding to the single-camera standard field of view angle threshold can be any camera in the camera module, or it can be pre-selected based on the camera with the largest field of view angle at each shooting distance. Therefore, in this embodiment, the field of view angle corresponding to the camera with the largest shooting distance and corresponding shooting field of view angle at the corresponding shooting distance (or shooting distance range) is pre-stored in the database as the single-camera standard field of view angle threshold. In this way, the current shooting distance between the target object and the camera module can be obtained, and the preset database can be queried to determine the single-camera standard field of view angle threshold corresponding to the current shooting distance.
[0041] In this embodiment, if the imaging requirement field of view of the target object relative to the camera module is greater than the standard field of view threshold of a single camera, it indicates that the single camera based on the camera module cannot meet the clear and complete imaging requirements of the target object, and therefore, the imaging field of view needs to be expanded.
[0042] It is easy to understand that the imaging field of view ranges between the cameras arranged at intervals may not be exactly the same. Therefore, if the number of cameras for photographing the target object is increased, it will obviously have an improving effect on the shooting field of view range of the target object. This method of increasing the number of cameras for photographing the target object, while improving the shooting field of view angle range, does not have high requirements on the design and manufacturing difficulty of the camera module. Therefore, in this embodiment, multiple target cameras associated with the required imaging field of view angles are determined from the multiple candidate cameras arranged at intervals in the camera module to improve the shooting field of view range of the target object.
[0043] For example, Figure 5 As shown, if the imaging required field of view range of camera 1 in the camera module is S1, then a new camera 2 is added and arranged at an interval with camera 1, and the total imaging required field of view range is determined according to S1 and S2. The shooting field of view increases the part of the field of view range that is different from S1 with respect to S1.
[0044] Among them, in different application scenarios, the methods of determining multiple target cameras associated with the imaging requirement field of view from multiple candidate cameras spaced apart in the camera module are different. Any method of selecting a target camera that can achieve clear and complete imaging of the target object should belong to the method of selecting multiple target cameras in this embodiment. For ease of understanding, it will be exemplarily described in subsequent embodiments and will not be repeated here.
[0045] In this embodiment, in response to a request to shoot a target object, after multiple target cameras in the camera module are determined, the multiple target cameras in the camera module are controlled to simultaneously shoot the target object to obtain multiple candidate images, wherein the multiple candidate images are shot at the same time and therefore target the state of the same target object at the same time, providing a basis for merging and fusion.
[0046] Step 102: splicing and fusing multiple candidate images to obtain a target image, and performing image recognition processing based on the target image.
[0047] It should be noted that the camera parameters of multiple cameras in the camera module in this embodiment may be the same or different. When the camera parameters (including camera internal parameters such as shooting focal length, camera external parameters such as shooting distance from the target object) are not exactly the same, when stitching and fusing multiple candidate images, it is necessary to process the candidate images to the same display dimension based on the difference in camera parameters and then perform stitching and fusion (for example, perform corresponding size scaling according to the distance from the target object, perform inverse perspective transformation on images that are not in the same shooting plane, etc.). If the shooting parameters are exactly the same, there is no need to perform unified processing of the display dimension on multiple candidate images for stitching and fusion.
[0048] In this embodiment, multiple candidate images are spliced and fused to obtain a target image, and then image recognition processing is performed based on the target image. Since the target image is captured by multiple target cameras, the shooting field of view of the target image can clearly image the target object, thereby improving the image recognition rate.
[0049] It should be noted that in different application scenarios, the methods of splicing and fusing multiple candidate images to obtain the target image are different, as shown in the following examples:
[0050] In one embodiment of the present disclosure, Figure 6 As shown, multiple candidate images are spliced and fused to obtain a target image, including:
[0051] Step 601: determine a main candidate image among multiple candidate images.
[0052] In this embodiment, the candidate image with the largest area can be determined as the main candidate image according to the area of the captured target object. The image clarity of each candidate image can also be determined, and the candidate image with the highest image clarity can be determined as the main candidate image.
[0053] Step 602 , performing image feature matching between the main candidate image and each of the other candidate images, and determining overlapping image regions with successful matching and newly added image regions with unsuccessful matching.
[0054] The image features include but are not limited to pixel values, pixel positions, etc.
[0055] In this embodiment, image feature matching is performed between the main candidate image and each other candidate image to determine overlapping image areas with successful matching and newly added image areas with unsuccessful matching, where unsuccessful matching refers to image areas of other candidate images that are different from the main candidate image, corresponding to different areas of the target object.
[0056] Step 603: perform image fusion on the main candidate image and the corresponding other candidate images according to the overlapping image area to generate a fused image area.
[0057] In this embodiment, the main candidate image and the corresponding other candidate images are fused according to the overlapping image area to generate a fused image area, thereby achieving image quality enhancement of the overlapping image area. The image fusion here can adopt high dynamic range imaging, etc.
[0058] Step 604: splice the main candidate image and the corresponding fused image area according to the newly added image area to generate a target image.
[0059] In this embodiment, the main candidate image and the corresponding fused image area are spliced to generate a target image according to the newly added image area, thereby achieving an expansion of the imaging field of view of the target image.
[0060] In another embodiment of the present disclosure, a deep learning model may be pre-trained, and the multiple candidate images may be input into the pre-trained deep learning model to obtain a target image output by the model.
[0061] In summary, the image recognition method of the disclosed embodiment, in response to a request to shoot a target object, determines multiple target cameras associated with the required imaging field angle from multiple candidate cameras spaced apart in the camera module, controls the multiple target cameras in the camera module to simultaneously shoot the target object to obtain multiple candidate images, and then splices and fuses the multiple candidate images to obtain the target image, and performs image recognition processing based on the target image. Therefore, based on the selection and coordination of multiple cameras to expand the field of view of the captured image, the design requirements for the hardware parameters of the camera are relatively low, and on the basis of expanding the range of the captured image, the image capture quality is guaranteed, which further facilitates the improvement of the image recognition rate.
[0062] The following example illustrates how to determine multiple target cameras associated with the imaging field of view of a target object.
[0063] In one embodiment of the present disclosure, Figure 7 As shown, multiple target cameras associated with the imaging required field of view angle are determined from multiple candidate cameras spaced apart in the camera module, including:
[0064] Step 701, obtaining the shooting field angle range of each candidate camera.
[0065] In this embodiment, the shooting field angle range of each candidate camera can be calculated according to the focal length of each candidate camera, and the shooting field angle range represents the area range of the object that can be imaged by the corresponding candidate camera.
[0066] Step 702: Calculate the combined imaging viewing angle range of each shooting field angle range and each other shooting field angle range according to a preset algorithm.
[0067] In this embodiment, the non-overlapping field of view angle range and the overlapping field of view angle range of each shooting field of view angle range are calculated according to a preset algorithm, that is, the same imageable area region and the different imageable area region of each shooting field of view angle range and the other shooting field of view angle range are determined, and the same and different imageable area regions are jointly composed of a combined imaging viewing angle range.
[0068] For example, refer to Figure 8 When the candidate cameras include cameras 1 and 2, the field of view angle range of camera 1 is S1, and the field of view angle range of camera 2 is S2. The shaded areas in the figure are the same field of view angle ranges, and the white areas in the figure are different field of view angle ranges.
[0069] In some possible embodiments, if the camera module is set relatively fixedly toward the object placement original in the image recognition device, the same field of view angle range and different field of view angle range between each candidate camera and other candidate cameras can be pre-calibrated, and the same field of view angle range and different field of view angle range can be directly obtained based on the calibration results, and the same field of view angle range and different field of view angle range can be jointly composed of a combined imaging viewing angle range.
[0070] In some other possible embodiments, the combined imaging viewing angle range is calculated based on the geometric relationship of the field of view angles.
[0071] In this embodiment, the vertical distance between each candidate camera and the target object, the inclination angle in the direction of the optical axis and the vertical distance, the horizontal field of view angle, and the vertical field of view angle are obtained, and then the vertical distance, the inclination angle, the horizontal field of view angle, and the vertical field of view angle are calculated to obtain the shooting field of view angle range of each candidate camera, and the field of view angle range that does not overlap with each shooting field of view angle range and the field of view angle range that overlaps with at least one other shooting field of view angle range are calculated based on the shooting field of view angle range of each candidate camera.
[0072] Continuing to take the candidate cameras including camera 1 and camera 2 as an example, as shown in FIG9(a), when the vertical distance of camera 1 relative to the target object is h, the inclination angle of the optical axis relative to the direction corresponding to the vertical distance is θ, the horizontal field of view angle is FOVβ, and the vertical field of view angle is FOVα, then according to the geometric relationship, the shooting field of view angle range S1 of camera 1 is determined as shown in the following formula (1):
[0073]
[0074] The method for determining the shooting field angle range S2 of the camera 2 can also refer to the above embodiment, which will not be repeated here.
[0075] Furthermore, if the shooting parameters of camera 1 and camera 2 are consistent, and they are shot on the same horizontal plane as shown in the figure, and if the distance between camera 1 and camera 2 is n, then as shown in FIG9(b), the field angle range S2 of camera 2 that does not overlap with camera 1 can be determined by referring to formula (2):
[0076]
[0077] Of course, in this embodiment, if the shooting parameters of camera 1 and camera 2 are inconsistent, the corresponding combined field of view angle range can be obtained by projecting the shooting field of view angle ranges calculated by each camera.
[0078] Step 703: determine multiple target cameras associated with the required imaging field of view according to the combined imaging viewing angle range.
[0079] In this embodiment, after determining the combined imaging viewing angle range, the range of overlapping areas and non-overlapping areas captured by the cameras can be roughly known. Therefore, if one wants to improve the imaging range of the target object, one can determine multiple target cameras associated with the required imaging field of view based on the combined imaging viewing angle range.
[0080] In one embodiment of the present disclosure, it is determined whether there is at least one candidate combined imaging viewing angle range in the combined imaging viewing angle range that is greater than the required imaging field of view. If there is at least one candidate combined imaging viewing angle range, the target combined imaging viewing angle range is determined in the at least one candidate combined imaging viewing angle range according to a preset screening strategy, and then the candidate camera corresponding to the target combined imaging viewing angle range is determined as the target camera.
[0081] In some possible embodiments, in order to ensure the recognition rate of the target object, the maximum value of at least one candidate combined imaging viewing angle range may be determined as the target combined imaging viewing angle range.
[0082] In other possible embodiments, the imaging contrast between the element to be identified and other elements in the target object can be obtained, wherein the element to be identified can be any identification object, such as text, face image area, etc. The imaging contrast is used to indicate the requirement for image clarity when identifying the target object. For example, if the imaging contrast is low, it indicates that the image of the target object needs to be clearer, otherwise the corresponding element to be identified may not be accurately identified.
[0083] If the imaging contrast is less than a preset threshold, then the size relationship of the same field of view angle range corresponding to at least one candidate combined imaging viewing angle range is compared. Since the same corresponds to the overlapping area of the shooting field of view angle range, the larger the overlapping area, the greater the probability that the target image obtained by fusion and stitching has higher clarity. Therefore, the candidate combined imaging viewing angle range corresponding to the maximum value in the same field of view angle range can be determined as the target candidate combined imaging viewing angle range. Of course, the candidate combined imaging viewing angle range corresponding to the highest value of the synthesized target image clarity can also be directly determined in at least one candidate combined imaging viewing angle range as the target combined imaging viewing angle range.
[0084] In another embodiment of the present disclosure, after determining whether there is at least one candidate combined imaging viewing angle range in the combined imaging viewing angle range that is greater than the required imaging field of view, if there is not at least one candidate combined imaging viewing angle range, a plurality of combined imaging viewing angle ranges whose sum of viewing angle ranges is greater than or equal to the required imaging field of view are obtained as the target combined imaging viewing angle range, wherein the plurality of combined imaging viewing angle ranges can be any natural number that is greater than 2 and less than the total number of candidate cameras.
[0085] In this embodiment, according to the same logic, the combined imaging viewing angle range of each shooting field of view angle range and the shooting field of view angle range of each M candidate camera in other candidate cameras is calculated according to a preset algorithm, and based on the combined imaging viewing angle range, multiple target cameras associated with the imaging requirement field of view are determined, and the method for determining the target camera refers to the above embodiment, wherein M is a natural number greater than 2, that is, in this embodiment, when more than 2 candidate cameras are required to clearly image the target object, or to clearly image the part to be identified of the target object, the combined imaging viewing angle range of more than 2 candidate cameras can also be calculated based on the above calculation method, and the target combined imaging viewing angle range is determined in multiple combined imaging viewing angle ranges according to a preset screening strategy based on the above logic, and the candidate camera corresponding to the target combined imaging viewing angle range is determined as the target camera.
[0086] In summary, the image recognition method of the embodiment of the present invention can, when a single camera is unable to clearly and completely image the area to be identified of the target object, determine multiple target cameras associated with the required imaging field of view from multiple candidate cameras spaced apart in the camera module through the required imaging field of view of the target object relative to the camera module. Under the premise of avoiding image edge distortion, the imaging field of view range of the target object is increased based on multiple target cameras, which helps to improve the recognition rate of the target object.
[0087] In order to implement the above embodiments, the present disclosure also proposes an image recognition device.
[0088] Fig.10This is a schematic diagram of the structure of an image recognition device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into electronic devices for image recognition. Fig.10 As shown, the device includes: a shooting module 1010 and a recognition module 1020, wherein:
[0089] The shooting module 1010 is used to control a plurality of predetermined target cameras in the camera module to simultaneously shoot the target object to obtain a plurality of candidate images in response to a shooting and identification request for the target object;
[0090] The recognition module 1020 is used to perform splicing and fusion processing on multiple candidate images to obtain a target image, and perform image recognition processing based on the target image.
[0091] The image recognition device provided in the embodiments of the present disclosure can execute the image recognition method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0092] In order to implement the above embodiments, the present disclosure also proposes a computer program product, including a computer program / instruction, which implements the image recognition method in the above embodiments when the computer program / instruction is executed by a processor.
[0093] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
[0094] The following specific reference Fig.11 , which shows a schematic diagram of the structure of an electronic device 1100 suitable for implementing the embodiment of the present disclosure. The electronic device 1100 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0095] like Fig.11As shown, the electronic device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 to a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the electronic device 1100 are also stored. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0096] Typically, the following devices may be connected to the I / O interface 1105: an input device 1106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an optional camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1109. The communication device 1109 may allow the electronic device 1100 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 The electronic device 1100 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0097] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1109, or installed from a storage device 1108, or installed from a ROM 1102. When the computer program is executed by the processing device 1101, the above-mentioned functions defined in the image recognition method of the embodiment of the present disclosure are executed.
[0098] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0099] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0100] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0101] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0102] In response to a request to shoot a target object, multiple target cameras associated with the required imaging field of view are determined from multiple candidate cameras spaced apart in the camera module, and multiple target cameras in the camera module are controlled to simultaneously shoot the target object to obtain multiple candidate images, and then multiple candidate images are spliced and fused to obtain a target image, and image recognition processing is performed based on the target image. Thus, based on the selection and coordination of multiple cameras to expand the field of view of the captured image, the design requirements for the hardware parameters of the camera are relatively low, and on the basis of expanding the range of the captured image, the image capture quality is guaranteed, which further facilitates the improvement of the image recognition rate.
[0103] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0104] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0105] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0106] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0107] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] According to one or more embodiments of the present disclosure, the present disclosure provides an image recognition method, comprising: in response to a request for photographing and identifying a target object, controlling a plurality of target cameras predetermined in a camera module to simultaneously photograph the target object to obtain a plurality of candidate images;
[0109] The multiple candidate images are spliced and fused to obtain a target image, and image recognition processing is performed based on the target image.
[0110] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure, before the plurality of target cameras predetermined in the control camera module simultaneously photograph the target object to obtain a plurality of candidate images, the method includes:
[0111] Obtaining a required imaging field of view angle of the target object relative to the camera module, and determining whether the required imaging field of view angle is greater than a predetermined single-camera standard field of view angle threshold;
[0112] If it is greater than the single camera standard field of view angle threshold, multiple target cameras associated with the imaging required field of view angle are determined from multiple candidate cameras spaced apart in the camera module.
[0113] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure, before determining whether the imaging required field of view angle is greater than a predetermined single-camera standard field of view angle threshold, the method further includes:
[0114] Obtaining the current shooting distance between the target object and the camera module;
[0115] A preset database is queried to determine a single camera standard field of view angle threshold corresponding to the current shooting distance.
[0116] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure, the step of determining a plurality of target cameras associated with the imaging required field of view from the plurality of candidate cameras spaced apart from each other in the camera module comprises:
[0117] Obtaining the shooting field of view angle range of each candidate camera;
[0118] Calculate the combined imaging viewing angle range of each shooting field angle range and each other shooting field angle range according to a preset algorithm;
[0119] A plurality of target cameras associated with the imaging required field of view angle are determined according to the combined imaging viewing angle range.
[0120] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure,
[0121] The method of determining a plurality of target cameras associated with the imaging required field of view according to the combined imaging viewing angle range includes:
[0122] Determine whether there is at least one candidate combined imaging viewing angle range in the combined imaging viewing angle range that is greater than the required imaging field of view;
[0123] If the at least one candidate combined imaging viewing angle range exists, determining the target combined imaging viewing angle range in the at least one candidate combined imaging viewing angle range according to a preset screening strategy;
[0124] Determine the candidate camera corresponding to the target combined imaging viewing angle range as the target camera.
[0125] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure,
[0126] Determining the target combined imaging viewing angle range in the at least one candidate combined imaging viewing angle range according to a preset screening strategy includes:
[0127] A maximum value among the at least one candidate combined imaging viewing angle range is determined as the target combined imaging viewing angle range.
[0128] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure,
[0129] After determining whether there is at least one candidate combined imaging viewing angle range greater than the required imaging field of view in the combined imaging viewing angle range, the method further includes:
[0130] If the at least one candidate combined imaging viewing angle range does not exist, a plurality of combined imaging viewing angle ranges whose sum of viewing angle ranges is greater than or equal to the required imaging field of view are obtained as the target combined imaging viewing angle range.
[0131] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure,
[0132] The obtaining of the shooting field of view angle range of each candidate camera includes:
[0133] Obtaining a vertical distance of each candidate camera relative to the target object, an inclination angle of the optical axis relative to the direction of the vertical distance, a horizontal field of view angle, and a vertical field of view angle;
[0134] The vertical distance, the inclination angle, the horizontal field of view angle, and the vertical field of view angle are calculated to obtain a shooting field of view angle range of each of the candidate cameras.
[0135] According to one or more embodiments of the present disclosure, in the image recognition method provided by the present disclosure, the splicing and fusing of the multiple candidate images to obtain the target image includes:
[0136] Determining a primary candidate image among the multiple candidate images;
[0137] Perform image feature matching between the main candidate image and each of the other candidate images to determine overlapping image areas where the matching is successful and newly added image areas where the matching is unsuccessful;
[0138] According to the overlapping image area, the main candidate image and the corresponding other candidate images are fused to generate a fused image area;
[0139] The target image is generated by splicing the main candidate image and the corresponding fused image area according to the newly added image area.
[0140] According to one or more embodiments of the present disclosure, the present disclosure provides an image recognition device, including:
[0141] A shooting module, for responding to a shooting and identification request for a target object, controlling a plurality of target cameras predetermined in the camera module to simultaneously shoot the target object to obtain a plurality of candidate images;
[0142] The recognition module is used to perform splicing and fusion processing on the multiple candidate images to obtain a target image, and perform image recognition processing based on the target image.
[0143] According to one or more embodiments of the present disclosure, the image recognition device provided by the present disclosure further includes: a judgment module, used to obtain the imaging required field of view angle of the target object relative to the camera module, and judge whether the imaging required field of view angle is greater than a predetermined single camera standard field of view angle threshold;
[0144] A determination module is used to determine multiple target cameras associated with the imaging required field of view from multiple candidate cameras spaced apart in the camera module when the field of view is greater than the single camera standard field of view angle threshold. According to one or more embodiments of the present disclosure, the image recognition device provided by the present disclosure further includes: an acquisition module, which is used to:
[0145] Obtaining the current shooting distance between the target object and the camera module;
[0146] A preset database is queried to determine a single camera standard field of view angle threshold corresponding to the current shooting distance.
[0147] According to one or more embodiments of the present disclosure, in the image recognition device provided by the present disclosure, the determination module includes:
[0148] An acquisition unit, used to acquire the shooting field of view angle range of each candidate camera;
[0149] A calculation unit, used for calculating the combined imaging viewing angle range of each of the shooting field of view angle ranges and each of the other shooting field of view angle ranges according to a preset algorithm;
[0150] A determination unit is used to determine multiple target cameras associated with the imaging required field of view according to the combined imaging viewing angle range.
[0151] According to one or more embodiments of the present disclosure, in the image recognition device provided by the present disclosure, the determining unit is specifically used to:
[0152] Determine whether there is at least one candidate combined imaging viewing angle range in the combined imaging viewing angle range that is greater than the required imaging field of view;
[0153] If the at least one candidate combined imaging viewing angle range exists, determining the target combined imaging viewing angle range in the at least one candidate combined imaging viewing angle range according to a preset screening strategy;
[0154] Determine the candidate camera corresponding to the target combined imaging viewing angle range as the target camera.
[0155] According to one or more embodiments of the present disclosure, in the image recognition device provided by the present disclosure, the determining unit is specifically used to:
[0156] A maximum value among the at least one candidate combined imaging viewing angle range is determined as the target combined imaging viewing angle range.
[0157] According to one or more embodiments of the present disclosure, in the image recognition device provided by the present disclosure, the determining unit is specifically used to:
[0158] If the at least one candidate combined imaging viewing angle range does not exist, a plurality of combined imaging viewing angle ranges whose sum of viewing angle ranges is greater than or equal to the required imaging field of view are obtained as the target combined imaging viewing angle range.
[0159] According to one or more embodiments of the present disclosure, in the image recognition device provided by the present disclosure, the computing unit is specifically used for:
[0160] Obtaining a vertical distance of each candidate camera relative to the target object, an inclination angle of the optical axis relative to the direction of the vertical distance, a horizontal field of view angle, and a vertical field of view angle;
[0161] The vertical distance, the inclination angle, the horizontal field of view angle, and the vertical field of view angle are calculated to obtain a shooting field of view angle range of each of the candidate cameras.
[0162] According to one or more embodiments of the present disclosure, in the image recognition device provided by the present disclosure, the recognition module is specifically used to:
[0163] Determining a primary candidate image among the multiple candidate images;
[0164] Perform image feature matching between the main candidate image and each of the other candidate images to determine overlapping image areas where the matching is successful and newly added image areas where the matching is unsuccessful;
[0165] According to the overlapping image area, the main candidate image and the corresponding other candidate images are fused to generate a fused image area;
[0166] The target image is generated by splicing the main candidate image and the corresponding fused image area according to the newly added image area.
[0167] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:
[0168] processor;
[0169] a memory for storing instructions executable by the processor;
[0170] The processor is used to read the executable instructions from the memory and execute the instructions to implement any image recognition method provided in the present disclosure.
[0171] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute any image recognition method as provided by the present disclosure.
[0172] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0173] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0174] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image recognition method, characterized in that: The method comprises the following steps: In response to a request for photographing and identifying a target object, obtaining a required imaging field of view angle of the target object relative to a camera module, and determining whether the required imaging field of view angle is greater than a predetermined single-camera standard field of view angle threshold; If it is greater than the single camera standard field of view angle threshold, determining multiple target cameras associated with the imaging required field of view angle from multiple candidate cameras spaced apart in the camera module; Controlling the multiple target cameras to simultaneously photograph the target object to obtain multiple candidate images; The multiple candidate images are spliced and fused to obtain a target image, and image recognition processing is performed based on the target image.
2. The method according to claim 1, characterized in that Before determining whether the imaging required field of view angle is greater than a predetermined single-camera standard field of view angle threshold, the method further includes: Obtaining the current shooting distance between the target object and the camera module; A preset database is queried to determine a single camera standard field of view angle threshold corresponding to the current shooting distance.
3. The method according to claim 1, characterized in that The step of determining a plurality of target cameras associated with the imaging required field of view from a plurality of candidate cameras spaced apart in the camera module comprises: Obtaining the shooting field of view angle range of each candidate camera; Calculate the combined imaging viewing angle range of each shooting field angle range and each other shooting field angle range according to a preset algorithm; A plurality of target cameras associated with the imaging required field of view angle are determined according to the combined imaging viewing angle range.
4. The method according to claim 3, characterized in that The method of determining a plurality of target cameras associated with the imaging required field of view according to the combined imaging viewing angle range includes: Determine whether there is at least one candidate combined imaging viewing angle range in the combined imaging viewing angle range that is greater than the required imaging field of view; If the at least one candidate combined imaging viewing angle range exists, determining the target combined imaging viewing angle range in the at least one candidate combined imaging viewing angle range according to a preset screening strategy; Determine the candidate camera corresponding to the target combined imaging viewing angle range as the target camera.
5. The method according to claim 4, characterized in that Determining the target combined imaging viewing angle range in the at least one candidate combined imaging viewing angle range according to a preset screening strategy includes: A maximum value among the at least one candidate combined imaging viewing angle range is determined as the target combined imaging viewing angle range.
6. The method according to claim 4, characterized in that After determining whether there is at least one candidate combined imaging viewing angle range greater than the required imaging field of view in the combined imaging viewing angle range, the method further includes: If the at least one candidate combined imaging viewing angle range does not exist, a plurality of combined imaging viewing angle ranges whose sum of viewing angle ranges is greater than or equal to the required imaging field of view are obtained as the target combined imaging viewing angle range.
7. The method according to any one of claims 3 to 6, characterized in that: The obtaining of the shooting field of view angle range of each candidate camera includes: Obtaining a vertical distance of each candidate camera relative to the target object, an inclination angle of the optical axis relative to the direction of the vertical distance, a horizontal field of view angle, and a vertical field of view angle; The vertical distance, the inclination angle, the horizontal field of view angle, and the vertical field of view angle are calculated to obtain a shooting field of view angle range of each of the candidate cameras.
8. The method according to claim 1, characterized in that The step of splicing and fusing the plurality of candidate images to obtain a target image includes: Determining a primary candidate image among the multiple candidate images; Perform image feature matching between the main candidate image and each of the other candidate images to determine overlapping image areas where the matching is successful and newly added image areas where the matching is unsuccessful; According to the overlapping image area, the main candidate image and the corresponding other candidate images are fused to generate a fused image area; The target image is generated by splicing the main candidate image and the corresponding fused image area according to the newly added image area.
9. An image recognition device, characterized in that: include: A shooting module, for responding to a shooting and identification request for a target object, obtaining an imaging required field of view angle of the target object relative to a camera module, determining whether the imaging required field of view angle is greater than a predetermined single-camera standard field of view angle threshold, and if greater than the single-camera standard field of view angle threshold, determining a plurality of target cameras associated with the imaging required field of view angle from a plurality of candidate cameras spaced apart in the camera module, and controlling the plurality of target cameras to simultaneously shoot the target object to obtain a plurality of candidate images; The recognition module is used to perform splicing and fusion processing on the multiple candidate images to obtain a target image, and perform image recognition processing based on the target image.
10. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the image recognition method described in any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the image recognition method described in any one of claims 1 to 8.
