Optical imaging method and device for eliminating ghost images, storage medium and electronic device
By obtaining the target object information in the target field of view and adjusting the relationship between the lens and the camera of the camera, the problem of ghost images occurring when the camera device acquires images is solved, and the image quality and recognition results are improved.
Patent Information
- Application Number
- CN202210669696.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-06-14
AI Technical Summary
Existing cameras are prone to ghost images when collecting images, affecting image quality and the recognition results of smart scenes.
By obtaining the target object information within the target field of view, determining the target distribution relationship between the lens and the camera, and adjusting the initial camera device to eliminate ghost images.
It effectively improves the image quality collected by the camera equipment and eliminates the impact of ghost images on image recognition results.
Smart Images

Figure CN115065790B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera shooting, and in particular to an optical imaging method and device, a storage medium and an electronic device for eliminating ghost images. Background Art
[0002] In recent years, with the rapid development of social economy, cameras have been widely used in people's lives. Cameras are also helping people's lives to become smarter in direct or indirect ways. As we all know, electronic eyes and cameras are everywhere in life, from remote sensing and drones in the sky to mines and tunnels underground. It can monitor in real time 24 hours a day, and can see farther and more clearly than the human eye. At the same time, it can also provide image support for the smart scenes that people need. In these smart scenes, by identifying and analyzing the images obtained by the camera, analysis results that match the scene are made, and the occurrence of emergencies is prevented or stopped in a timely and effective manner. For example, the well-known car assisted driving scene and the forest fire monitoring scene require analysis of the images collected by the camera, so as to make corresponding processing according to the analysis results, and then drive other devices in the scene to perform corresponding operations.
[0003] In order to ensure better image effects under different environmental conditions and protect the quality of the camera lens, a planar optical device is added to the front end of the camera of the camera equipment to prevent the impact of special environments on the camera lens (such as dust and water resistance). Although this method ensures the quality of the camera, when the camera collects images through the planar optical device on the front end, ghost images will appear in the collected images, thereby affecting the quality of the image output by the camera, and further affecting the recognition results of the images collected by the camera in the smart scene.
[0004] With regard to the problems such as low quality of images collected by camera equipment in related technologies, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide an optical imaging method and device, a storage medium and an electronic device for eliminating ghost images, so as to at least solve the problem of low quality of images captured by camera equipment in related technologies.
[0006] According to one embodiment of the embodiments of the present application, there is provided an optical imaging method for eliminating ghost images, comprising: obtaining target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate the distribution of the target object within the target field of view, the initial camera device comprising a lens and a camera, the camera being used to capture an image of the target field of view through the lens; determining a target distribution relationship between the lens and the camera based on the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in the image captured by the target camera device; and adjusting the initial camera device according to the target distribution relationship to obtain the target camera device.
[0007] Optionally, determining the target distribution relationship between the lens and the camera based on the target object information includes: determining a first area matching the object position within the target field of view, wherein the first area is the distribution area of the target object within the target field of view, and the target object information includes the object position; determining a target angle relationship between the lens and the camera as the target distribution relationship based on the relationship between the first area and the field of view center of the target field of view, wherein the target angle relationship is used to move a ghost image of the target object formed by the lens in the camera out of the target field of view.
[0008] Optionally, the target angle relationship between the lens and the camera is determined as the target distribution relationship based on the relationship between the first area and the center of the target field of view, including: determining the angle direction between the lens and the mirror surface of the camera based on the relationship between the first area and the center of the target field of view; determining the angle angle between the lens and the mirror surface of the camera based on the field of view angle of the camera in the angle direction, wherein the target angle relationship includes the angle direction and the angle angle, and the ghost image of the target object formed by the lens and the camera distributed according to the angle direction and the angle angle falls outside the target field of view.
[0009] Optionally, determining the direction of the angle between the lens and the mirror surface of the camera based on the relationship between the first area and the center of the target field of view includes: determining a second area within the target field of view that is symmetrical to the first area relative to the center of the field of view; and determining the direction of the second area relative to the first area as the direction of the angle.
[0010] Optionally, determining the angle between the lens and the mirror surface of the camera according to the field of view angle of the camera in the angle direction includes: calculating the product value of the field of view angle and a target coefficient, wherein the target coefficient is a coefficient that matches a target angle, and the target angle is the angle between a line connecting the target object and the center of the camera and a line connecting the field of view center and the center of the camera; determining the angle according to the sum of the product value and a target compensation value, wherein the target compensation value matches the camera, and the angle is greater than or equal to the sum.
[0011] Optionally, obtaining the target object information within the target field of view of the initial camera device includes: obtaining a field of view image within the target field of view that the initial camera is allowed to capture; identifying the pixel brightness of each pixel in the field of view image; determining the pixel points whose pixel brightness is greater than or equal to the target brightness as target pixel points corresponding to the target object; and determining the position of the target pixel point on the field of view image as the object position of the target object within the target field of view, wherein the target object information includes the object position.
[0012] Optionally, adjusting the initial camera device according to the target distribution relationship to obtain the target camera device includes: determining an initial distribution relationship between the lens and the camera in the initial camera device; determining the difference between the target distribution relationship and the initial distribution relationship as an adjustment value of the lens; and adjusting the distribution position of the lens in the initial camera device according to the adjustment value to obtain the target camera device.
[0013] According to another embodiment of the embodiments of the present application, there is also provided an optical imaging device for eliminating ghost images, including: an acquisition module, used to acquire target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate the distribution of the target object within the target field of view, and the initial camera device includes a lens and a camera, and the camera is used to capture an image of the target field of view through the lens; a determination module, used to determine a target distribution relationship between the lens and the camera based on the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in the image captured by the target camera device; and an adjustment module, used to adjust the initial camera device according to the target distribution relationship to obtain the target camera device.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above method when running.
[0015] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method through the computer program.
[0016] In an embodiment of the present application, target object information within a target field of view of an initial camera device is obtained, wherein the target object information is used to indicate the distribution of the target object within the target field of view, and the initial camera device includes a lens and a camera, and the camera is used to collect an image of the target field of view through the lens; a target distribution relationship between the lens and the camera is determined based on the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in the image collected by the target camera device; the initial camera device is adjusted according to the target distribution relationship to obtain the target camera device, that is, when the target field of view is photographed using the initial camera device including the lens and the camera, the camera is used to collect images within the target field of view through the lens, and target object information indicating the distribution of the target object within the target field of view of the initial device is obtained, thereby determining the target distribution relationship between the lens and the camera based on the target object information, and the target distribution relationship is used to eliminate ghost images generated by the target object in the image collected by the camera device, and then adjusting the initial camera device according to the target distribution relationship, when the adjusted target camera is used to collect images within the target field of view, there is no ghost image corresponding to the target object in the image, thereby ensuring the quality of the image collected by the camera. The above technical solution solves the problem of low quality of images collected by camera equipment in related technologies, and achieves the technical effect of improving the quality of images collected by camera equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 is a schematic diagram of the hardware environment of an optical imaging method for eliminating ghost images according to an embodiment of the present application;
[0020] Figure 2 is a schematic diagram of an optional camera device according to an embodiment of the present application;
[0021] Figure 3 is a flow chart of an optical imaging method for eliminating ghost images according to an embodiment of the present application;
[0022] Figure 4 is an optional ghost image elimination schematic diagram according to an embodiment of the present application;
[0023] Figure 5 is a schematic diagram of an optional optical path when a ghost image is generated according to an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of an optional optical path for eliminating ghost images according to an embodiment of the present application;
[0025] Figure 7 is another optional optical path schematic diagram for eliminating ghost images according to an embodiment of the present application;
[0026] Figure 8 is a schematic diagram of an optional viewing angle according to an embodiment of the present application;
[0027] Fig. 9 It is a structural block diagram of an optical imaging device for eliminating ghost images according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] The optical imaging method for eliminating ghost images provided in the embodiments of the present application can be executed in a computer terminal, a device terminal or a similar computing device. For example, running on a computer terminal, Figure 1FIG. 1 is a schematic diagram of the hardware environment of an optical imaging method for eliminating ghost images according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. In an exemplary embodiment, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0031] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for sending message push in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0033] The present application example can be but is not limited to being applied to a camera device having at least a lens and a camera. The lens can be but is not limited to being used to protect the camera. In actual use, the lens can be but is not limited to being installed on a distributed shell, and the camera is installed in the shell, thereby making the camera waterproof and dustproof, and the camera collects images through the lens. Figure 2 is a schematic diagram of an optional camera device according to an embodiment of the present application, such as Figure 2 As shown, the target camera device in the embodiment of the present application includes at least two parts, namely a camera and a lens. In actual use, it may also include a shell, the camera is located inside the shell, and the lens is installed on the shell at the front end of the camera to protect the camera lens (such as waterproof and dustproof). The camera can collect images through the lens, and the distribution relationship between the lens and the camera in the embodiment of the present application (the angle direction and angle between the lens and the mirror surface of the camera, and the distance between the lens and the mirror surface of the camera) is adjustable.
[0034] In this embodiment, a method for eliminating ghost images is provided, which is applied to the above-mentioned computer terminal. Figure 3 : is a flow chart of an optical imaging method for eliminating ghost images according to an embodiment of the present application, the process includes the following steps:
[0035] Step S302, obtaining target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate a distribution of target objects within the target field of view, and the initial camera device includes a lens and a camera, and the camera is used to capture an image of the target field of view through the lens;
[0036] Step S304, determining a target distribution relationship between the lens and the camera according to the target object information, wherein the target distribution relationship is used to eliminate a ghost image generated by the target object in an image captured by a target camera device;
[0037] Step S306: adjusting the initial camera device according to the target distribution relationship to obtain the target camera device.
[0038] Through the above steps, when the initial camera device including the lens and the camera is used to shoot the target field of view, the camera is used to collect images within the target field of view through the lens, and the target object information indicating the distribution of the target object in the target field of view of the initial device is obtained, so as to determine the target distribution relationship between the lens and the camera according to the target object information, and the target distribution relationship is used to eliminate the ghost image generated by the target object in the image collected by the camera device, and then the initial camera device is adjusted according to the target distribution relationship, and when the adjusted target camera is used to collect images within the target field of view, there is no ghost image corresponding to the target object in the image, thereby ensuring the quality of the image collected by the camera. The above technical solution solves the problem of low quality of images collected by the camera device in the related technology, and achieves the technical effect of improving the quality of images collected by the camera device.
[0039] In the technical solution provided in the above step S302, the target object information may include but is not limited to the position of the object, the brightness of the object, the size of the object, etc., and this solution does not limit this.
[0040] Optionally, in this embodiment, the target object is an object capable of outputting light, and the target object may include but is not limited to a light source, a reflective object, and the like.
[0041] In the technical solution provided in the above step S304, the target distribution relationship may include but is not limited to the angle relationship, position relationship, distance relationship, etc. between the lens and the mirror surface of the camera, and this solution does not limit this.
[0042] Optionally, in this embodiment, ghost image elimination is achieved by adjusting the position of the ghost image in the original image (the image within the target field of view captured by the initial camera device), which may include but is not limited to removing the ghost image from the image area, or moving the ghost image to the position of the target object in the image. Since the brightness of the target object in the image is greater than the brightness of the ghost image, the influence of the ghost image on the image is eliminated.
[0043] In the technical solution provided in the above step S306, the method of adjusting the initial camera can be achieved by adjusting the lens, adjusting the camera, adjusting the lens and the camera at the same time, etc. For example, the position of the camera is controlled to remain unchanged, and the angle of the lens is adjusted, thereby adjusting the angle between the lens and the camera in the camera device.
[0044] Figure 4 is an optional ghost image elimination schematic diagram according to an embodiment of the present application, such as Figure 4As shown, the target camera device used in the embodiment of the present application includes at least two parts: a camera and a lens. The lens is arranged at the front end of the camera to protect the camera from water and dust, etc. The target camera device is used to collect images within a target field of view with a target light source (corresponding to the target object mentioned above). The target light source (corresponding to the target object mentioned above) is located in the upper half of the field of view. When the image within the target field of view starts to be collected, the lens and the mirror surface of the camera are parallel (that is, the lens is not tilted relative to the camera). At this time, the image collected by the camera includes the target light source (corresponding to the target object mentioned above) and a ghost image corresponding to the target light source (corresponding to the target object mentioned above). The ghost image is caused by the lens reflecting the target light source in the camera. The light from the light source is re-reflected, and the resulting light beam is imaged on the imaging device of the camera. In order to eliminate ghost images, the positional relationship between the lens and the camera is changed to eliminate the influence of the light beam reflection reaction of the lens on the image captured by the camera, thereby eliminating the ghost image corresponding to the target light beam on the captured image. The positional relationship between the lens and the camera can be adjusted by, but is not limited to, adjusting the lens, adjusting the camera, or adjusting the lens and the camera at the same time. The adjustment can include, but is not limited to, adjusting the angle relationship and position relationship between the lens and the camera. As shown in the figure, in the embodiment of the present application, the inclination angle of the lens is adjusted to eliminate the ghost image corresponding to the target light source on the image captured by the camera.
[0045] As an optional embodiment, determining the target distribution relationship between the lens and the camera according to the target object information includes:
[0046] Determine a first area matching the object position within the target field of view, wherein the first area is a distribution area of the target object within the target field of view, and the target object information includes the object position;
[0047] The target angle relationship between the lens and the camera is determined as the target distribution relationship based on the relationship between the first area and the center of the target field of view, wherein the target angle relationship is used to move the ghost image of the target object formed by the lens in the camera out of the target field of view.
[0048] Optionally, in this embodiment, the first area can be an area pre-divided in the target field of view, or can also be generated according to the object position. For example, when there are multiple target objects in the target field of view, the upper and lower areas of the target field of view can be pre-divided. In this case, when the object positions of the multiple target objects are in the upper half of the target field of view, the upper half of the target field of view is determined as the first area; or the area enclosed by the object positions of the multiple target objects in the target field of view can be used as the first area.
[0049] Optionally, in this embodiment, the target angle relationship can be determined based on the relative position relationship between the first area and the center of the field of view. For example, the direction of the angle between the lens and the camera mirror is determined based on the direction of the area center of the first area relative to the center of the field of view, and the angle between the lens and the camera is determined based on the maximum distance between the first area and the center of the field of view. This solution does not limit this.
[0050] Optionally, in this embodiment, the target angle relationship may include, but is not limited to, an angle and an angle direction between the lens and the camera mirror.
[0051] As an optional embodiment, determining the target angle relationship between the lens and the camera as the target distribution relationship according to the relationship between the first area and the center of the target field of view includes:
[0052] Determining the direction of the angle between the lens and the mirror surface of the camera according to the relationship between the first area and the center of the field of view of the target field of view;
[0053] The angle between the lens and the mirror surface of the camera is determined according to the field of view angle of the camera in the angle direction, wherein the target angle relationship includes the angle direction and the angle, and the ghost image of the target object formed by the lens and the camera distributed according to the angle direction and the angle falls outside the target field of view.
[0054] Optionally, in this embodiment, the angle direction can be but is not limited to being determined based on the direction of the first area relative to the center of the field of view, or it can also be determined based on the direction of a target point in the first area (such as the center point of the area) relative to the center of the field of view. This solution does not limit this.
[0055] Optionally, in this embodiment, the angle may be the maximum angle between the lens and the camera mirror in the angle direction, or may be an angle that matches the object position of the target object in the target field of view.
[0056] Figure 5 is a schematic diagram of an optional optical path when a ghost image is generated according to an embodiment of the present application, such as Figure 5As shown, the camera device used in the embodiment of the present application includes at least two parts: a lens and a camera. The lens is arranged at the front end of the camera to protect the camera. It can be but not limited to playing a role of waterproof and dustproof. When the camera device is used to collect images within the field of view of the camera, the light source beam (incident light 1) emitted by the target light source (corresponding to the target object mentioned above) in the field of view is captured by the lens into the camera and irradiated on the imaging device inside the camera, so that the image of the target light source appears on the collected image. When the light source beam (incident light 1) is irradiated on the imaging device, the imaging device will reflect the light source beam to obtain output light 1. The output light 1 is irradiated on the lens through the camera. The lens has a reflective effect on the irradiated output light 1. After the lens reflects the output light 1, incident light 2 is obtained. The incident light 2 enters the camera and irradiates on the imaging device, so that a ghost image corresponding to the target light source appears on the image collected by the camera.
[0057] Figure 6 is a schematic diagram of an optional optical path for eliminating ghost images according to an embodiment of the present application, such as Figure 6 As shown, the camera device used in the embodiment of the present application includes at least two parts: a lens and a camera. The lens is arranged in the front section of the camera to protect the camera. When there is a target light source (corresponding to the target object mentioned above) within the field of view of the camera, a light source image and a ghost image symmetrical to the position of the light source image will appear in the captured image at the same time, and the ghost image and the light source image have the center of symmetry with the center of the field of view. The present application changes the tilt angle of the lens relative to the camera in the direction of the ghost image (for example, the direction of the ghost image in the image relative to the light source image is the tilt direction; or the preset tilt direction matching the application scenario can be used as the tilt direction of the lens (for example, when the camera device is set at the rear of a car, since in this application scenario the light sources are all distributed in the upper half of the field of view, the matching tilt direction is up and down tilt; the camera is set in a wall scene, since in this scene the light sources are only distributed on the left or right side of the field of view, the matching tilt direction is left and right tilt)), so that an angle is generated between the camera and the lens. As shown in the figure, by controlling the lens to tilt in a specific direction and angle, the ghost image gradually deviates from the center of the image. The larger the tilt angle, the closer the ghost image is to the edge of the image, and the smaller the ghost image on the image. When the lens is tilted to a certain angle, all the ghost images in the image disappear.
[0058] Figure 7 is another optional optical path schematic diagram for eliminating ghost images according to an embodiment of the present application, such as Figure 7As shown, the camera device used in the embodiment of the present application includes at least two parts: a lens and a camera. The lens is arranged at the front section of the camera to protect the camera. When there is a target light source (corresponding to the target object mentioned above) in the field of view of the camera, the light source image and a ghost image symmetrical to the light source image will appear in the captured image at the same time, and the ghost image and the light source image are symmetrical with the field of view center. In the embodiment of the application, by adjusting the tilt direction and tilt angle of the lens, the position of the ghost image in the image is adjusted, so that the ghost image gradually approaches the image of the target light source (corresponding to the target object mentioned above), and finally the ghost image and the image of the target light source overlap, so that the ghost image corresponding to the target light source (corresponding to the target object mentioned above) cannot be displayed in the captured image, thereby eliminating the ghost image in the captured image.
[0059] As an optional embodiment, determining the angle direction between the lens and the mirror surface of the camera according to the relationship between the first area and the center of the field of view of the target field of view includes:
[0060] Determine, within the target visual field, a second area that is symmetrical to the first area relative to the center of the visual field;
[0061] The direction of the second area relative to the first area is determined as the angle direction.
[0062] Optionally, in this embodiment, the second area may be pre-divided in the target field of view, or may be generated based on the first area. For example, a center line passing through the center of the field of view may be set based on the application scenario of the target camera device, and the center line divides the field of view into two areas. The first area and the second area may be determined in the two areas based on the application scenario of the target camera. Alternatively, a reference object position symmetrical to the object position relative to the center of the field of view may be determined based on the object position of the target object in the target field of view, and the area enclosed by the reference object position in the target field of view may be used as the second area.
[0063] As an optional embodiment, determining the angle between the lens and the mirror surface of the camera according to the field of view of the camera in the angle direction includes:
[0064] Calculate the product value of the field of view angle and the target coefficient, wherein the target coefficient is a coefficient matching the target angle, and the target angle is the angle between the line connecting the target object and the center of the camera and the line connecting the field of view center and the center of the camera;
[0065] The angle is determined according to the sum of the product value and the target compensation value, wherein the target compensation value matches the camera and the angle is greater than or equal to the sum.
[0066] Optionally, in this embodiment, the target compensation value is a compensation value that matches the field of view angle of the camera, and different field of view angles correspond to different compensation values, thereby eliminating the influence of the field of view angle on ghost image elimination, thereby removing all ghost images from the captured image. The following table is an optional field of view angle and compensation value correspondence table according to an embodiment of the present application. As shown in Table 1, different field of view angles correspond to different compensation values.
[0067] Table 1
[0068]
[0069] Optionally, in this embodiment, the method for determining the angle includes directly determining the sum of the product value and the target compensation value as the angle, or selecting an angle value greater than the sum as the angle. For example, there may be a maximum adjustable angle between the lens and the mirror surface of the camera in the corresponding angle direction, thereby obtaining an angle range, the maximum adjustable angle being the upper limit of the angle range, and the calculated sum being the lower limit of the angle range. Any angle value falling within the angle range can be determined as the angle between the lens of the target device camera and the mirror surface of the camera. For example, in actual applications, there may be a certain initial angle between the lens and the mirror surface of the camera in the initial camera device, and the initial angle falls within the angle range. Therefore, the initial angle can be used as the angle between the lens and the mirror surface of the camera in the target camera device. At this time, adjusting the initial camera device to the target camera device only requires adjusting the direction of the angle between the lens and the mirror surface of the camera, without adjusting the angle of the angle.
[0070] Optionally, in this embodiment, there is a negative correlation between the target coefficient and the target angle, and the larger the angle value of the target angle is, the smaller the target coefficient is.
[0071] Figure 8 is a schematic diagram of an optional viewing angle according to an embodiment of the present application, such as Figure 8It is a front view of the camera device, and the camera's field of view angle FOV in the vertical direction is A. When the lens and the mirror surface of the camera are parallel, the image corresponding to the target object in the image captured by the camera and the ghost image are symmetrical relative to the center of the field of view. When the lens and the mirror surface of the camera are parallel, if the target object is located at the center of the field of view, the image corresponding to the target object and the ghost image coincide with each other. At this time, the angle between the line connecting the ghost image and the center of the camera and the line connecting the image boundary and the center of the camera is A / 2. The ghost image of the target object at the center of the field of view is eliminated by tilting the lens. At this time, the lens rotation angle is the largest to eliminate the ghost image (after the plane optical device is tilted, the center point of symmetry between the light source and the ghost image is changed so that the center point is located at half of the half-angle position, that is, the plane optical device is tilted A / 4). In view of the distortion of the lens, the glass tilt angle needs to increase a compensation value to compensate for the influence of distortion on FOV, so the compensation value needs to be increased, so as to determine that the angle that the lens needs to rotate to eliminate the ghost image is B, B≥A / 4+C, where C is the compensation value matching the camera's field of view angle.
[0072] As an optional embodiment, the step of obtaining target object information within a target field of view of an initial camera device includes:
[0073] Acquire a field of view image within the target field of view that is allowed to be captured by the initial camera;
[0074] Identifying the pixel brightness of each pixel in the field of view image;
[0075] Determine a pixel point whose pixel brightness is greater than or equal to the target brightness as a target pixel point corresponding to the target object;
[0076] The position of the target pixel point on the field of view image is determined as the object position of the target object within the target field of view, wherein the target object information includes the object position.
[0077] Optionally, in this embodiment, the target brightness can be a brightness that matches the object information of the target object. For example, by identifying the field of view image, the object information of the target object in the image (such as the type of object) is identified, and then the target brightness that matches the object type is determined.
[0078] As an optional embodiment, adjusting the initial camera device according to the target distribution relationship to obtain the target camera device includes:
[0079] Determining an initial distribution relationship between the lenses and the cameras in the initial camera device;
[0080] Determine the difference between the target distribution relationship and the initial distribution relationship as the adjustment value of the lens;
[0081] The distribution positions of the lenses in the initial imaging device are adjusted according to the adjustment values to obtain the target imaging device.
[0082] Optionally, in this embodiment, the distribution position of the adjustment lens in the initial camera can be to first determine the adjustment method that matches the adjustment value based on the adjustment value, and adjust the lens according to the adjustment method. For example, different adjustment intervals correspond to different adjustment amplitudes. When adjusting the lens, the adjustment value that needs to be adjusted for the lens is collected in real time, and the adjustment interval where the adjustment value at the corresponding moment is located is detected, and the adjustment value of the adjustment interval is adjusted according to the adjustment amplitude.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0084] Fig. 9 is a structural block diagram of an optical imaging device for eliminating ghost images according to an embodiment of the present application; Fig. 9 As shown, including:
[0085] An acquisition module 92 is used to acquire target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate the distribution of the target object within the target field of view, and the initial camera device includes a lens and a camera, and the camera is used to capture an image of the target field of view through the lens;
[0086] A determination module 94, configured to determine a target distribution relationship between the lens and the camera according to the target object information, wherein the target distribution relationship is used to eliminate a ghost image generated by the target object in an image captured by a target camera device;
[0087] The adjustment module 96 is used to adjust the initial camera device according to the target distribution relationship to obtain the target camera device.
[0088] Through the above embodiment, when the initial camera device including a lens and a camera is used to shoot the target field of view, the camera is used to collect images within the target field of view through the lens, and the target object information indicating the distribution of the target object in the target field of view of the initial device is obtained, thereby determining the target distribution relationship between the lens and the camera according to the target object information, and the target distribution relationship is used to eliminate the ghost image generated by the target object in the image collected by the camera device, and then the initial camera device is adjusted according to the target distribution relationship. When the adjusted target camera is used to collect images within the target field of view, there is no ghost image corresponding to the target object in the image, thereby ensuring the quality of the image collected by the camera. The above technical solution solves the problem of low quality of images collected by the camera device in the related technology, and achieves the technical effect of improving the quality of images collected by the camera device.
[0089] Optionally, the determination module includes: a first determination unit, used to determine a first area matching the object position within the target field of view, wherein the first area is the distribution area of the target object within the target field of view, and the target object information includes the object position; a second determination unit, used to determine a target angle relationship between the lens and the camera as the target distribution relationship based on the relationship between the first area and the field of view center of the target field of view, wherein the target angle relationship is used to move a ghost image of the target object formed by the lens in the camera out of the target field of view.
[0090] Optionally, the second determination unit is used to: determine the direction of the angle between the lens and the mirror surface of the camera based on the relationship between the first area and the center of the field of view of the target field of view; determine the angle angle between the lens and the mirror surface of the camera based on the field of view angle of the camera in the angle direction, wherein the target angle relationship includes the angle direction and the angle angle, and the ghost image of the target object formed by the lens and the camera distributed according to the angle direction and the angle angle falls outside the target field of view.
[0091] Optionally, the second determination unit is used to: determine a second area within the target field of view that is symmetrical to the first area relative to the center of the field of view; and determine the direction of the second area relative to the first area as the angle direction.
[0092] Optionally, the second determination unit is used to: calculate the product value of the field of view angle and a target coefficient, wherein the target coefficient is a coefficient that matches the target angle, and the target angle is the angle between a line connecting the target object and the center of the camera and a line connecting the center of the field of view and the center of the camera; determine the angle according to the sum of the product value and a target compensation value, wherein the target compensation value matches the camera, and the angle is greater than or equal to the sum.
[0093] Optionally, the acquisition module includes: an acquisition unit, used to acquire a field of view image within the target field of view allowed to be captured by the initial camera; an identification unit, used to identify the pixel brightness of each pixel in the field of view image; a third determination unit, used to determine the pixel whose pixel brightness is greater than or equal to the target brightness as the target pixel corresponding to the target object; and a fourth determination unit, used to determine the position of the target pixel on the field of view image as the object position of the target object within the target field of view, wherein the target object information includes the object position.
[0094] Optionally, the adjustment module includes: a fifth determination unit, used to determine the initial distribution relationship between the lens and the camera in the initial camera device; a sixth determination unit, used to determine the difference between the target distribution relationship and the initial distribution relationship as the adjustment value of the lens; and an adjustment unit, used to adjust the distribution position of the lens in the initial camera device according to the adjustment value to obtain the target camera device.
[0095] An embodiment of the present application further provides a storage medium, which includes a stored program, wherein when the program is run, any of the above-mentioned optical imaging methods for eliminating ghost images is executed.
[0096] Optionally, in this embodiment, the above-mentioned storage medium can be configured to store program codes for executing the following steps: obtaining target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate the distribution of the target object within the target field of view, and the initial camera device includes a lens and a camera, and the camera is used to capture an image of the target field of view through the lens; determining a target distribution relationship between the lens and the camera based on the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in the image captured by the target camera device; and adjusting the initial camera device according to the target distribution relationship to obtain the target camera device.
[0097] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the optical imaging method for eliminating ghost images.
[0098] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0099] Optionally, in this embodiment, the above-mentioned processor can be configured to perform the following steps through a computer program: obtaining target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate the distribution of the target object within the target field of view, and the initial camera device includes a lens and a camera, and the camera is used to capture an image of the target field of view through the lens; determining a target distribution relationship between the lens and the camera based on the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in the image captured by the target camera device; and adjusting the initial camera device according to the target distribution relationship to obtain the target camera device.
[0100] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0101] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0102] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0103] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. An optical imaging method for eliminating ghost images, characterized in that: include: Acquire target object information within a target field of view of an initial camera device, wherein the target object information is used to indicate distribution of the target object within the target field of view, the initial camera device comprises a lens and a camera, and the camera is used to capture an image of the target field of view through the lens; Determining a target distribution relationship between the lens and the camera according to the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in an image captured by a target camera device; Adjust the initial camera device according to the target distribution relationship to obtain the target camera device; Wherein, determining the target distribution relationship between the lens and the camera according to the target object information comprises: determining a first area matching the object position in the target field of view, wherein the first area is the distribution area of the target object in the target field of view, and the target object information comprises the object position; determining a target angle relationship between the lens and the camera as the target distribution relationship according to the relationship between the first area and the field of view center of the target field of view, wherein the target angle relationship is used to move the ghost image of the target object formed by the lens in the camera out of the target field of view; The method of determining the target angle relationship between the lens and the camera as the target distribution relationship based on the relationship between the first area and the center of the field of view of the target field of view includes: determining the angle direction between the lens and the mirror surface of the camera based on the relationship between the first area and the center of the field of view of the target field of view; determining the angle between the lens and the mirror surface of the camera based on the field of view angle of the camera in the angle direction, wherein the target angle relationship includes the angle direction and the angle, and the ghost image formed by the lens and the camera distributed according to the angle direction and the angle falls outside the target field of view; The method of determining the angle between the lens and the mirror surface of the camera according to the field of view angle of the camera in the angle direction includes: calculating the product value of the field of view angle and a target coefficient, wherein the target coefficient is a coefficient that matches a target angle, and the target angle is the angle between a line connecting the target object and the center of the camera and a line connecting the field of view center and the center of the camera; determining the angle according to the sum of the product value and a target compensation value, wherein the target compensation value matches the camera, and the angle is greater than or equal to the sum.
2. The method according to claim 1, characterized in that The step of determining the angle direction between the lens and the mirror surface of the camera according to the relationship between the first area and the center of the field of view of the target field of view includes: Determine, within the target visual field, a second area that is symmetrical to the first area relative to the center of the visual field; The direction of the second area relative to the first area is determined as the angle direction.
3. The method according to claim 1, characterized in that The step of obtaining target object information within a target field of view of an initial camera device includes: Acquire a field of view image within the target field of view that is allowed to be captured by the initial camera; Identifying the pixel brightness of each pixel in the field of view image; Determine a pixel point whose pixel brightness is greater than or equal to the target brightness as a target pixel point corresponding to the target object; The position of the target pixel point on the field of view image is determined as the object position of the target object within the target field of view, wherein the target object information includes the object position.
4. The method according to claim 1, characterized in that: The step of adjusting the initial camera device according to the target distribution relationship to obtain the target camera device includes: Determining an initial distribution relationship between the lenses and the cameras in the initial camera device; Determine the difference between the target distribution relationship and the initial distribution relationship as the adjustment value of the lens; The distribution positions of the lenses in the initial imaging device are adjusted according to the adjustment values to obtain the target imaging device.
5. An optical imaging device for eliminating ghost images, characterized in that: include: an acquisition module, used for acquiring target object information within a target field of view of an initial camera device, wherein the target object information is used for indicating the distribution of the target object within the target field of view, the initial camera device comprises a lens and a camera, and the camera is used for capturing an image of the target field of view through the lens; A determination module, used to determine a target distribution relationship between the lens and the camera according to the target object information, wherein the target distribution relationship is used to eliminate ghost images generated by the target object in an image captured by a target camera device; An adjustment module, used for adjusting the initial camera device according to the target distribution relationship to obtain the target camera device; The determination module includes: a first determination unit, configured to determine a first area matching the position of the object within the target field of view, wherein the first area is a distribution area of the target object within the target field of view, and the target object information includes the position of the object; a second determination unit, configured to determine a target angle relationship between the lens and the camera as the target distribution relationship based on a relationship between the first area and the field of view center of the target field of view, wherein the target angle relationship is used to move a ghost image of the target object formed by the lens in the camera out of the target field of view; The second determination unit is used to: determine the angle direction between the lens and the mirror surface of the camera according to the relationship between the first area and the field of view center of the target field of view; determine the angle angle between the lens and the mirror surface of the camera according to the field of view angle of the camera in the angle direction, wherein the target angle relationship includes the angle direction and the angle angle, and the ghost image formed by the lens and the camera distributed according to the angle direction and the angle angle of the target object falls outside the target field of view; The second determination unit is used to: calculate the product value of the field of view angle and the target coefficient, wherein the target coefficient is a coefficient that matches the target angle, and the target angle is the angle between the line connecting the target object and the center of the camera and the line connecting the field of view center and the center of the camera; determine the angle according to the sum of the product value and the target compensation value, wherein the target compensation value matches the camera, and the angle is greater than or equal to the sum.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program implements the method according to any one of claims 1 to 4 when executed by a processor.
7. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 4 through the computer program.
Citation Information
Patent Citations
Method for eliminating ghost image in endoscope system
CN105167735A