Relative luminance correction method, related system, device and storage medium
By using an integrating sphere to adjust the imaging parameters and calculate the brightness ratio in a multispectral camera, a relative illumination file is generated, which solves the problem of uneven relative illumination when shooting from different angles in a multispectral camera, and achieves consistency in material brightness and accuracy in spectral identification.
Patent Information
- Application Number
- CN202211411069.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-11-10
AI Technical Summary
When multispectral cameras capture images from different angles, uneven relative illumination causes deviations in the spectral curves of substances, affecting the accuracy of spectral identification. Existing technologies struggle to achieve relative illumination correction without altering the performance of optical components.
By providing a uniform light source, such as an integrating sphere, adjusting the imaging parameters of a multispectral camera, acquiring multiple original photos, merging and calculating to generate a relative illumination photo, and setting the brightness ratio according to two-dimensional coordinates to generate a relative illumination file, the camera brightness is corrected to obtain the true brightness.
Without altering the performance of optical components, ensure consistent material brightness when photographed from different angles using a multispectral camera, thereby improving the accuracy of spectral identification and reducing the effects of non-uniformity and contamination.
Smart Images

Figure CN115908174B_ABST
Abstract
Description
[0001] The present application relates to the field of camera imaging technology, and in particular to a relative-illumination correction method, a relative-illumination correction system, a relative-illumination correction device, and a computer-readable storage medium, which are applied to a multispectral camera.
[0002] With the increasing application of multispectral cameras, multispectral cameras are commonly used in 3D vision and multispectral imaging applications. In various environments, especially in the open air under sunlight, it is necessary to use a multispectral camera. The center point of the imaging system of the multispectral camera has the maximum light flux, and the light flux decreases as the image height increases, which is referred to as the relative-illumination of the imaging system. For a multispectral camera (a plurality of cameras of different wavelengths capture the same substance), the application is to obtain the spectral curve of the substance by comparing the brightness of the substance on the imaging plane with a standard value. If the substance is under sunlight (a non-uniform light source requires other correction methods), due to the relative-illumination, there is a significant difference in the brightness of the substance imaged at different image height positions of the camera, which will cause the spectral curve to deviate and cause testing errors. To ensure that the brightness of the substance is consistent regardless of the position of the imaging plane, it is necessary to correct the relative-illumination of the imaging system. Real-time correction of the relative-illumination of the multispectral camera is necessary, otherwise the brightness of the captured substance will be affected by the position of the imaging plane, which will affect the accuracy of the spectral data and further affect the accuracy of the spectral identification of the substance. Therefore, the relative-illumination is an important factor affecting the imaging of the multispectral camera.
[0003] At present, the multispectral camera includes a spectral imaging system, and optical devices in the spectral imaging system include a lens, a sensor and a filter. Generally, the lens is the biggest factor causing low and uneven relative illumination. Therefore, the multispectral camera generally corrects the relative illumination in real time by correcting the lens. If a long-focus lens is used, the field of view of the lens is very small, for example, the field of view of a lens with a focal length of 80 mm is 1 / 20 of a lens with a focal length of 4 mm, and the relative illumination is still 5% or even greater. If a method of reducing the light aperture is used, the overall light quantity of the lens is very small, for example, the light quantity of a lens with an FNO of 16 is 1 / 64 of a lens with an FNO of 2, and the exposure time or gain of the camera needs to be very large, resulting in a decrease in frame rate or an increase in noise, and the influence of the relative illumination still exists. In order to reduce the relative illumination, that is, the light quantity difference between the center and the edge is small, a long-focus lens or a lens with a small light aperture (that is, a large FNO lens) can be generally used, but the application range will be limited. In addition, the correction of the lens alone cannot solve the influence caused by other optical devices (such as the sensor and the filter). Therefore, how to ensure that the camera can keep the brightness of the same material unchanged when shooting the same material at different angles in a uniform light source environment (such as sunlight) without changing any performance of the optical devices, so that the shooting image accurately reflects the reflected light intensity of the object in the field of view, thereby ensuring the correct identification of the material is a technical problem to be solved.
[0004] Therefore, it is necessary to provide a new method, system and device to solve the above technical problems. SUMMARY
[0005] The purpose of the present application is to overcome the above technical problems and provide a relative illumination correction method, a relative illumination correction system, a relative illumination correction device and a computer readable storage medium for shooting images without the influence of camera relative illumination.
[0006] In order to achieve the above purpose, in a first aspect, an embodiment of the present application provides a relative illumination correction method applied to a multispectral camera provided with a plurality of lenses; a uniform light source object is provided, and the multispectral camera is focused on the uniform light source object, and any position in the uniform light source object is regarded as a Lambertian light source, and the method comprises the following steps:
[0007] Step S1: adjusting the shooting parameters of the multispectral camera according to a preset target; the preset target is to ensure that the shot page does not appear overexposure;
[0008] Step S2, N original photos are taken, and before each taking, the position of the multispectral camera is moved and then the taking is performed, starting from the taking of the second original photo;
[0009] Step S3, N original photos are merged and calculated to generate a relative-illumination photo; the merging and calculating rule is:
[0010] The average value of the gray values of N original photos at any same pixel position is taken as the gray value of the relative-illumination photo at the corresponding pixel position;
[0011] Step S4, the length and width of the relative-illumination photo are set as two-dimensional coordinates, a plurality of coordinate points and a center point are set in the relative-illumination photo according to the two-dimensional coordinates, the brightness of each coordinate point is divided by the brightness of the center point to calculate the brightness ratio of the coordinate point, the relative-illumination file is generated by collecting the brightness ratios of all coordinate points, and the relative-illumination file is stored in the multispectral camera;
[0012] Step S5, when the multispectral camera is aligned to take a photo of a subject, the brightness of each coordinate point in the display image of the multispectral camera is divided by the brightness ratio of the coordinate point to obtain the real brightness of the subject which is not affected by the field position of the multispectral camera.
[0013] More preferably, the uniform light source object is an integrating sphere, the integrating sphere includes a hollow inner wall and an opening penetrating the inner wall, and the lens of the multispectral camera is focused on the inside of the integrating sphere through the opening.
[0014] More preferably, the uniform light source object is a whiteboard under parallel light.
[0015] More preferably, in step S2, the range of moving the position of the multispectral camera is that the lens of the multispectral camera is focused on the inside of the integrating sphere.
[0016] More preferably, in step S1, the taking parameters include the exposure time and the gain of the multispectral camera.
[0017] More preferably, in step S2, the moving manner of the multispectral camera includes rotation and displacement.
[0018] In a second aspect, the embodiments of the present application further provide a relative-illumination correction system, which applies the above relative-illumination correction method provided by the embodiments of the present application, and includes an integrating sphere and a multispectral camera.
[0019] The multispectral camera comprises a spectral imaging system, a storage unit and a processing unit, the processing unit is in data connection with the spectral imaging system and the storage unit respectively;
[0020] The spectral imaging system is used for taking an external object to form the original photo;
[0021] The storage unit is used for storing the original photo, the relative-illumination photo and the relative-illumination file;
[0022] The processing unit is used for merging and calculating N original photos to generate a relative-illumination photo; the processing unit is also used for setting the length and width of the relative-illumination photo as two-dimensional coordinates, setting a plurality of coordinate points and a center point in the relative-illumination photo according to the two-dimensional coordinates, dividing the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point, collecting the brightness ratios of all the coordinate points to generate a relative-illumination file, and storing the relative-illumination file in the storage unit; when the multispectral camera is aligned to take a photo of a to-be-taken object, the processing unit is also used for dividing the brightness of each coordinate point in the display image of the multispectral camera by the brightness ratio of the coordinate point to obtain the real brightness of the to-be-taken object which is not affected by the field position of the multispectral camera; the merging and calculating rule is that the average value of the gray values of N original photos at any same pixel position is taken as the gray value of the relative-illumination photo at the corresponding pixel position.
[0023] More preferably, the spectral imaging system comprises a lens assembly having a plurality of lenses to form a plurality of channels, a filter and a sensor, the lens assembly is arranged opposite to the opening; the processing unit is in data connection with the sensor.
[0024] In a third aspect, an embodiment of the present application further provides a relative-illumination correction device, comprising a processor and a memory, the processor is used for reading a program in the memory and executing steps in the above-mentioned relative-illumination correction method provided by an embodiment of the present application.
[0025] In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the program instructions are executed by a processor to realize steps in the above-mentioned relative-illumination correction method provided by an embodiment of the present application.
[0026] Compared with the prior art, the relative luminance correction method, the relative luminance correction system, the relative luminance correction device and the computer readable storage medium of the present application implement the following steps through the relative luminance correction method: step S1, adjusting the photographing parameters of the multi-spectrum camera according to the preset target; step S2, acquiring N original photos by shooting, and starting from the second original photo, moving the position of the multi-spectrum camera before shooting each time; step S3, merging and calculating N original photos to generate a relative luminance photo. By implementing steps S1 to S3, the rows of N original photos are merged and calculated to generate a relative luminance photo, which can effectively reduce the influence of non-uniformity and dirt. Then, the relative luminance correction method further implements the following steps: step S4, setting the length and width of the relative luminance photo as two-dimensional coordinates, setting a plurality of coordinate points and a center point in the relative luminance photo according to the two-dimensional coordinates, dividing the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point, collecting the brightness ratios of all coordinate points to generate a relative luminance file, and storing the relative luminance file in the multi-spectrum camera; step S5, when the multi-spectrum camera is aligned with the object to be photographed, dividing the brightness of each coordinate point in the display image of the multi-spectrum camera by the brightness ratio of the coordinate point to obtain the true brightness of the object to be photographed without being affected by the field position of the multi-spectrum camera. By implementing steps S4 to S5, dividing the image points at different image height positions by the corresponding proportional coefficients can make the multi-spectrum camera capture the same brightness photo when capturing the same object at different angles, thereby obtaining the true brightness of the object to be photographed. In summary, the relative luminance correction method of the present application can ensure that the multi-spectrum camera can maintain the brightness of the object to be photographed unchanged when capturing the same object under the same uniform light source environment (such as sunlight) at different angles without changing any performance of the optical device, so that the captured image accurately reflects the reflection intensity of the object to be photographed in the field of view, thereby ensuring the correct spectral identification of the object to be photographed. Therefore, the captured image is not affected by the relative luminance of the camera by using the relative luminance correction method, the relative luminance correction system, the relative luminance correction device and the computer readable storage medium of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0028] Figure 1 The flowchart of the relative luminance correction method of the present application;
[0029] Figure 2 The original photograph is shown in step S2 of the relative illumination correction method in this embodiment of the invention.
[0030] Figure 3 The relative illumination photograph with two-dimensional coordinates is set in step S4 of the relative illumination correction method in this embodiment of the invention.
[0031] Figure 4 The photograph of the object to be photographed in step S5 of the relative illumination correction method in this embodiment of the invention;
[0032] Figure 5 This is a structural block diagram of the relative illumination correction system of the present invention;
[0033] Figure 6 This is a structural block diagram of the relative illumination correction device of the present invention.
Detailed Implementation Methods
[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] This invention provides a relative illumination correction method. The relative illumination correction method is applied to a multispectral camera equipped with multiple lenses. The multispectral camera includes a spectral imaging system, which includes lenses, filters, and sensors. The lenses, filters, and sensors are all commonly used optical devices in the art.
[0036] When the relative illumination correction method is implemented, a uniform light source object is provided, and the multispectral light source is relatively focused on the uniform light source object, with any position in the uniform light source object serving as a Lambertian light source.
[0037] Please refer to Figure 1 As shown, Figure 1 This is a flowchart of the relative illumination correction method of the present invention. The relative illumination correction method includes the following steps:
[0038] Step S1: Adjust the imaging parameters of the multispectral camera according to the preset target.
[0039] The preset goal is to ensure that the page being photographed is not overexposed.
[0040] The imaging parameters include the exposure time and gain of the multispectral camera.
[0041] Step S2, N original photos are taken, and before taking each photo, the position of the multispectral camera is moved first.
[0042] The way of moving the multispectral camera includes rotation and displacement.
[0043] In this embodiment, the range of moving the position of the multispectral camera is that the lens of the multispectral camera is in focus on the inside of the integrating sphere.
[0044] Because in the spectral imaging system of the multispectral camera, the central image height position is the parallel light vertically incident to the lens, the light flux is the largest; the edge image height position is the parallel light obliquely incident to the lens, the light flux becomes smaller; and other image surface positions are gradually changed. Thus, the light of the uniform light source object is incident to the lens at different angles, and the brightness is different. Please refer to the following figure for details. Figure 2 As shown in the figure, Figure 2 The original photo in step S2 of the relative brightness correction method in this embodiment is the original photo actually taken by the multispectral camera. Figure 2 It can be obtained that the brightness of the original photo is not uniform, in which the brightness of the central position is the largest, and the brightness of the surrounding is weaker.
[0045] In this embodiment, the uniform light source object is an integrating sphere. The integrating sphere includes a hollow inner wall and an opening penetrating the inner wall. The lens of the multispectral camera is in focus on the inside of the integrating sphere through the opening. Of course, it is not limited to this, and it is also possible that the uniform light source object is other Lambertian bodies. For example, in another embodiment, the uniform light source object is a whiteboard under parallel light. The whiteboard under parallel light can also achieve the effect of the integrating sphere. Of course, using the integrating sphere can avoid the influence of ambient light, and the implementation is easier. Because it is easy to operate, the user experience is good.
[0046] In this embodiment, the integrating sphere is also provided with a light passing hole, which is used to receive the light emitted by the external multispectral light source, so that any one position in the inner wall is used as a Lambertian light source.
[0047] The integrating sphere is a cavity sphere with white diffuse reflection material coated on the inner wall, also known as a photometric sphere, a light tunnel sphere, etc. The inner wall of the integrating sphere is a good spherical surface, and it is usually required that the deviation of the inner wall relative to an ideal spherical surface should be not more than 0.2% of the inner diameter. The inner wall is coated with an ideal diffuse reflection material, i.e. a material with a diffuse reflection coefficient close to 1. The commonly used material is magnesium oxide or barium sulfate, which is mixed uniformly with a gum adhesive and sprayed on the inner wall. The spectral reflectance of the magnesium oxide coating in the visible spectrum range is all above 99%, so that the light entering the integrating sphere is reflected multiple times by the coating on the inner wall to form uniform illumination on the inner wall. In this embodiment, the light intensity received by the multispectral camera at any angle at the opening position of the integrating sphere is consistent, and the uniformity of each angle is above 98%.
[0048] Step S3: merging and calculating N original photos to generate a relative illumination photo.
[0049] The merging and calculating rule is that the average value of the gray values of N original photos at any same pixel position is taken as the gray value of the corresponding pixel position of the relative illumination photo.
[0050] By implementing steps S1 to S3, merging and calculating the rows of N+1 original photos to generate a relative illumination photo is realized. Since the integrating sphere still has 2% non-uniformity and the inside of the integrating sphere is inevitably dusty, the inside of the integrating sphere is photographed by the multispectral camera, and the photo is homogenized to generate the relative illumination photo, which can effectively reduce the influence of non-uniformity and dirt.
[0051] Step S4: setting the length and width of the relative illumination photo as two-dimensional coordinates, setting multiple coordinate points and a center point in the relative illumination photo according to the two-dimensional coordinates, dividing the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point, collecting the brightness ratios corresponding to all coordinate points to generate a relative illumination file, and storing the relative illumination file in the multispectral camera.
[0052] In this embodiment, the two-dimensional coordinates include horizontal axis coordinates and vertical axis coordinates, and the horizontal axis coordinates and the vertical axis coordinates are perpendicular to each other. Please refer to Figure 3 , Figure 3 The relative illumination photo in which the two-dimensional coordinates are set in step S4 of the relative illumination correction method in the embodiment of the application. Figure 3 The horizontal axis coordinates in the relative illumination photo are X. Figure 3 The vertical axis coordinates in the relative illumination photo are Y. The center point is P. One of the coordinate points is K.
[0053] Step S5, when the multi-spectrum camera is aligned to the object to be photographed, the brightness of each coordinate point in the display image plane of the multi-spectrum camera is divided by the brightness ratio of the coordinate point, and the real brightness of the object to be photographed which is not affected by the field position of the multi-spectrum camera is obtained.
[0054] Please refer to Figure 4 as shown, Figure 4 the photo of the object to be photographed in step S5 of the relative-illuminance correction method in the embodiment of the present application. Figure 4 The photo of the object to be photographed in step S5 of the relative-illuminance correction method in the embodiment of the present application is a photo with uniform brightness, and therefore, in the embodiment, the photo of the object to be photographed with the same brightness is obtained by implementing step 6.
[0055] In the embodiment, the multi-spectrum camera is a digital camera. The original photo and the relative-illuminance photo are both digital photos. That is, the photo of the object to be photographed with the same brightness can be directly generated by implementing the relative-illuminance correction method in the embodiment of the present application, thereby improving the efficiency of correcting the relative-illuminance and providing a good user experience.
[0056] By implementing steps S4 to S5, and specifically by dividing the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point in step S4, and by collecting the brightness ratios of all the coordinate points to generate a relative-illuminance file, and by dividing the brightness of each coordinate point in the display image plane of the multi-spectrum camera by the brightness ratio of the coordinate point in step 5, that is, by dividing the image points at different image height positions by the corresponding proportional coefficients, the multi-spectrum camera can obtain the photo of the object to be photographed with the same brightness when the object to be photographed is photographed at different angles.
[0057] The implementation of the above steps ensures that the relative-illuminance correction method of the present application can keep the brightness of the object to be photographed unchanged when the object to be photographed is photographed at different angles in a uniform light source environment (such as sunlight) without changing any performance of the optical device, so that the photographed image accurately reflects the reflection light intensity of the object to be photographed in the field of view, thereby ensuring the correct spectral identification of the object to be photographed. That is, the relative-illuminance correction method of the present application ensures that the brightness of the corrected photo is the same regardless of the angle at which the light of the object to be photographed is incident into the multi-spectrum camera. Therefore, the photographed image obtained by using the relative-illuminance correction method of the present application is not affected by the relative-illuminance of the camera.
[0058] The present application also provides a relative-illuminance correction system 100. The relative-illuminance correction system 100 applies the relative-illuminance correction method of the present application.
[0059] Please refer to Figure 5 as shown, Figure 5A structure block diagram of a relative-illuminance correction system 100 according to the present application. Specifically, the relative-illuminance correction system 100 comprises an integrating sphere 1 and a multi-spectrum camera 2.
[0060] The integrating sphere 1 is used to provide a uniform light source.
[0061] The integrating sphere 1 is in a spherical shape. The integrating sphere 1 comprises an inner wall 11 enclosing a hollow, and an opening 12 and a light hole 13 penetrating the inner wall 11,
[0062] The inner wall 11 is coated with a diffuse reflection material so that any position of the inner wall 11 is a Lambertian light source.
[0063] The opening 12 is arranged opposite to the multi-spectrum camera 2.
[0064] The light hole 13 is used to receive light emitted by an external multi-spectrum light source, so that any position of the inner wall 11 is a Lambertian light source.
[0065] The multi-spectrum camera 2 comprises a spectral imaging system 21, a storage unit 22 and a processing unit 23. The processing unit 23 is in data connection with the spectral imaging system 21 and the storage unit 22 respectively.
[0066] The spectral imaging system 21 is used to take an original photo of an external object.
[0067] The spectral imaging system 21 comprises a lens assembly 211 having multiple lenses forming multiple channels, a filter 212 and a sensor 213. The lens assembly 211 is arranged opposite to the opening 12. The processing unit 23 is in data connection with the sensor 213.
[0068] The storage unit 22 is used to store the original photo, the relative-illuminance photo and the relative-illuminance file.
[0069] The processing unit 23 is used to merge and calculate N original photos to generate a relative-illuminance photo. The rule of the merging and calculating is that the average value of the gray scale values of N original photos at any same pixel position is taken as the gray scale value of the relative-illuminance photo at the corresponding pixel position.
[0070] The processing unit 23 is also used to set the length and width of the relative-illuminance photo as two-dimensional coordinates, set multiple coordinate points and a center point in the relative-illuminance photo according to the two-dimensional coordinates, divide the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point, collect the brightness ratios of all the coordinate points to generate a relative-illuminance file, and store the relative-illuminance file in the storage unit 22.
[0071] The processing unit 23 is also configured to divide the brightness of each coordinate point in the display image plane of the multi-spectrum camera by the brightness ratio of the coordinate point to obtain the real brightness of the object to be photographed, which is not affected by the field position of the multi-spectrum camera.
[0072] It can be understood that the above-mentioned contents in the embodiment of the relative-illumination correction method are applicable to the embodiment of the relative-illumination correction system 100 of the present application. The embodiment of the relative-illumination correction system 100 of the present application has the same functions as the above-mentioned embodiment of the relative-illumination correction method, and achieves the same beneficial effects as the above-mentioned embodiment of the relative-illumination correction method.
[0073] The present application also provides a relative-illumination correction device 1000. Please refer to Figure 6 , which is a structural block diagram of the relative-illumination correction device 1000 of the present application. Figure 6
[0074] The relative-illumination correction device 1000 comprises a processor 1001, a memory 1002, a network interface 1003, and a computer program stored in the memory 1002 and executable on the processor 1001. The processor 1001 is configured to read the program in the memory 1002, and the processor 1001 implements the steps in the relative-illumination correction method provided by the embodiment when executing the computer program. That is, the processor 1001 executes the steps in the relative-illumination correction method.
[0075] Specifically, the processor 1001 is configured to execute the following steps:
[0076] Step S1: adjusting the photographing parameters of the multi-spectrum camera according to a preset target. The preset target is to ensure that the photographed page does not appear overexposure.
[0077] Step S2: acquiring N original photos, and moving the position of the multi-spectrum camera before photographing each time after acquiring the second original photo.
[0078] Step S3: merging and calculating N original photos to generate a relative-illumination photo. The merging and calculating rule is that the average value of the gray values of N original photos at any same pixel position is taken as the gray value of the relative-illumination photo at the corresponding pixel position.
[0079] Step S4, setting the length and width of the relative-illumination photo as two-dimensional coordinates, setting a plurality of coordinate points and a center point in the relative-illumination photo according to the two-dimensional coordinates, dividing the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point, collecting the brightness ratios of all the coordinate points to generate a relative-illumination file, and storing the relative-illumination file in the multi-spectrum camera.
[0080] Step S5, when the multi-spectrum camera is aligned to the object to be photographed, dividing the brightness of each coordinate point in the display image of the multi-spectrum camera by the brightness ratio of the coordinate point to obtain the real brightness of the object to be photographed which is not affected by the field position of the multi-spectrum camera.
[0081] The relative-illumination correction device 1000 provided by the embodiments of the present application can realize each embodiment of the relative-illumination correction method, and has corresponding beneficial effects. To avoid repetition, the details are not described here.
[0082] It should be noted that, Figure 6 The components 1001-1003 are only shown in the figure, but it should be understood that all the shown components are not required to be implemented, and more or less components can be alternatively implemented. Those skilled in the art can understand that the relative-illumination correction device 1000 is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and the hardware thereof is an embedded device.
[0083] The memory 1002 can be an internal storage unit of the relative-illumination correction device 1000, for example, a hard disk or a memory of the relative-illumination correction device 1000. In other embodiments, the memory 1002 can also be an external storage device of the relative-illumination correction device 1000. Of course, the memory 1002 can also include both the internal storage unit and the external storage device of the relative-illumination correction device 1000. In the embodiment, the memory 1002 is generally used to store the operating system and various application software installed in the relative-illumination correction device 1000, for example, the program code of the relative-illumination correction method of the relative-illumination correction device 1000. In addition, the memory 1002 can also be used to temporarily store various data that have been output or will be output.
[0084] The processor 1001 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 1001 is generally used to control the overall operation of the relative-illumination correction device 1000. In this embodiment, the processor 1001 is configured to run program codes or process data stored in the memory 1002, for example, program codes of the relative-illumination correction method of the relative-illumination correction device 1000.
[0085] The network interface 1003 may include a wireless network interface or a wired network interface, and is generally used to establish a communication connection between the relative-illumination correction device 1000 and other electronic devices.
[0086] The present application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, the program instructions being executed by the processor 1001 to implement the steps of the relative-illumination correction method and achieve the same technical effects. To avoid repetition, details are not described here.
[0087] Those of ordinary skill in the art can understand that all or part of the processes of the relative-illumination correction method of the relative-illumination correction device 1000 are implemented. In actual operation, the operator operates through a remote cloud platform and performs upgrade operations in the upgrade interface of the cloud platform. The program may include processes such as the embodiments of the method when executed.
[0088] The embodiments mentioned in the embodiments of the present application are for the convenience of description. The above disclosure only describes the preferred embodiments of the present application, and of course cannot limit the scope of the right of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
[0089] Compared with the prior art, the relative-illumination correction method, the relative-illumination correction system, the relative-illumination correction device and the computer readable storage medium of the present application implement the following steps through the relative-illumination correction method: step S1, adjusting the photographing parameters of the multi-spectrum camera according to a preset target; step S2, acquiring N original photos by photographing, and moving the position of the multi-spectrum camera before photographing each time after acquiring the second original photo; step S3, merging and calculating the N original photos to generate a relative-illumination photo. Through the implementation of steps S1 to S3, the rows of the N original photos are merged and calculated to generate a relative-illumination photo, which can effectively reduce the influence of non-uniformity and dirt. Then, the relative-illumination correction method further implements the following steps: step S4, setting the length and width of the relative-illumination photo as two-dimensional coordinates, setting a plurality of coordinate points and a center point in the relative-illumination photo according to the two-dimensional coordinates, dividing the brightness of each coordinate point by the brightness of the center point to calculate the brightness ratio of the coordinate point, collecting the brightness ratios of all the coordinate points to generate a relative-illumination file, and storing the relative-illumination file in the multi-spectrum camera; step S5, when the multi-spectrum camera photographs the object to be photographed, dividing the brightness of each coordinate point in the display image of the multi-spectrum camera by the brightness ratio of the coordinate point to obtain the true brightness of the object to be photographed. Through the implementation of steps S4 to S5, by dividing the image points at different image height positions by the corresponding proportional coefficients, the multi-spectrum camera can obtain photos with the same brightness when photographing the same object at different angles, thereby obtaining the true brightness of the object to be photographed which is not affected by the field position of the multi-spectrum camera. In summary, the relative-illumination correction method of the present application can ensure that the multi-spectrum camera can keep the brightness of the object to be photographed unchanged when photographing the same object to be photographed at different angles in a uniform light source environment (such as sunlight) without changing any performance of the optical device, so that the photographed image accurately reflects the reflection intensity of the object to be photographed in the field of view, thereby ensuring the correct spectral identification of the object to be photographed. Therefore, the photographed image using the relative-illumination correction method, the relative-illumination correction system, the relative-illumination correction device and the computer readable storage medium of the present application is not affected by the relative-illumination of the camera.
[0090] The above only describes the embodiments of the present application, and it should be noted that those skilled in the art can make improvements without departing from the inventive concept, and these improvements are within the protection scope of the present application.
Claims
1. A relative-illuminance correction method applied to a multi-spectral camera provided with a plurality of lenses; characterized in that, The method involves providing a uniform light source object and focusing a multispectral camera onto the uniform light source object, wherein any position within the uniform light source object serves as a Lambertian light source. The method includes the following steps: Step S1: Adjust the shooting parameters of the multispectral camera according to the preset target; the preset target is to ensure that the captured page is not overexposed. Step S2: Take N original photos, and starting from the second original photo, move the position of the multispectral camera before taking each photo. Step S3: Merge and calculate the N original photos to generate a single relative illumination photo; the rules for merging and calculating are as follows: The average grayscale value of the N original photos at any same pixel position is taken as the grayscale value of the relative illumination photo at the corresponding pixel position. Step S4: Set the length and width of the relative illumination photo as two-dimensional coordinates, and set multiple coordinate points and a center point in the relative illumination photo according to the two-dimensional coordinates. Then, calculate the brightness ratio of the coordinate point by dividing the brightness of each coordinate point by the brightness of the center point. Generate a relative illumination file by collecting the brightness ratios corresponding to all the coordinate points, and then store the relative illumination file in the multispectral camera. Step S5: When the multispectral camera is aimed at the object to be photographed, the brightness of each coordinate point in the display image plane of the multispectral camera is divided by the brightness ratio of that coordinate point to obtain the true brightness of the object to be photographed, which is not affected by the field of view position of the multispectral camera.
2. The relative-illuminance correction method of claim 1, wherein The uniform light source is an integrating sphere, which includes a hollow inner wall and an opening penetrating the inner wall; the lens of the multispectral camera focuses on the interior of the integrating sphere through the opening.
3. The relative-illuminance correction method of claim 1, wherein The uniform light source is a whiteboard under parallel light.
4. The relative-illuminance correction method of claim 2, wherein In step S2, the range of moving the position of the multispectral camera is such that the lens of the multispectral camera is focused inside the integrating sphere.
5. The relative-illuminance correction method of claim 1, wherein In step S1, the imaging parameters include the exposure time and gain of the multispectral camera.
6. The relative illuminance correction method according to claim 1, wherein In step S2, the multispectral camera is moved by rotation and displacement.
7. A relative luminance correction system characterized by, The relative illumination correction system applies the relative illumination correction method as described in any one of claims 1 to 6, and the relative illumination correction system includes an integrating sphere and a multispectral camera; The multispectral camera includes a spectral imaging system, a storage unit, and a processing unit, wherein the processing unit is data-connected to the spectral imaging system and the storage unit, respectively. The spectral imaging system is used to capture images of external objects to form the original photographs. The storage unit is used to store the original photo, the relative illumination photo, and the relative illumination file; The processing unit is used to merge and calculate N original photos to generate a relative illumination photo; the processing unit is also used to set the length and width of the relative illumination photo as two-dimensional coordinates, and set multiple coordinate points and a center point in the relative illumination photo according to the two-dimensional coordinates, then calculate the brightness ratio of the coordinate point by dividing the brightness of each coordinate point by the brightness of the center point, and generate a relative illumination file by collecting the brightness ratios corresponding to all the coordinate points, and then store the relative illumination file in the storage unit; the processing unit is also used to divide the brightness of each coordinate point in the display image plane of the multispectral camera by the brightness ratio of the coordinate point when the multispectral camera is pointing at the object to be photographed, to obtain the true brightness of the object to be photographed without being affected by the field of view position of the multispectral camera; the rule of the merging calculation is: the average gray value of the N original photos at any same pixel position is used as the gray value of the relative illumination photo at the corresponding pixel position.
8. The relative-illuminance correction system of claim 7, wherein The spectral imaging system includes a lens assembly with multiple lenses forming multiple channels, a filter, and a sensor. The lens assembly is positioned directly opposite the opening. The processing unit is connected to the sensor for data transmission.
9. A relative luminance correction apparatus characterized by comprising: It includes a processor and a memory, the processor being used to read a program from the memory and execute the steps of the relative illumination correction method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions, which, when executed by a processor, implement the steps in the relative illumination correction method as described in any one of claims 1-6.
Citation Information
Patent Citations
Fruit quality evaluation device based on multispectral image
CN101832941A
Calibration method and device for multispectral camera
CN110166704A