A shooting method, device and system for removing ambient light
By acquiring images under different lighting conditions using a line scan camera and performing subtraction operations, the problem of ambient light interference with machine vision imaging is solved, achieving efficient and accurate image data acquisition, which is suitable for surface defect identification and detection in machine vision.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU RAINPOO TECH CO LTD
- Filing Date
- 2022-11-24
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, the influence of ambient light on machine vision imaging has not been effectively removed, resulting in interference with image results and affecting the accuracy of object feature judgment.
A line scan camera is used for shooting. The first and second images are acquired under different lighting conditions using the same line scan camera. Ambient light interference is removed by image subtraction. By taking advantage of the high resolution and short time interval of the line scan camera, combined with the synchronous control of relative motion and compensating light source, efficient and continuous image data is obtained.
It effectively reduces the impact of ambient light changes on image results, improves image accuracy and acquisition efficiency, and is suitable for surface defect recognition and detection in machine vision.
Smart Images

Figure CN115841570B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image technology, and in particular to a method, apparatus and system for removing ambient light during shooting. Background Technology
[0002] In existing technologies, ambient light (background light, sunlight) interferes with the light source to be captured in various applications. For example: when structured light (light with an optical pattern) is projected onto an object, the captured image is of the object onto which the structured light was projected; when a light source provides supplemental lighting to a camera, the superposition of ambient light can cause overexposure or other effects during camera capture; when a light source excites an object to produce light, and the excitation light is imaged to determine the characteristics of the object, such as using photoluminescence technology to detect defects in photovoltaic panels; or in other scenarios where ambient light interference needs to be removed.
[0003] Regarding the application of machine vision imaging in safety assurance, in order to eliminate the influence of ambient light on the image results, the existing technology uses the subtraction of images with and without light sources to remove ambient light. For example, the patent application document with application number CN201910918496.3 provides an imaging component and image imaging method that shields ambient light interference. In the specific technical solution, by setting a compensation light source, an image sensor is used to obtain a first image signal when the compensation light source is in the on state and a second image signal when the compensation light source is in the off state. Then, through image subtraction operation (CCD photosensitive charge subtraction operation is performed on the first image signal and the second image signal), an image (image signal) with ambient light interference removed is obtained.
[0004] Further optimization of image removal technology for ambient light interference will promote the application of machine vision in object feature judgment. Summary of the Invention
[0005] To address the aforementioned technical problem of further optimizing image ambient light removal techniques, which would enhance the application of machine vision in object feature identification, this invention provides a method, apparatus, and system for capturing images with ambient light removed. The technical solution provided by this invention can effectively reduce the impact of ambient light changes on image results.
[0006] To address the above problems, the present invention provides a method for removing ambient light during photography, which solves the problem through the following technical points: A method for removing ambient light during photography includes the following steps performed sequentially:
[0007] S1. Acquire a first image and a second image through a camera, wherein the first image is an image under the influence of a compensated light source, and the second image is an image without the influence of a compensated light source;
[0008] S2. Perform image subtraction on the second image using the first image to obtain the calculated image;
[0009] The characteristic feature is that the first image and the second image are acquired using the same linear scan camera;
[0010] The line scan camera takes pictures of the object in the following way: the line scan camera moves in a straight line relative to the object, and takes multiple pictures of the object during the relative movement.
[0011] In terms of acquisition timing, in two adjacent shots, one shot is used to acquire the first image and the other shot is used to acquire the second image; in three adjacent shots, the first shot and the third shot are both used to acquire the first image or the second image, and the shooting areas of the first shot and the third shot are adjacent or intersecting.
[0012] In this scheme, the function of the compensation light source should be understood as follows: the line scan camera captures an image of the object under the illumination of the compensation light source or an image of the object under corresponding excitation light caused by photoluminescence induced by the compensation light source. This image is used to obtain the first image as described above. The first image is an image under the combined effect of ambient light and the compensation light source, while the line scan camera also captures an image of the object under ambient light only. This image can be used to obtain the second image as described above. Regarding the calculated image mentioned in step S2, the calculated image is the image obtained by subtraction operation after shielding ambient light interference. The first image and the second image can be images obtained from a single camera shot, or they can be images obtained from two or more shots stitched together, with the stitched image serving as the corresponding first and second images. The acquisition sequence refers to the order in time. Meanwhile, the types of photos obtained by the linear array camera in the acquisition sequence were relative, namely: in any two adjacent shots, one shot was taken under the influence of compensated light source and ambient light, and the resulting photo was used to form the first image; the other shot was taken under the influence of ambient light only, and the resulting photo was used to form the second image; since the shooting areas of the first and third shots intersect or connect in the three adjacent shots, the shooting area of the second shot is: partially overlapping with the shooting area of the first shot and partially overlapping with the shooting area of the third shot.
[0013] Unlike existing technologies, this solution limits the camera used for image acquisition: the first and second images are acquired using the same line scan camera. By limiting the shooting area and background light (with or without compensation light source) related to the timing / shooting sequence during the shooting process, the following objectives are achieved: It not only obtains two images for image subtraction under different lighting conditions, but also effectively reduces the impact of ambient light changes on the image results. In existing technologies, obtaining images under compensation light and images without compensation light is achieved using area scan cameras. Line scan cameras, however, have shorter data readout times and smaller shooting intervals compared to area scan cameras. When a line scan camera is used to continuously capture images of the corresponding shooting area along the moving path of the subject, it has the characteristic of short time intervals between adjacent shots. Thus, for a given area, the time interval between images captured under compensation light and images captured only under ambient light is short, allowing for faster image acquisition. The method minimizes the impact of ambient light changes on image results by reducing the likelihood and magnitude of such changes. Furthermore, the limitation of the shooting area boundary is designed to address the line-scanning characteristics of a linear scan camera. This ensures that images acquired under the compensated light source and images not under the compensated light source are captured intermittently, but the specific shooting area continuously covers the surface. When used for surface defect recognition based on machine vision, this allows for the identification of a continuous region. Additionally, existing linear scan cameras are typically used to detect continuous materials (material surfaces), leveraging their high resolution to effectively improve image accuracy. Moreover, the relative motion described above allows for control of the shooting area boundary by adjusting the speed of the relative motion. Therefore, this method not only shortens the time interval between acquiring two images of the same area under different lighting conditions but also conforms to the principle of continuous line-scanning, resulting in high image acquisition efficiency.
[0014] As a further technical solution to the aforementioned method for removing ambient light during shooting:
[0015] Based on the above concept, for the application with the highest shooting efficiency, it is set as follows: in four adjacent shots, the coverage area of the obtained photos on the subject is the first area, the second area, the third area, and the fourth area in chronological order.
[0016] The edges of the first region and the third region are connected, and the edges of the second region and the fourth region are connected;
[0017] Both the first and third regions overlap with the second region. Based on this concept, if the first region is photographed to form the first image, then the second region is photographed to form the second image, the third region is photographed to form the first image, and the fourth region is photographed to form the second image. Thus, when both the first and second images are stitched images, obtaining the corresponding stitched image only requires edge stitching of photos taken under the same lighting conditions, effectively ensuring the efficiency of this photographing method. Unlike the first and third photographs mentioned above where the shooting areas intersect, this method requires the fewest photos to achieve continuous coverage of the object's surface. For ease of speed control and trigger control, if the relative motion is uniform, the trigger times of the line scan camera are evenly distributed along the timeline. However, due to limitations in the control and driving equipment precision involved in the relative motion acquisition process, under less than ideal conditions, such as fluctuations in movement speed, there may be some error in the positional relationships (the junction of the first and third regions, and the junction of the second and fourth regions). However, this will not affect the overall effect or the final detection objective when used for detecting fine cracks or scratches. Of course, when implementing this solution, those skilled in the art can also determine the relative positions of the first and second regions based on other variables, such as two feature points on the second region image: the relative positions of the two feature points on the second region image are the accurate positions of the two feature points, and one feature point also appears on the first region image and the other feature point also appears on the third region image. Based on the reflection of other feature points between the two features on the second region image on the first and third region images, it can be determined whether the error has occurred. When it is determined that the edge connection has deviated, the shooting trigger time can be controlled by identifying the position of the feature points on the image to achieve the corresponding purpose. Alternatively, the following methods can be used: For example, in the first, second, third, and fourth regions, from left to right, identify the features of the rightmost pixel in the first region image and the features of the leftmost pixel in the third region image. Determine the relative positions of these two features in the second region image. If these two features are adjacent pixels in the second region image and satisfy the left-right relationship, it can be concluded that the edges are connected as described above. When it is determined that these two features are separated pixels in the second region image or the left-right relationship has changed, it can be concluded that the aforementioned error has occurred. Based on the pixel column misalignment, the timing of the photo capture can be controlled.
[0018] When applied to the detection of point defects on the surface of an object, for both shooting under compensated light and shooting under ambient light only, it is preferable that the shooting areas of two adjacent shots overlap to avoid missing defects. Therefore, a different approach can be adopted: in four adjacent shots, the coverage areas of the obtained images on the object are sequentially designated as the first region, the second region, the third region, and the fourth region, according to the time sequence.
[0019] The first region and the third region have a set overlap rate, and the second region and the fourth region have a set overlap rate;
[0020] Both the first and third regions overlap with the second region. This solution differs from the above in that the relative motion speed is consistent with the edge-connecting solution, the size and shape of the coverage area on the subject are consistent, and a denser set of trigger points can be used on the timeline. If a stitched image is used as the first and second images, some pixel misalignment is permissible to ensure complete coverage of the subject's surface. Therefore, this solution has relatively lower shooting efficiency, but comprehensiveness is more easily guaranteed.
[0021] As described above, for the subject being photographed, the image acquisition using a line scan camera is generally done in a progressive scan manner. As a compensation light source, it can serve the acquisition of the first image in a way that provides sufficient and uniform brightness. The configuration is as follows: the compensation light source is provided by a line scan light source; during the shooting process of the line scan camera, when it is used to obtain a photograph as the first image, the line scan light source is turned on; when it is used to obtain a photograph as the second image, the line scan light source is turned off.
[0022] The linear array light source and the linear array camera are positioned with a fixed relative position. During the shooting process, the linear array light source and the linear array camera move synchronously relative to the subject. In this solution, the linear array light source provides sufficient brightness and uniform brightness at each illumination position. The fixed relative position and synchronous movement constitute a method in which the camera and the compensation light source move synchronously relative to the subject, allowing the illumination area of the supplementary light source and the shooting area to move synchronously on the subject. This simplifies the control strategy.
[0023] Specifically, for the region arrangement relationship with a set overlap rate mentioned above, in order to reduce the amount of data and the number of calculations in image subtraction operations, it is set that: both the first image and the second image are stitched together from multiple photos.
[0024] In step S1, multiple photos obtained under the effect of the compensated light source are stitched together to obtain the first image; multiple photos obtained without the effect of the compensated light source are stitched together to obtain the second image.
[0025] In step S2, the first and second images, which are both stitched images, are subjected to image subtraction to obtain the calculated image.
[0026] In the specific implementation of this scheme, due to the characteristics of clear images and large image data volume obtained by this scheme, in order to improve the efficiency of image acquisition, the amount of data processed per session and the number of data processing sessions are controlled as follows: In step S2, the first image is a stitched image obtained by stitching together the images obtained after multiple shots by the line scan camera; the second image is a stitched image obtained by stitching together the images obtained after multiple shots by the line scan camera; both stitched images are partial images of the target area of the photographed object. In this scheme, both the first and second images are defined as stitched images. After stitching, image subtraction is performed, which can reduce the number of times the image is acquired for calculation. By setting the above stitched images to be partial images of the target area of the photographed object, that is, the first and second images are both partial images stitched together and then used to obtain the image for calculation, it is avoided that the stitched images are too large, which would make the image acquisition process inconvenient or place excessive demands on hardware and software.
[0027] This solution also discloses a shooting device for removing ambient light. This device is used to perform the shooting method described above and includes a camera, a compensation light source, and a control module. The camera is a line scan camera, which acquires a first image and a second image. The first image is an image under the influence of the compensation light source, and the second image is an image excluding the influence of the compensation light source. The control module controls the operation of the camera and the compensation light source, such that:
[0028] During the linear motion of the line scan camera relative to the subject, the line scan camera takes multiple pictures of the subject.
[0029] In terms of acquisition timing, in two adjacent shots, one shot is used to acquire the first image, and the other shot is used to acquire the second image; in three adjacent shots, the first and third shots are both used to acquire the first or second image, and the shooting areas of the first and third shots are adjacent or intersecting. The shooting device provided in this solution serves the above shooting method. Its difference from existing ambient light removal shooting devices is that it uses a line scan camera. Furthermore, by defining the purpose and relationship of adjacent shots in the line scan camera shooting process, it can effectively reduce the impact of ambient light changes on the image result (computed image). As will be understood by those skilled in the art, the control module includes a control program that implements the shooting method, and this control program can be executed by a processor.
[0030] As a further technical solution for the aforementioned imaging device for removing ambient light:
[0031] As an integrated solution or complete product, it is configured to include a drive mechanism for driving the camera and / or the subject to move in space to obtain the aforementioned relative motion state. Those skilled in the art will recognize that generating the aforementioned relative motion state can be achieved through the movement of the subject, such as installing this device on a railway track to identify faults on the underside of a train aligning with the subject; or through the shooting device itself, such as mounting this device on an aircraft for inspecting the surface of photovoltaic panels.
[0032] This solution also discloses a shooting system for removing ambient light, including a shooting device and a data processing device. The shooting device is the same as described above, and the data processing device is used to process the image obtained by the shooting device. The processing involves subtracting a second image from a first image to obtain a calculated image. The shooting system proposed in this solution differs from the shooting device described above, further supplementing the system composition for implementing the shooting method. The shooting device can be considered as a front-end device or data acquisition terminal for implementing the corresponding shooting method. In this shooting system, the shooting device and the data processing device are combined, with the data processing device serving as the image data processing unit, ultimately achieving the shooting method described above.
[0033] As a further technical solution to the aforementioned ambient light removal shooting system:
[0034] To improve the utilization rate of the data processing device and reduce the implementation cost of this shooting method, the shooting device and the data processing device are configured as separate units. After the shooting device completes the set shooting task, the data stored in the shooting device is transferred to the data processing device for processing. In this scheme, it can be understood that the separate structure means there is no structural connection between the shooting device and the data processing device; both are independent functional modules. The data processing device can be used to serve different shooting devices, configured as a data processing center to provide data processing services for the obtained images. Furthermore, the data processing device is configured as a cloud server to maximize the integration of social resources and utilize data processing devices with stronger computing power.
[0035] The present invention has the following beneficial effects:
[0036] This solution limits the camera used for image acquisition: the first and second images are acquired using the same line scan camera. By limiting the shooting area and background light (with or without compensation light source) related to the timing / shooting sequence during the shooting process, the following objectives are achieved: It not only obtains two images for image subtraction under different lighting conditions, but also effectively reduces the impact of ambient light changes on the image results. In existing technologies, obtaining images under compensation light source conditions and images without compensation light source conditions is achieved using area scan cameras. Line scan cameras, however, have shorter data readout times and smaller shooting intervals compared to area scan cameras. When a line scan camera is used to continuously capture images of the corresponding shooting area along the moving path of the object, it has the characteristic of short time intervals between adjacent shots. Thus, for a given area, the time interval between images captured under compensation light source conditions and images captured only under ambient light conditions is short, utilizing the smaller time interval for ambient light changes. This approach minimizes the impact of ambient light variations on image results due to its lower probability of changes and smaller potential for ambient light variations. Furthermore, the limitation of the shooting area boundary is designed to address the line-scanning characteristics of a linear scan camera. This ensures that images acquired under the compensated light source and images not under the compensated light source are captured intermittently, but the specific shooting area continuously covers the surface. When used for surface defect recognition based on machine vision, this allows for the identification of a continuous region. Additionally, existing linear scan cameras are typically used to detect continuous materials (material surfaces), leveraging their high resolution to effectively improve image accuracy. Moreover, the boundary relationship of the shooting area can be controlled by adjusting the speed of the relative motion, thus this approach not only shortens the time interval between acquiring two images of the same area under different lighting conditions but also conforms to the principle of continuous line-scanning, resulting in high image acquisition efficiency.
[0037] The shooting device and shooting system are used to implement the shooting method. Attached Figure Description
[0038] Figure 1 This is an example of the coverage area of four consecutive photographs on the subject obtained in one application embodiment of the shooting method for removing ambient light described in this solution.
[0039] Figure 2 To adopt Figure 1 The provided shooting method involves filtering multiple photos obtained in chronological order.
[0040] Figure 1 The accompanying labels are as follows: 1. Subject photographed. Detailed Implementation
[0041] The present invention will be further described in detail below with reference to the embodiments, but the present invention is not limited to the following embodiments:
[0042] Example 1:
[0043] like Figure 1 and Figure 2 As shown, a method for removing ambient light during photography includes the following steps performed sequentially:
[0044] S1. Acquire a first image and a second image through a camera, wherein the first image is an image under the influence of a compensated light source, and the second image is an image without the influence of a compensated light source;
[0045] S2. Perform image subtraction on the second image using the first image to obtain the calculated image;
[0046] The characteristic feature is that the first image and the second image are acquired using the same linear scan camera;
[0047] The method of the line scan camera to photograph object 1 is as follows: the line scan camera moves in a straight line relative to object 1, and during the relative movement, the line scan camera takes multiple pictures of object 1.
[0048] In terms of acquisition timing, in two adjacent shots, one shot is used to acquire the first image and the other shot is used to acquire the second image; in three adjacent shots, the first shot and the third shot are both used to acquire the first image or the second image, and the shooting areas of the first shot and the third shot are adjacent or intersecting.
[0049] In this scheme, the function of the compensation light source should be understood as follows: the line scan camera captures an image of the object 1 under the illumination of the compensation light source or an image of the object 1 under the corresponding excitation light caused by the compensation light source. This image is used to obtain the first image as described above. The first image is an image under the combined effect of ambient light and the compensation light source, while the line scan camera also captures an image of the object 1 under ambient light only. This image can be used to obtain the second image as described above. Regarding the calculated image mentioned in step S2, the calculated image is the image obtained by subtraction operation after shielding ambient light interference. The first image and the second image can be images obtained from a single camera shot, or images obtained from two or more shots can be stitched together to form the corresponding first and second images. The acquisition sequence refers to the order in time. Meanwhile, the types of photos obtained by the linear array camera in the acquisition sequence were relative, namely: in any two adjacent shots, one shot was taken under the influence of compensated light source and ambient light, and the resulting photo was used to form the first image; the other shot was taken under the influence of ambient light only, and the resulting photo was used to form the second image; since the shooting areas of the first and third shots intersect or connect in the three adjacent shots, the shooting area of the second shot is: partially overlapping with the shooting area of the first shot and partially overlapping with the shooting area of the third shot.
[0050] Unlike existing technologies, this solution limits the camera used for image acquisition: the first and second images are acquired using the same line scan camera. By limiting the shooting area and background light (with or without compensation light source) related to the timing / shooting sequence during the shooting process, the following objectives are achieved: It not only obtains two images for image subtraction under different lighting conditions, but also effectively reduces the impact of ambient light changes on the image results. In existing technologies, obtaining images under compensation light and images without compensation light is achieved using area scan cameras. Line scan cameras, however, have shorter data readout times and smaller shooting intervals compared to area scan cameras. When a line scan camera is used to continuously capture images of the corresponding shooting areas along the moving path relative to the object 1, the short time interval between adjacent shots ensures that, for a given area, the time interval between images captured under compensation light and images captured only under ambient light is short. This allows for the use of smaller time intervals... The method minimizes the impact of ambient light changes on image results by reducing the likelihood and magnitude of such changes. Furthermore, the limitation of the shooting area boundary is designed to address the line-scanning characteristics of a linear scan camera. This ensures that images acquired under the compensated light source and images not under the compensated light source are captured intermittently, but the specific shooting area continuously covers the surface. When used for surface defect recognition based on machine vision, this allows for the identification of a continuous region. Additionally, existing linear scan cameras are typically used to detect continuous materials (material surfaces), leveraging their high resolution to effectively improve image accuracy. Moreover, the boundary relationship of the shooting area can be controlled by adjusting the speed of the relative motion, thus this method not only shortens the time interval between acquiring two images of the same area under different lighting conditions but also conforms to the principle of continuous line-scanning, resulting in high image acquisition efficiency.
[0051] Example 2:
[0052] This embodiment is a further refinement of embodiment 1:
[0053] Based on the above concept, for the application with the highest shooting efficiency, it is set as follows: in four adjacent shots, in chronological order, the coverage area of the obtained photos on the photographed object 1 is the first area, the second area, the third area, and the fourth area, respectively.
[0054] The edges of the first region and the third region are connected, and the edges of the second region and the fourth region are connected;
[0055] Both the first and third regions overlap with the second region. Based on this concept, if the first region is photographed to form the first image, then the second region is photographed to form the second image, the third region is photographed to form the first image, and the fourth region is photographed to form the second image. Thus, when both the first and second images are stitched images, obtaining the corresponding stitched image only requires edge stitching of photos taken under the same lighting conditions, effectively ensuring the efficiency of this photographing method. Unlike the first and third photographs mentioned above where the shooting areas intersect, this method requires the fewest photos to achieve continuous coverage of the object's surface. To facilitate speed control and trigger control, if the relative motion is uniform, the trigger times of the line scan camera are evenly distributed along the timeline. However, due to limitations in the control and driving equipment precision involved in the relative motion acquisition process, under less than ideal conditions, such as fluctuations in movement speed, there may be some error in the positional relationships (the junction of the first and third regions, and the junction of the second and fourth regions). However, this will not affect the overall effect or the final detection objective when used for detecting fine cracks or scratches. Of course, when implementing this solution, those skilled in the art can also determine the relative positions of the first and second regions based on other variables, such as two feature points on the second region image: the relative positions of the two feature points on the second region image are the accurate positions of the two feature points, and one feature point also appears on the first region image and the other feature point also appears on the third region image. Based on the reflection of other feature points between the two features on the second region image on the first and third region images, it can be determined whether the error has occurred. When it is determined that the edge connection has deviated, the shooting trigger time can be controlled by identifying the position of the feature points on the image to achieve the corresponding purpose. Alternatively, the following methods can be used: For example, in the first, second, third, and fourth regions, from left to right, identify the features of the rightmost pixel in the first region image and the features of the leftmost pixel in the third region image. Determine the relative positions of these two features in the second region image. If these two features are adjacent pixels in the second region image and satisfy the left-right relationship, it can be concluded that the edges are connected as described above. When it is determined that these two features are separated pixels in the second region image or the left-right relationship has changed, it can be concluded that the aforementioned error has occurred. Based on the pixel column misalignment, the timing of the photo capture can be controlled.
[0056] Example 3:
[0057] This embodiment is a further refinement of embodiment 1:
[0058] When applied to the detection of point defects on the surface of object 1, for both the multiple shots under compensated light source and the multiple shots under ambient light only, it is preferable that the shooting areas of two adjacent shots overlap to avoid missing defects. Unlike Example 2, the following scheme can be adopted: in four adjacent shots, the coverage areas of the obtained photos on object 1 are, in chronological order, the first region, the second region, the third region, and the fourth region.
[0059] The first region and the third region have a set overlap rate, and the second region and the fourth region have a set overlap rate;
[0060] Both the first and third regions overlap with the second region. This solution differs from the above in that the relative motion speed is consistent with the edge-connecting solution, the size and shape of the coverage area on the object 1 are consistent, and a denser set of trigger points can be used on the timeline. If a stitched image is used as the first and second images, some pixel misalignment is permissible to ensure complete coverage of the object 1 surface. Therefore, this solution has relatively lower shooting efficiency, but comprehensiveness is more easily guaranteed.
[0061] Example 4:
[0062] This embodiment is a further refinement of embodiment 1:
[0063] As described above, for the object 1 being photographed, the image acquisition using a line scan camera is generally done in a line-by-line scanning manner. As a compensation light source, it can serve the acquisition of the first image in a way that provides sufficient and uniform brightness. The configuration is as follows: the compensation light source is provided by a line scan light source; during the shooting process of the line scan camera, when it is used to obtain a photograph as the first image, the line scan light source is turned on; when it is used to obtain a photograph as the second image, the line scan light source is turned off.
[0064] Example 5:
[0065] This embodiment is a further refinement of embodiment 4:
[0066] The linear array light source and the linear array camera are fixed in relative position. During the shooting process, the linear array light source and the linear array camera move synchronously relative to the object being photographed 1. In this solution, while the linear array light source provides sufficient brightness and uniform brightness at each illumination position, the fixed relative position and synchronous movement constitute a method in which the camera and the compensation light source move synchronously relative to the object being photographed 1. This allows the illumination area of the supplementary light source and the shooting area to move synchronously on the object being photographed 1, which simplifies the control strategy.
[0067] Example 6:
[0068] This embodiment is a further refinement of embodiment 1:
[0069] Specifically, for the region arrangement relationship with a set overlap rate mentioned above, in order to reduce the amount of data and the number of calculations in image subtraction operations, it is set that: both the first image and the second image are stitched together from multiple photos.
[0070] In step S1, multiple photos obtained under the effect of the compensated light source are stitched together to obtain the first image; multiple photos obtained without the effect of the compensated light source are stitched together to obtain the second image.
[0071] In step S2, the first and second images, which are both stitched images, are subjected to image subtraction to obtain the calculated image.
[0072] In the specific implementation of this scheme, due to the characteristics of clear images and large image data volume obtained by this scheme, in order to improve the efficiency of image acquisition, the amount of data processed per session and the number of data processing sessions are controlled as follows: In step S2, the first image is a stitched image obtained by stitching together the images obtained after multiple shots by the line scan camera; the second image is a stitched image obtained by stitching together the images obtained after multiple shots by the line scan camera; both stitched images are partial images of the target area of the photographed object 1. In this scheme, both the first and second images are defined as stitched images. After stitching, image subtraction is performed, which can reduce the number of times the image is acquired for calculation. By setting the above stitched images to be partial images of the target area of the photographed object 1, that is, the first and second images are both partial images stitched together and then used to obtain the image for calculation, it is avoided that the stitched images are too large, which would make the image acquisition process inconvenient or place excessive demands on hardware and software.
[0073] Example 7:
[0074] This embodiment, based on Embodiment 1, provides a shooting device for removing ambient light. This shooting device is used to perform the shooting method described above and includes a camera, a compensation light source, and a control module. The camera is a line scan camera, which acquires a first image and a second image. The first image is an image under the influence of the compensation light source, and the second image is an image excluding the influence of the compensation light source. The control module controls the operation of the camera and the compensation light source, such that:
[0075] During the linear relative motion of the line scan camera with respect to the object 1, the line scan camera takes multiple pictures of the object 1.
[0076] In terms of acquisition timing, in two adjacent shots, one shot is used to acquire the first image, and the other shot is used to acquire the second image; in three adjacent shots, the first and third shots are both used to acquire the first or second image, and the shooting areas of the first and third shots are adjacent or intersecting. The shooting device provided in this solution serves the shooting method shown in Embodiment 1. Its difference from existing ambient light removal shooting devices is that it uses a line scan camera. Furthermore, by defining the purpose and relationship of adjacent shots in the line scan camera shooting process, it can effectively reduce the impact of ambient light changes on the image result (computed image). As will be understood by those skilled in the art, the control module includes a control program that implements the shooting method, and this control program can be executed by a processor.
[0077] Example 8:
[0078] This embodiment is a further refinement of embodiment 7:
[0079] As an integrated solution or complete product, it is configured to include a drive mechanism for driving the camera and / or the object being photographed 1 to move in space to obtain the aforementioned relative motion state. Those skilled in the art will recognize that the aforementioned relative motion state can be generated by the movement of the object being photographed 1, such as by installing this device on a railway track to identify faults on the underside of a train aligning with the object being photographed 1; or by using this photographing device itself, such as by mounting it on an aircraft for inspecting the surface of photovoltaic panels.
[0080] Example 9:
[0081] This embodiment, based on Embodiment 7, provides a shooting system for removing ambient light, including a shooting device and a data processing device. The shooting device is the same as that described in Embodiment 7. The data processing device processes the image obtained by the shooting device by performing an image subtraction operation on a second image using a first image to obtain a calculated image. This proposed shooting system differs from the shooting device described above, further supplementing the system composition for implementing the shooting method. The shooting device can be considered as a front-end device or data acquisition terminal for implementing the corresponding shooting method. In this shooting system, the shooting device and the data processing device are combined, with the data processing device serving as the image data processing unit, ultimately achieving the shooting method described above.
[0082] Example 10:
[0083] This embodiment is a further refinement of embodiment 9:
[0084] To improve the utilization rate of the data processing device and reduce the implementation cost of this shooting method, the shooting device and the data processing device are configured as separate units. After the shooting device completes the set shooting task, the data stored in the shooting device is transferred to the data processing device for processing. In this scheme, it can be understood that the separate structure means there is no structural connection between the shooting device and the data processing device; both are independent functional modules. The data processing device can be used to serve different shooting devices, configured as a data processing center to provide data processing services for the obtained images. Furthermore, the data processing device is configured as a cloud server to maximize the integration of social resources and utilize data processing devices with stronger computing power.
[0085] Example 11:
[0086] This embodiment provides a specific implementation method based on embodiment 1:
[0087] like Figure 1 and Figure 2 A line scan camera is used, and the line scan camera moves relative to the object being photographed (1). For example, if the object being photographed is... Figure 1 When shooting in a strip shape, the camera moves relative to the length of the object 1. The long side of the line scan camera sensor is perpendicular to the length direction, and the short side is parallel to the length direction. The shooting area covers both ends of the width direction of the object 1. Furthermore, the camera alternates between shooting with and without a compensated light source, obtaining a first image and a second image respectively. A calculated image is then obtained through image subtraction. The line scan camera shoots as quickly as possible within its performance range (minimizing the interval between adjacent shots). The relative movement speed is set according to the relationship between adjacent shooting coverage areas, and the shooting positions of the interval images (two adjacent images under the compensated light source and two adjacent images without the compensated light source are considered the interval images) are continuous. After shooting, all images obtained under the compensated light source are extracted and stitched together to form a stitched image with light source, and all images without the compensated light source are extracted and stitched together to form a stitched image without light source. The stitched image with light source and the stitched image without light source are subtracted to obtain an image (calculated image) with ambient light removed. If the data volume of the stitched images with and without light sources is too large, depending on the system performance, only the images obtained under the compensated light source and the images not under the compensated light source can be stitched at a time.
[0088] The continuous shooting positions of interval images specifically refer to: if images under the effect of the compensated light source are shot first, ensuring that the shooting positions of all images under the compensated light source are continuous before and after each other, such as... Figure 1For a (left diagonal frame) and c (right diagonal frame), the images taken without the compensation light source and under the compensation light source have a small time interval and are approximately at the same position, such as... Figure 1 Images a and b (the bold box without diagonal lines on the left – the diagonal lines in the bold box are the same as those in a and c) share a common image coverage area. Furthermore, the positions of all images captured before and after the incident, excluding those affected by the compensating light source, are continuous or nearly continuous.
[0089] Images taken by a line scan camera before and after each other, under the same compensated light source, are in continuous position (e.g.) Figure 1 The continuity between a and c, and between b and d (the bold box without diagonal stripes on the right – the diagonal stripes in the bold box are the same as those in c), can achieve better stitching results. To ensure positional continuity, the shooting interval t and the moving speed v need to satisfy a certain relationship. Using the short side length d of the image sensor and the image scale, the short side length D of the shooting area can be obtained. Therefore, when the positions of the preceding and following images are continuous, the moving distance within the time interval t is D, i.e., t = D / v. Even in less ideal situations, if there are certain errors in the preceding and following positions due to fluctuations in moving speed, it will not affect the overall effect required for some detection tasks.
[0090] like Figure 1 A schematic diagram of the shooting area of object 1 by a line scan camera. a and b correspond to the images with and without the effect of the compensated light source, respectively. The images a and c under the effect of the compensated light source are captured in continuous positions, while the images b and d without the effect of the compensated light source are captured in continuous or approximately continuous positions.
[0091] Figure 2 This is a schematic diagram of image extraction and stitching from a line scan camera. Images a, c, ... under the influence of all compensated light sources are extracted and stitched together to form a stitched image with light source. Images b, d, ... without the influence of all compensated light sources are extracted and stitched together to form a stitched image without light source. The images are then subtracted to obtain the calculated image.
[0092] Alternatively, one can first capture an image outside the area affected by the compensating light source, and then capture an image under the compensating light source. However, this method is applicable to a specific image coverage area, resulting in a large time interval between capturing images outside and under the compensating light source. Changes in ambient light can affect the accuracy of the calculated image results.
[0093] The compensation light source is used to illuminate the subject 1, or to excite the subject 1 to produce excitation light after illuminating it, so that the line scan camera can capture images under the excitation light. The compensation light source is preferably a line light source that is matched with the line scan camera.
[0094] Regarding the image subtraction operation, one can first extract images with or without compensation light sources, and subtract them from each other. Then, the images obtained by subtracting the subtracted images are stitched together to obtain the calculated image.
[0095] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific embodiments of the present invention are limited to these descriptions. For those skilled in the art, other embodiments derived without departing from the technical solution of the present invention should be included within the scope of protection of the present invention.
Claims
1. A shooting method for removing ambient light, comprising the following steps performed sequentially: S1. Acquire a first image and a second image using a camera, wherein... The first image is the image under the influence of the compensated light source, and the second image is the image without the influence of the compensated light source. S2. Perform image subtraction on the second image using the first image to obtain the calculated image; The characteristic feature is that the first image and the second image are acquired using the same linear scan camera; The line scan camera takes pictures of the object in the following way: the line scan camera moves in a straight line relative to the object, and takes multiple pictures of the object during the relative movement. In terms of acquisition timing, in two adjacent shots, one shot is used to acquire the first image and the other shot is used to acquire the second image; in three adjacent shots, the first shot and the third shot are both used to acquire the first image or the second image, and the shooting areas of the first shot and the third shot are adjacent or intersecting.
2. The shooting method for removing ambient light according to claim 1, characterized in that, In four consecutive shots, the areas covered by the photographs on the subject are, in chronological order, the first area, the second area, the third area, and the fourth area, respectively. The edges of the first region and the third region are connected, and the edges of the second region and the fourth region are connected; The first region and the second region have overlapping areas, and the third region and the second region have overlapping areas.
3. The shooting method for removing ambient light according to claim 1, characterized in that, In four consecutive shots, the areas covered by the photographs on the subject are, in chronological order, the first area, the second area, the third area, and the fourth area, respectively. The first region and the third region have a set overlap rate, and the second region and the fourth region have a set overlap rate; The first region and the second region have overlapping areas, and the third region and the second region have overlapping areas.
4. The shooting method for removing ambient light according to claim 1, characterized in that, The compensation light source is provided by a linear array light source; during the shooting process of the linear array camera, the linear array light source is turned on when it is used to obtain a photograph as the first image; and the linear array light source is turned off when it is used to obtain a photograph as the second image.
5. The shooting method for removing ambient light according to claim 4, characterized in that, The linear array light source and the linear array camera are fixed in relative position, and during the shooting process, the linear array light source and the linear array camera move synchronously with respect to the subject being photographed.
6. The shooting method for removing ambient light according to any one of claims 1 to 5, characterized in that, Both the first and second images are composed of multiple photographs stitched together. In step S1, multiple photos obtained under the effect of the compensated light source are stitched together to obtain the first image; multiple photos obtained without the effect of the compensated light source are stitched together to obtain the second image. In step S2, the first and second images, which are both stitched images, are subjected to image subtraction to obtain the calculated image.
7. A shooting device for removing ambient light, comprising a camera, a compensation light source, and a control module, characterized in that, The camera is a line scan camera, which acquires a first image and a second image. The first image is an image under the influence of the compensated light source, and the second image is an image without the influence of the compensated light source. The control module is used to control the camera and the compensation light source to achieve the following: During the linear motion of the line scan camera relative to the subject, the line scan camera takes multiple pictures of the subject. In terms of acquisition timing, in two adjacent shots, one shot is used to acquire the first image and the other shot is used to acquire the second image; in three adjacent shots, the first shot and the third shot are both used to acquire the first image or the second image, and the shooting areas of the first shot and the third shot are adjacent or intersecting.
8. The imaging apparatus for removing ambient light according to claim 7, characterized in that, It also includes a drive mechanism for driving the camera and / or the subject to move in space to obtain the relative motion state.
9. A shooting system for removing ambient light, comprising a shooting device and a data processing device, characterized in that, The shooting device is the shooting device according to claim 7 or 8, and the data processing device is used to process the image obtained by the shooting device. The processing is: using the first image to perform an image subtraction operation on the second image to obtain a calculated image.
10. The imaging system for removing ambient light according to claim 9, characterized in that, The shooting device and the data processing device are separate structures. After the shooting device completes the set shooting task, the data stored in the shooting device is transmitted to the data processing device to perform the processing.