Image splicing coefficient determination method and image splicing method of line-scan digital camera
By calculating the correlation coefficient and polynomial fitting of a single channel of a line scan camera, the optimal unit stitching coefficient was determined, which solved the problem of image stitching distortion in line scan cameras and improved the recognition accuracy and sorting efficiency of color sorters.
Patent Information
- Application Number
- CN202511534563.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-12-12
AI Technical Summary
In existing technologies, line scan cameras cause image distortion when sorting different materials due to the incompatibility of the splicing coefficient, which affects the recognition accuracy and efficiency of color sorters. In addition, manual adjustment is inefficient and limits the automation and intelligence of production lines.
By calculating the correlation coefficient and polynomial fitting of a single channel of a linear array camera, the optimal unit stitching coefficient is determined, the image stitching process is optimized, and the accuracy and quality of image stitching are improved.
It enables efficient determination of the image stitching coefficient of the line scan camera, improves the accuracy of material identification and sorting efficiency of the color sorter, and reduces reliance on human experience.
Smart Images

Figure CN121120376A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application number 202411995462.1 and the name of "Image stitching coefficient determination method and image stitching method based on linear array camera", which was filed on December 31, 2024. TECHNICAL FIELD
[0002] The present application relates to the technical field of image processing, in particular to an image stitching coefficient determination method of a linear array camera and an image stitching method. BACKGROUND
[0003] When the material on the color sorter sorting production line, the linear array camera will shoot and identify the material, and further sort the material. For example, a color three-channel linear array camera has R, G, B three channels, and the images of the three channels need to be stitched to obtain a clear image for identification and sorting. Because the density difference of different materials is large, the speed through the color sorter will be different, so that when sorting different materials, if the same stitching coefficient is used for image stitching, the photographed picture will be distorted, which will affect the identification accuracy of the color sorter. Therefore, when replacing the material or the color sorter is online debugging, the image stitching coefficient needs to be adjusted according to the product adaptability.
[0004] Generally, to solve the problem of distorted photographed pictures, technical personnel need to adjust the stitching coefficient for different materials to obtain clear pictures. However, the manual adjustment method is not only difficult to operate, but also has low adjustment efficiency, which limits the automation and intelligent level of the production line and affects the sorting efficiency of the color sorter. SUMMARY
[0005] The present application aims to at least solve one of the technical problems in the related art. To this end, the first purpose of the present application is to propose an image stitching coefficient determination method of a linear array camera, to efficiently determine the image stitching coefficient of the linear array camera and get rid of the dependence on the experience of workers; the unit stitching coefficient of the single channel of the linear array camera is optimized, and the image is stitched according to the optimized unit stitching coefficient, to obtain an image with higher resolution, thereby effectively improving the accuracy of the color sorter in identifying materials and improving the accuracy and efficiency of the color sorter in sorting.
[0006] The second purpose of the present application is to propose an image stitching method.
[0007] To achieve the above-mentioned purpose, the first aspect of the present application proposes an image stitching coefficient determination method of a linear array camera, comprising:
[0008] determining a basic channel for image stitching from a plurality of single channels obtained from the linear array camera in advance;
[0009] The other single channels are all spliced to the base channel according to the channel splicing coefficient to obtain a spliced image.
[0010] The correlation coefficient of the base channel and the other at least one single channel in the spliced image is calculated.
[0011] A plurality of sets of unit splicing coefficients and a plurality of sets of correlation coefficients corresponding to the plurality of sets of unit splicing coefficients are obtained, polynomial fitting is performed based on the plurality of sets of unit splicing coefficients and the plurality of sets of correlation coefficients corresponding to the plurality of sets of unit splicing coefficients, and the optimal unit splicing coefficient is determined based on a polynomial fitting result.
[0012] In addition, the image splicing coefficient determination method of the linear array camera according to the above-mentioned embodiments of the present application can further have the following additional technical features:
[0013] According to some embodiments of the present application, the other single channels are all spliced to the base channel according to the channel splicing coefficient to obtain a corresponding spliced image, including:
[0014] The position of the base channel and the relative positions of all the other single channels relative to the base channel are determined.
[0015] Based on the relative positions and the unit splicing coefficient, the channel splicing coefficient between the base channel and the other single channels is determined.
[0016] The other single channels are all spliced to the base channel according to the channel splicing coefficient to obtain a spliced image.
[0017] According to some embodiments of the present application, the other single channels are all spliced to the base channel according to the channel splicing coefficient to obtain a corresponding spliced image, including:
[0018] Each single channel is moved by a distance of N unit pixels in the direction of the base channel according to the corresponding channel splicing coefficient; wherein the distance of unit pixels is a moving pixel distance corresponding to the unit splicing coefficient, the single channel is separated from the base channel by (N-1) other single channels, and N is a positive integer greater than or equal to 1.
[0019] According to some embodiments of the present application, the correlation coefficient of the base channel and the other at least one single channel in the spliced image is calculated, including:
[0020] According to the spliced image, a corresponding base channel component x and a selected single channel component y to be calculated are obtained.
[0021] According to the correlation coefficient operation formula, the correlation coefficient of the base channel and the selected single channel under the unit splicing coefficient is calculated, and the formula is:
[0022]
[0023] wherein, 、 are the average value of the base channel component x and the average value of the selected single channel component y of all pixels to be calculated in the current stitching image, respectively.
[0024] According to some embodiments of the present application, the values of multiple sets of unit stitching coefficients and corresponding correlation coefficients are obtained, and polynomial fitting is performed based on the values of the multiple sets of unit stitching coefficients and corresponding correlation coefficients, including:
[0025] The correlation coefficients of the corresponding base channel and selected single channel are calculated under different unit stitching coefficients, respectively;
[0026] The quadratic polynomial relationship between the unit stitching coefficient a and the correlation coefficient b is fitted by the least square method, that is:
[0027] .
[0028] According to some embodiments of the present application, the optimal stitching coefficient is determined based on the polynomial fitting result, including:
[0029] The extreme value of the fitted binomial is obtained, and the unit stitching coefficient a corresponding to the maximum value of the correlation coefficient b is obtained, and if the correlation coefficients of multiple selected single channels and base channels are calculated, the average value of the multiple unit stitching coefficients a is obtained as the optimal unit stitching coefficient.
[0030] According to the image stitching coefficient determination method of the line array camera provided by the embodiment of the present application, the base channel used for image stitching is determined from multiple single channels obtained from the line array camera in advance; the stitching coefficient of the single channel adjacent to the base channel is taken as the unit stitching coefficient, and other single channels are all stitched to the base channel to obtain the corresponding stitching image; the correlation coefficient of the base channel and at least one other single channel in the stitching image is calculated; multiple sets of unit stitching coefficients and multiple sets of correlation coefficients corresponding to the multiple sets of unit stitching coefficients are obtained, and polynomial fitting is performed based on the multiple sets of unit stitching coefficients and the multiple sets of correlation coefficients corresponding to the multiple sets of unit stitching coefficients; and the optimal unit stitching coefficient is determined based on the polynomial fitting result. The embodiment of the present application can determine the optimal unit stitching coefficient of the single channel by calculating the correlation coefficient of the single channel of the line array camera and polynomial fitting, thereby improving the accuracy and quality of image stitching and ensuring that the stitched image is more visually coherent and consistent.
[0031] To achieve the above purpose, the second aspect embodiment of the present application provides an image stitching method, including:
[0032] Obtaining each single channel parameter corresponding to the target object based on the line array camera shooting;
[0033] determining a base channel for image stitching;
[0034] respectively determining stitching coefficients corresponding to stitching of other single channels to the base channel;
[0035] stitching to obtain a stitched image of the target object according to the stitching coefficients of the single channels; wherein the resolution of the stitched image is higher than that of the initial image captured by the linear array camera.
[0036] According to some embodiments of the present application, respectively determining stitching coefficients corresponding to stitching of other single channels to the base channel comprises:
[0037] taking the stitching coefficient of the single channel adjacent to the base channel as a unit stitching coefficient, and determining the channel stitching coefficient of the stitching of the other single channels to the base channel;
[0038] respectively stitching the images under different groups of unit stitching coefficients;
[0039] selecting at least one single channel as a selected single channel;
[0040] calculating the correlation coefficient between the base channel and the selected single channel under each group of stitched images;
[0041] finding the optimal unit stitching coefficient based on the numerical relationship between the groups of unit stitching coefficients and the corresponding correlation coefficients;
[0042] determining the channel stitching coefficient of the stitching of the other single channels to the base channel based on the optimal unit stitching coefficient.
[0043] According to some embodiments of the present application, taking the stitching coefficient of the single channel adjacent to the base channel as a unit stitching coefficient, and determining the channel stitching coefficient of the stitching of the other single channels to the base channel comprises:
[0044] determining the position of the base channel and the relative positions of all other single channels relative to the base channel;
[0045] determining the channel stitching coefficient of the stitching of the other single channels to the base channel based on the relative positions and the unit stitching coefficient;
[0046] moving each single channel by a distance of N unit pixels in the direction of the base channel according to the corresponding channel stitching coefficient; wherein the distance of unit pixels is a moving pixel distance corresponding to the unit stitching coefficient, the single channel and the base channel are separated by (N-1) other single channels, and N is a positive integer greater than or equal to 1.
[0047] According to some embodiments of the present application, calculating the correlation coefficient between the base channel and the selected single channel under each group of stitched images further comprises:
[0048] According to the spliced image, corresponding basic channel components x and selected single channel components y to be calculated are obtained;
[0049] According to a correlation coefficient calculation formula, the correlation coefficient of the basic channel and the selected single channel under a unit splicing coefficient is calculated, and the formula is:
[0050]
[0051] Wherein, , The average value of the basic channel component x and the average value of the selected single channel component y of all pixel points to be calculated in the current spliced image are respectively.
[0052] According to some embodiments of the application, based on the numerical relationship between multiple sets of unit splicing coefficients and corresponding correlation coefficients, the optimal unit splicing coefficient is found, including:
[0053] The correlation coefficients of the corresponding basic channel and selected single channel under different unit splicing coefficients are calculated respectively;
[0054] The least square method is used to fit the quadratic polynomial relationship between the unit splicing coefficient a and the correlation coefficient b, that is:
[0055]
[0056] The extreme value of the fitted binomial is obtained, and the unit splicing coefficient a corresponding to the maximum correlation coefficient b is obtained, if multiple selected single channels and basic channels are calculated, the average value of multiple unit splicing coefficients a is obtained as the optimal unit splicing coefficient.
[0057] According to the image splicing method provided by the embodiment of the application, first, the single channel parameters corresponding to the target object based on the linear array camera are obtained; further, the basic channel for image splicing is determined; then, the splicing coefficients corresponding to the splicing of other single channels to the basic channel are determined respectively; finally, the splicing image of the target object is obtained according to the splicing coefficients of the single channels; wherein the resolution of the splicing image is higher than that of the initial image shot by the linear array camera. The embodiment of the application optimizes the unit splicing coefficient of the single channel of the linear array camera, and splices the image according to the optimized unit splicing coefficient, so as to obtain an image with higher resolution, and thus the accuracy of the color sorter in identifying materials is effectively improved, and the accuracy and efficiency of the color sorter in sorting are improved.
[0058] Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will become apparent to those skilled in the art upon examination of the following description and drawings. BRIEF DESCRIPTION OF DRAWINGS
[0059] In order to make the technical solutions in the present application or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only aim at the present application, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0060] Figure 1 A schematic diagram of the image acquisition principle of the color three-line array camera provided by the embodiment of the present application is shown in the figure.
[0061] Figure 2 A schematic diagram of the image obtained by directly splicing the data acquired by the color three-line array camera provided by the embodiment of the present application is shown in the figure.
[0062] Figure 3 A flow chart of the image splicing coefficient determination method of the line array camera provided by the embodiment of the present application is shown in the figure.
[0063] Figure 4 A schematic diagram of the channel of the six-channel line array camera provided by the embodiment of the present application is shown in the figure.
[0064] Figure 5 A schematic diagram of the image splicing coefficient determination device provided by the embodiment of the present application is shown in the figure.
[0065] Figure 6 A more specific schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present application is shown in the figure.
[0066] Figure 7 A flow chart of the image splicing method provided by the embodiment of the present application is shown in the figure.
[0067] Figure 8 A flow chart of the determination of the splicing coefficient corresponding to the splicing of the other single-channel to the basic channel provided by the embodiment of the present application is shown in the figure.
[0068] Figure 9 An image obtained by splicing according to the optimal splicing coefficient provided by the embodiment of the present application is shown in the figure.
[0069] Figure 10 A schematic diagram of the image splicing device based on the line array camera provided by the embodiment of the present application is shown in the figure.
[0070] Figure 11 A more specific schematic diagram of the hardware structure of the electronic device provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0071] In order to make the technical solutions in the present application or the prior art clearer, the accompanying drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only aim at the present application, and other drawings can also be obtained by those skilled in the art without any creative effort.
[0072] It should be noted that, unless otherwise defined, technical terms or scientific terms used in the present application shall be understood as their ordinary meaning to those having ordinary skill in the art to which the present application pertains. The terms "first", "second", and similar terms used in the present application do not denote any order, quantity, or importance, but are only used to distinguish different components. The terms "comprise", "include", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connected" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "up", "down", "left", "right", and the like are only used to represent relative positional relationships, and when the absolute positions of the described objects change, the relative positional relationships may also change accordingly.
[0073] As described in the background section, when the line array camera of the color sorter photographs and distinguishes the materials on the production line, due to the large difference in the density of the materials to be sorted, the running speed of materials of different densities may differ when they pass through the color sorter at a constant speed, which in turn causes the pictures taken by the line array camera when photographing the materials to have color distortion. Therefore, the technical personnel need to repeatedly adjust the stitching coefficients for different materials so that the line array camera can take clear pictures of the materials for more accurate identification and sorting of the materials. On the production line, manual adjustment is difficult and inefficient, and the technical threshold for manual adjustment is high, which limits the automation and intelligent level of the production line and is not conducive to the long-term use of the color sorter.
[0074] The applicant found during the implementation of the present application that by calculating the correlation coefficient and polynomial fitting of a single channel of the line array camera, the optimal unit stitching coefficient of the single channel can be determined, and the image stitching is performed using the optimized unit stitching coefficient, thereby improving the accuracy and quality of image stitching and ensuring that the stitched image is more visually coherent and consistent.
[0075] The following further describes the image stitching coefficient determination method of the line array camera of the present application through specific embodiments.
[0076] The sensor of a linear array camera is linear, responsible for receiving light and converting it into an electrical signal. During this process, different parts or regions on the sensor can be considered as different "channels", each responsible for capturing a part of the image information. Linear array cameras capture light point by point and convert it into an electrical signal through a linear sensor scanning line by line. These electrical signals are then converted into digital signals for image reconstruction and processing. During this process, each channel plays an important role in ensuring the integrity and accuracy of image information. Linear array cameras can generally be set to have 1, 2, 3, 4, 6, 8, 16 channels as needed, and each channel forms multiple rows of sampling positions in the same plane when taking pictures, and the multiple rows of sampling positions are equally spaced. For color imaging, a three-channel color linear array camera is generally used, with channels R, G, and B representing red, green, and blue, respectively, which are the basis of color images. In the application of linear array cameras, if the camera is equipped with an RGB sensor, each channel (red, green, and blue) will capture one color component of the image.
[0077] A color three-linear array camera is based on a three-linear array CCD (Charge-Coupled Device) sensor, which is arranged in three linear arrays, namely red (R), green (G), and blue (B) channels. Each linear array observes the object at a different angle (or time, for static objects, which can be understood as different scanning lines) to capture the R, G, and B color components of the object. However, due to the special structure of the three-linear array camera, the R, G, and B components collected at the same time do not correspond to the same point on the object.
[0078] As shown in Figure 1 , it is a schematic diagram of the principle of image acquisition by a color three-linear array camera. It can be seen that the R, G, and B components collected at the same time do not correspond to the same point on the object. The captured image needs to be spliced with strict splicing coefficients to form a normal color image.
[0079] The color sorter sorts materials with large density differences, such as large density (e.g. ore) and small density (e.g. tea). Due to the large density difference between different materials, the speed through the color sorter will be different, resulting in distortion of the captured image when sorting different materials, as shown in Figure 2 , it is a schematic diagram of the image obtained by directly splicing the data collected by a color three-linear array camera. It can be seen that the color distortion at the edge of the material is obvious, affecting the recognition accuracy of the subsequent sorting algorithm.
[0080] Referring to Figure 3 , it is a flowchart of the image splicing coefficient determination method of the linear array camera provided by the embodiment of the present application.
[0081] determining a basic channel for image stitching from a plurality of single channels obtained from a linear array camera in advance;
[0082] stitching all other single channels to the basic channel as unit stitching coefficients of single channels adjacent to the basic channel to obtain a corresponding stitched image;
[0083] calculating a correlation coefficient of the basic channel and at least one other single channel in the stitched image;
[0084] obtaining a plurality of sets of unit stitching coefficients and a plurality of sets of correlation coefficients corresponding to the plurality of sets of unit stitching coefficients, performing polynomial fitting based on the plurality of sets of unit stitching coefficients and the plurality of sets of correlation coefficients corresponding to the plurality of sets of unit stitching coefficients, and determining an optimal unit stitching coefficient based on a polynomial fitting result.
[0085] The embodiment determines the scheme of image stitching of each channel after determining the basic channel, then completes data processing and stitching of each channel based on the assumed value of the unit stitching coefficient, thereby obtaining a corresponding stitched image, obtains the relationship between the unit stitching coefficient and the quality of the stitched image (the correlation coefficient) through the evaluation of the quality of the stitched image, obtains a plurality of sets of such relationship values, obtains the numerical relationship between the two parameters based on polynomial fitting, and determines the optimal unit stitching coefficient based on the fitting result. Thus, the optimal stitching coefficient suitable for different materials can be evaluated, the problems of low efficiency and unquantifiable results when adjusting the stitching parameters based on artificial experience are avoided, and the imaging quality is improved.
[0086] Specifically, the embodiment provides a method for determining an image stitching coefficient of a linear array camera, which comprises the following steps:
[0087] In step S301, a basic channel for image stitching is determined from a plurality of single channels obtained from a linear array camera in advance.
[0088] First, one of the plurality of single channels obtained from the linear array camera is selected as a basis for image stitching. This basic channel will serve as a reference point for stitching, and other channels will be stitched around it.
[0089] For example, if a color three-linear array camera captures data of R, G, and B channels, these data can represent the intensity information of red, green, and blue colors in the image, respectively. Among the three channels, any one can be selected as the basic channel. Generally, since the green channel (G) is the most sensitive to the human eye and contains the most image detail information, it can be preferred as the basic channel. After the basic channel is determined, the data of other channels (such as the R channel and the B channel) need to be stitched to the basic channel, and the reference Figure 1It can be known that the objects collected by the three channels of R, G and B have gaps. If the data of the three channels are directly spliced, it can be considered that the image data at three different positions are spliced together to form an image, and thus unclear situations can exist. Splicing the data of other channels to the base channel is a process of expecting to adjust the data of each channel to the position where it originally locates. When the image splicing is specifically performed, the parameters of the linear array camera in a certain time period need to be acquired, so as to form a certain surface domain. The splicing process can be considered as performing a certain displacement on the data of other channels along the time axis and then performing image splicing.
[0090] In step S302, the other single channels are spliced to the base channel by taking the splicing coefficient of the single channel adjacent to the base channel as a unit splicing coefficient, so as to obtain a corresponding spliced image.
[0091] Specifically, the unit splicing coefficient refers to the splicing coefficient between the single channel directly adjacent to the base channel (for example, if the base channel is the green channel G, the unit splicing coefficient can refer to the splicing coefficient between the green channel G and the red channel R or the blue channel B, depending on which channel is directly adjacent to the green channel G).
[0092] As an optional embodiment, the other single channels are spliced to the base channel by taking the splicing coefficient of the single channel adjacent to the base channel as a unit splicing coefficient, so as to obtain a corresponding spliced image, including: determining the position of the base channel and the relative positions of all other single channels relative to the base channel; determining the channel splicing coefficients between the other single channels and the base channel based on the relative positions and the unit splicing coefficient; and splicing all the other single channels to the base channel according to the channel splicing coefficients to obtain a spliced image.
[0093] Specifically, the sensors of the color three-linear array camera are usually arranged in a specific arrangement, such as RGB linear arrangement, BGR linear arrangement or staggered arrangement, etc. In the image data structure, each channel has a specific position or index. For the base channel, its position is known, which is usually at the beginning of the data structure or at a certain specific position. The relative position refers to the positional relationship of the other single channels relative to the base channel in the image data structure. For the linear array camera, the physical spacing of adjacent channels is consistent on the object plane facing the camera, and thus when the splicing coefficients of other channels are determined according to the base splicing coefficient, only the relative positional relationship of all channels needs to be known.
[0094] For example, for the three-channel linear array camera shown in FIG. 1, the splicing coefficient of the B channel to the R channel is defined as the unit splicing coefficient when the R channel is taken as the base channel, and the splicing coefficient of the G channel to the R channel is twice the unit splicing coefficient. Figure 1
[0095] As an optional embodiment, the other single channels are all spliced to the base channel according to the channel splicing coefficients, including: moving each single channel to the direction of the base channel by N unit pixel distances according to the channel splicing coefficient corresponding to the single channel; wherein the unit pixel distance is a moving pixel distance corresponding to a unit splicing coefficient, the single channel is separated from the base channel by (N-1) other single channels, and N is a positive integer greater than or equal to 1.
[0096] For example Figure 4 As shown in the six-channel linear array camera, the second channel 22 is taken as the base channel, the third channel 23 is taken as the unit splicing coefficient a of the splicing coefficient of the base channel 22, and the fourth channel 24 is separated from the base channel 22 by one other channel (the third channel 23), so that the channel splicing coefficient of the fourth channel 24 is 2a, and the channel splicing coefficient of the fifth channel 25 is 3a, the channel splicing coefficient of the sixth channel 26 is 4a, and the channel splicing coefficient of the first channel 21 is still a in value because the first channel 21 is on both sides of the third channel 23, but the direction is opposite, so it should be set to -a when calculating.
[0097] Specifically, the unit pixel distance refers to the moving pixel distance corresponding to the unit splicing coefficient, and the specific value of the distance does not need to be accurately calculated. The definition is introduced in the embodiment only for the convenience of understanding the technical solution, and the specific value of the pixel distance does not need to be considered in actual processing. Only the quality of the processed image needs to be evaluated to determine whether the value of the unit splicing coefficient is appropriate.
[0098] In step S303, the correlation coefficient of the base channel and the other at least one single channel in the spliced image is calculated.
[0099] The correlation coefficient is a statistical quantity for measuring the strength and direction of the linear relationship between two single channel components. In image processing, the correlation coefficient between the base channel and the other single channel can determine the similarity and difference between the single channels. In step S304, a plurality of sets of unit splicing coefficients and a plurality of sets of correlation coefficients corresponding to the plurality of sets of unit splicing coefficients are obtained, a polynomial fitting is performed based on the plurality of sets of unit splicing coefficients and the plurality of sets of correlation coefficients corresponding to the plurality of sets of unit splicing coefficients, and the optimal unit splicing coefficient is determined based on the polynomial fitting result.
[0100] In the embodiment of the application, a plurality of sets of unit splicing coefficients can be collected or generated, which represent the splicing effect under different parameter settings in the image splicing task, or represent other parameter combinations that need to be optimized.
[0101] For each set of unit stitching coefficients, a corresponding correlation coefficient is obtained. Using the collected sets of unit stitching coefficients and correlation coefficients as data points, a polynomial fitting is performed. Polynomial fitting is a mathematical method used to find a set of polynomial coefficients that best describe the relationship between data points by minimizing the error. Based on the results of the polynomial fitting, the unit stitching coefficient that maximizes the correlation coefficient (or minimizes some error metric) can be found. This coefficient can be used as the optimal unit stitching coefficient.
[0102] Specifically, the correlation coefficient between the base channel and the other at least one single channel in the stitched image is calculated, including: obtaining the corresponding base channel component x and the selected single channel component y to be calculated from the stitched image; calculating the correlation coefficient between the base channel and the selected single channel under the unit stitching coefficient according to the correlation coefficient operation formula, and the formula is:
[0103]
[0104] wherein, , are the average values of the base channel component x and the selected single channel component y of all pixel points to be calculated in the current stitched image, respectively.
[0105] Specifically, the base channel component x and the selected single channel component y are extracted from the stitched image. These components can represent different color channels (such as red, green, blue) or other feature channels of the image. Further, the average value of the base channel component x of all pixel points to be calculated in the current stitched image is calculated and the average value of the selected single channel component y is calculated . The average value can be obtained by summing the corresponding channel components of all pixel points and then dividing by the total number of pixel points. The correlation coefficient between the base channel and the selected single channel is calculated using the correlation coefficient operation formula. The correlation coefficient is a statistical measure of the degree of linear correlation between two variables, and its value is between -1 and 1. The closer the value of the correlation coefficient to 1, the stronger the linear relationship between the base channel and the selected single channel (positive correlation); the closer to -1, the stronger the linear relationship (negative correlation); close to 0 means almost no linear relationship.
[0106] As an optional embodiment, a plurality of sets of unit stitching coefficients and corresponding correlation coefficients are obtained, and a polynomial fitting is performed based on the values of the plurality of sets of unit stitching coefficients and corresponding correlation coefficients, including: calculating the correlation coefficient between the corresponding base channel and the selected single channel under different unit stitching coefficients; fitting a quadratic polynomial relationship between the unit stitching coefficient and the correlation coefficient , that is:
[0107] .
[0108] wherein, taking the R channel as the base channel and the G channel as an example, unit splicing coefficient, is the correlation coefficient of the corresponding R channel and G channel components, , , are the coefficients of the quadratic term, the linear term and the zero term in the formula, respectively.
[0109] As an optional embodiment, determining the optimal splicing coefficient based on the polynomial fitting result comprises: obtaining the correlation coefficient of the maximum value corresponding to the unit splicing coefficient If multiple correlation coefficients of the selected single channel and the base channel are calculated, the average value of the multiple unit splicing coefficients is obtained as the optimal unit splicing coefficient.
[0110] The correlation coefficients of the R channel and the G channel, and the R channel and the B channel components are fitted with a quadratic polynomial, respectively, and the maximum value and the corresponding splicing coefficient are solved. The specific solving process is as follows:
[0111] The least square method is used to fit the quadratic polynomial with the splicing coefficient as the variable, and the least square method fitting quadratic polynomial formula is derived as follows:
[0112] Let , , be the splicing coefficient, , , be the corresponding correlation coefficient, and the fitted quadratic polynomial be , then the mean square error is , and the partial derivative is , , , and the three partial derivatives are set to 0, i.e. the maximum value is , , , and the maximum value is , and the splicing coefficient corresponding to the maximum value is .
[0113] The final splicing coefficient is the average value of the splicing coefficients corresponding to the maximum values of the correlation coefficients of the R channel and the G channel, and the R channel and the B channel components, and the formula is as follows:
[0114]
[0115] wherein, the stitching coefficient obtained for the R channel and the G channel component, the stitching coefficient obtained for the R channel and the B channel component.
[0116] According to the obtained stitching coefficient , the R channel component remains unchanged (R channel is the base channel), the B channel component moves , the G channel component moves , and a new image is stitched.
[0117] If is a decimal, the stitching formula is as follows:
[0118]
[0119] wherein, denotes the stitched image at , denotes the image to be stitched at , denotes the decimal part, denotes the floor function, denotes the ceiling function.
[0120] According to the image stitching coefficient determination method of the linear array camera provided by the embodiment of the present application, the base channel used for image stitching is determined from the plurality of single channels obtained from the linear array camera in advance, and the stitching scheme of the entire stitched image is determined according to the position of the base channel; the stitching coefficient of the single channel adjacent to the base channel is taken as a unit stitching coefficient, and all other single channels are stitched to the base channel to obtain the corresponding stitched image; the correlation coefficient of the base channel and at least one other single channel in the stitched image is calculated; a plurality of sets of unit stitching coefficients and a plurality of sets of correlation coefficients corresponding to the plurality of sets of unit stitching coefficients are obtained, polynomial fitting is performed based on the plurality of sets of unit stitching coefficients and the plurality of sets of correlation coefficients corresponding to the plurality of sets of unit stitching coefficients, and the optimal unit stitching coefficient is determined based on the polynomial fitting result. According to the embodiment of the present application, the correlation coefficient of the single channel of the linear array camera and the polynomial fitting are calculated, the optimal unit stitching coefficient of the single channel can be determined, the accuracy and quality of image stitching are improved, and the stitched image is more visually coherent and consistent.
[0121] It should be noted that the method of the embodiment of the present application can be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scenario, and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only execute one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the method.
[0122] It is to be understood that the foregoing description is descriptive only. Other embodiments are within the scope of the claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the attached figures do not necessarily require the particular order shown or sequential order to achieve desirable results. In certain implementations, multitasking and parallel processing can be advantageous.
[0123] Based on the same inventive concept, the present application also provides an image stitching coefficient determination device corresponding to the method provided by any of the above embodiments.
[0124] Reference Figure 5 A schematic diagram of an image stitching coefficient determination device provided by an embodiment of the present application.
[0125] The image stitching coefficient determination device comprises an acquisition module 1110, a stitching module 1120, a calculation module 1130, and a determination module 1140.
[0126] The acquisition module 1111 is configured to determine a base channel for image stitching from a plurality of single channels acquired in advance from a linear array camera.
[0127] The stitching module 1120 is configured to stitch all other single channels to the base channel with the stitching coefficient of the single channel adjacent to the base channel as the unit stitching coefficient, to obtain a corresponding stitched image.
[0128] The calculation module 1130 is configured to calculate the correlation coefficient of the base channel and at least one other single channel in the stitched image.
[0129] The determination module 1140 is configured to acquire a plurality of sets of unit stitching coefficients and a plurality of sets of correlation coefficients corresponding to the plurality of sets of unit stitching coefficients, perform polynomial fitting based on the plurality of sets of unit stitching coefficients and the plurality of sets of correlation coefficients corresponding to the plurality of sets of unit stitching coefficients, and determine the optimal unit stitching coefficient based on the polynomial fitting result.
[0130] For the sake of description, the above device is described in various modules. Of course, the functions of each module can be implemented in one or more software and / or hardware when implementing the present application.
[0131] The image stitching coefficient determination device of the above embodiments is used to implement the image stitching coefficient determination method of the corresponding linear array camera in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here.
[0132] Based on the same inventive concept, corresponding to the image splicing coefficient determination method of the linear array camera described in any of the above embodiments, the present application also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the image splicing coefficient determination method of the linear array camera described in any of the above embodiments.
[0133] Figure 6 A more specific electronic device hardware structure schematic diagram provided by the present embodiment is shown, which can include a processor 1210, a memory 1220, an input / output interface 1230, a communication interface 1240 and a bus 1250. The processor 1210, the memory 1220, the input / output interface 1230 and the communication interface 1240 are connected to each other through the bus 1250 for communication within the device.
[0134] The processor 1210 can be implemented by a general-purpose CPU (Central Processing Unit, CPU), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the present embodiment.
[0135] The memory 1220 can be implemented by a ROM (ReadOnly Memory, ROM), a RAM (Random Access Memory, RAM), a static storage device, a dynamic storage device, etc. The memory 1220 can store an operating system and other application programs, and when the technical solutions provided by the present embodiment are implemented by software or firmware, the related program codes are stored in the memory 1220 and executed by the processor 1210.
[0136] The input / output interface 1230 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0137] The communication interface 1240 is used to connect the communication module (not shown in the figure) to realize the communication interaction between the present device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.), or through wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0138] The bus 1250 includes a path for transmitting information between the various components (for example, the processor 1210, the memory 1220, the input / output interface 1230, and the communication interface 1240) of the device.
[0139] It should be noted that although the above device only shows the processor 1210, the memory 1220, the input / output interface 1230, the communication interface 1240 and the bus 1250, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary to implement the embodiments of the present application, and does not have to contain all the components shown in the figure.
[0140] The electronic device of the above embodiment is used to implement the image stitching coefficient determination method of the corresponding linear array camera in any of the preceding embodiments, and has the beneficial effects of the corresponding method embodiments, which are not repeated here.
[0141] Based on the same inventive concept, corresponding to the image stitching coefficient determination method of the linear array camera described in any of the above embodiments, the present application also provides a computer readable storage medium, which stores computer instructions for causing the computer to execute the image stitching coefficient determination method of the linear array camera as described in any of the above embodiments.
[0142] The above computer readable storage medium can be any available medium or data storage device accessible by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state disk (SSD), etc.).
[0143] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the image stitching coefficient determination method of the linear array camera as described in any of the above exemplary method embodiments, and have the beneficial effects of the corresponding method embodiments, which are not repeated here.
[0144] In the following, the image stitching method technical solution of the present application is further described in detail through specific embodiments.
[0145] Reference Figure 7 The image stitching method flowchart provided for the embodiments of the present application.
[0146] Obtaining each single-channel parameter corresponding to the target object based on the linear array camera shooting;
[0147] Determining the basis channel for image stitching;
[0148] respectively determine a stitching coefficient corresponding to stitching of each single channel to the basic channel;
[0149] stitching images of the target object according to the stitching coefficients of each single channel; wherein the resolution of the stitching images is higher than that of the initial images captured by the linear array camera.
[0150] The embodiment determines the stitching scheme of each channel to obtain the stitching images by selecting the basic channel, and then determines the specific stitching coefficients of each channel, thereby completing the pattern stitching of the linear array camera, and clear stitching images can be obtained, which is conducive to product identification and sorting based on images.
[0151] Further, the image stitching method provided by the embodiment comprises:
[0152] Step S1301: obtaining each single channel parameter corresponding to the target object based on the linear array camera.
[0153] Firstly, the target object can be captured by the linear array camera, and each single channel image or data obtained by capturing can be obtained. These single channels can represent different color channels (such as red, green, and blue), or other specific image feature channels.
[0154] Step S1302: determining a basic channel for image stitching.
[0155] Firstly, one of the multiple single channels obtained by the linear array camera can be selected as the basis for image stitching. This basic channel will serve as the reference point for stitching, and other channels will be stitched around it. For example, in the embodiment, the R channel is taken as the basic channel, and the data of the G and B channels are processed respectively to be stitched to the R channel to obtain the stitching images.
[0156] Step S1303: respectively determining a stitching coefficient corresponding to stitching of each single channel to the basic channel.
[0157] Specifically, referring to the accompanying drawings, Figure 8 the flowchart for determining the stitching coefficient corresponding to stitching of each single channel to the basic channel provided by the embodiment of the application is provided.
[0158] The respective determination of the stitching coefficient corresponding to the stitching of each single channel to the basic channel comprises:
[0159] Step S1401: taking the single channel stitching coefficient adjacent to the basic channel as the unit stitching coefficient, and determining the channel stitching coefficient of each single channel to the basic channel;
[0160] Step S1402: respectively stitching the images under a plurality of different unit stitching coefficients;
[0161] Step S1403: Select at least one of the single channels as the selected single channel;
[0162] Step S1404: Calculate the correlation coefficient between the base channel and the selected single channel for each group of stitched images;
[0163] Step S1405: Based on the numerical relationship between the multiple sets of unit splicing coefficients and their corresponding correlation coefficients, find the optimal unit splicing coefficient;
[0164] Step S1406: Based on the optimal unit splicing coefficient, determine the channel splicing coefficient for splicing other single channels to the basic channel.
[0165] This embodiment stitches images together under different stitching coefficients and obtains the corresponding correlation coefficients, thereby quantifying the quality of the stitched images. Based on the numerical relationship between the stitching coefficients and the correlation coefficients, the optimal stitching coefficient is determined. This allows for the precise determination of suitable stitching coefficients through data processing, reducing reliance on the experience of on-site debugging personnel, meeting the requirements for data switching in different material scenarios, and improving the flexibility of production line products.
[0166] Step S1304: The target object is stitched together according to the stitching coefficients of each single channel to obtain a stitched image; wherein the resolution of the stitched image is higher than that of the initial image captured by the line scan camera.
[0167] Based on the calculated splicing coefficient The R channel component remains stationary (R channel is the base channel), while the B channel component moves. G channel component shift Reassemble them into a single image, such as Figure 9 As shown. Figure 9 This is the image obtained after stitching according to the optimal stitching coefficients. Compared to... Figure 2 , Figure 9 The material edges are clear and the resolution is high.
[0168] if When the number is a decimal, the concatenation formula is as follows:
[0169]
[0170] in, express The stitched image. express The images to be stitched together. This indicates taking the decimal part. Indicates rounding down. This indicates rounding up to the nearest integer.
[0171] According to the image splicing method provided by the embodiment of the present application, firstly, each single-channel parameter corresponding to a target object photographed based on a linear array camera is acquired; further, a basic channel for image splicing is determined; then, a splicing coefficient corresponding to splicing of other single channels to the basic channel is determined respectively; finally, a spliced image of the target object is obtained by splicing according to the splicing coefficients of each single channel; wherein the resolution of the spliced image is higher than that of the initial image photographed by the linear array camera. The embodiment of the present application optimizes the unit splicing coefficient of the single channel of the linear array camera, and splices the image according to the optimized unit splicing coefficient, so as to obtain an image with higher resolution, thereby effectively improving the accuracy of the color sorter in identifying materials, and improving the accuracy and efficiency of the color sorter in sorting.
[0172] According to the image splicing method provided by the embodiment of the present application, firstly, each single-channel parameter corresponding to a target object photographed based on a linear array camera is acquired; further, a basic channel for image splicing is determined; then, a splicing coefficient corresponding to splicing of other single channels to the basic channel is determined respectively; finally, a spliced image of the target object is obtained by splicing according to the splicing coefficients of each single channel; wherein the resolution of the spliced image is higher than that of the initial image photographed by the linear array camera. The embodiment of the present application optimizes the unit splicing coefficient of the single channel of the linear array camera, and splices the image according to the optimized unit splicing coefficient, so as to obtain an image with higher resolution, thereby effectively improving the accuracy of the color sorter in identifying materials, and improving the accuracy and efficiency of the color sorter in sorting.
[0173] It should be noted that the image splicing method of the embodiment of the present application can be executed by a single device, such as a computer or a server. The image splicing method of the present embodiment can also be applied to a distributed scenario, and completed by multiple devices cooperating with each other. In this distributed scenario, one of the multiple devices can only execute one or more steps of the image splicing method of the embodiment of the present application, and the multiple devices can interact with each other to complete the image splicing method.
[0174] It should be noted that some embodiments of the present application have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than the order described above and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous.
[0175] Based on the same inventive concept, the present application also provides an image splicing coefficient determination device corresponding to the image splicing method provided by any of the above embodiments.
[0176] ReferenceFigure 10 Fig. 49 is a schematic diagram of an image stitching device based on a linear array camera provided by an embodiment of the present application.
[0177] The image stitching device based on the linear array camera comprises an acquisition module 1610, a first determination module 1620, a second determination module 1630 and a stitching module 1640.
[0178] The acquisition module 1610 is configured to acquire each single-channel parameter corresponding to a target object photographed by the linear array camera.
[0179] The first determination module 1620 is configured to determine a basic channel for image stitching.
[0180] The second determination module 1630 is configured to determine stitching coefficients corresponding to stitching of other single channels to the basic channel respectively.
[0181] The stitching module 1640 is configured to stitch to obtain a stitched image of the target object according to the stitching coefficients of each single channel, wherein the resolution of the stitched image is higher than that of the initial image photographed by the linear array camera.
[0182] For the convenience of description, the above device is described in various modules according to functions. Of course, the functions of each module can be implemented in one or more software and / or hardware when implementing the present application.
[0183] The device of the above embodiment is used to implement the corresponding image stitching method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be described here.
[0184] Based on the same inventive concept, the present application also provides an electronic device corresponding to the image stitching method described in any of the above embodiments, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the image stitching method described in any of the above embodiments when executing the program.
[0185] Figure 11 Fig. 48 shows a more specific hardware structure schematic diagram of an electronic device provided by the present embodiment. The device can comprise a processor 1710, a memory 1720, an input / output interface 1730, a communication interface 1740 and a bus 1750. The processor 1710, the memory 1720, the input / output interface 1730 and the communication interface 1740 are connected to each other through the bus 1750 for communication connection within the device.
[0186] The processor 1710 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solutions provided by the embodiments of the present specification.
[0187] The memory 1720 can be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1720 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the relevant program codes are saved in the memory 1720 and called and executed by the processor 1710.
[0188] The input / output interface 1730 is configured to connect input / output modules to implement information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. The input devices can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices can include a display, a speaker, a vibrator, an indicator light, etc.
[0189] The communication interface 1740 is configured to connect a communication module (not shown in the figure) to implement the communication interaction between the device and other devices. The communication module can realize communication through a wired manner (such as USB, network cable, etc.) or through a wireless manner (such as mobile network, WIFI, Bluetooth, etc.).
[0190] The bus 1750 includes a path for transmitting information between various components (such as the processor 1710, the memory 1720, the input / output interface 1730, and the communication interface 1740) of the device.
[0191] It should be noted that although the above device only shows the processor 1710, the memory 1720, the input / output interface 1730, the communication interface 1740, and the bus 1750, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary to implement the solutions of the embodiments of the present specification, and does not have to contain all the components shown in the figure.
[0192] The electronic device of the above embodiments is used to implement the corresponding image stitching method in any of the preceding embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here again.
[0193] Based on the same inventive concept, the present application also provides a computer readable storage medium storing computer instructions for causing a computer to perform the image stitching method according to any of the above embodiments.
[0194] The above computer readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to a magnetic storage (e.g. floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), an optical storage (e.g. CD, DVD, BD, HVD, etc.), and a semiconductor memory (e.g. ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid state disk (SSD), etc.).
[0195] The computer instructions stored in the storage medium of the above embodiments are used to cause a computer to perform the image stitching method according to any of the above exemplary method embodiments, and have the beneficial effects of the corresponding method embodiments, which are not repeated here.
[0196] In addition, although the operations of the method of the present application are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all of the shown operations must be performed to achieve the desired results. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps.
[0197] It should be understood that parts of the present application can be realized in hardware, software, firmware, or a combination thereof. In the above embodiments, a plurality of steps or methods can be realized by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if realized in hardware, and as in another embodiment, it can be realized by any one or a combination of the following technologies known in the art: discrete logic circuit with logic gate circuit for implementing logic functions on data signals, application specific integrated circuit with suitable combination logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA), etc.
[0198] It should be noted that the technical terms or scientific terms used in the embodiments of the present application should be understood as the common meanings understood by those skilled in the art in the field of the present application, unless otherwise defined. The terms "first", "second", and similar words used in the embodiments of the present application do not represent any order, number, or importance, but are only used to distinguish different components. The terms "including", "containing", and similar words mean that the elements or objects before the words cover the elements or objects listed after the words and their equivalents, and do not exclude other elements or objects. The terms "connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right", and the like are only used to represent relative positional relationships, and when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0199] Although the spirit and principles of the present application have been described with reference to several specific embodiments, it should be understood that the present application is not limited to the disclosed specific embodiments, and the division of aspects does not mean that the features in these aspects cannot be combined for benefit, but is only for the convenience of expression. The present application is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims. The scope of the appended claims is the broadest interpretation, so as to include all such modifications and equivalent structures and functions.
Claims
1. A method for determining image stitching coefficients of a line scan camera, characterized in that, The method comprises the following steps: determining a basic channel for image stitching from a plurality of single channels obtained in advance from a linear array camera; splicing other single channels to the basic channel according to unit splicing coefficients of single channels adjacent to the basic channel to obtain a corresponding spliced image; calculating a correlation coefficient of the basic channel and at least one other single channel in the spliced image; obtaining a plurality of sets of unit splicing coefficients and a plurality of sets of correlation coefficients corresponding to the plurality of sets of unit splicing coefficients, and performing polynomial fitting based on the plurality of sets of unit splicing coefficients and the plurality of sets of correlation coefficients corresponding to the plurality of sets of unit splicing coefficients, and determining an optimal unit splicing coefficient based on a polynomial fitting result.
2. The method of determining image stitching coefficients of a linear array camera according to claim 1, characterized in that, The method of splicing other single channels to the basic channel according to unit splicing coefficients of single channels adjacent to the basic channel to obtain a corresponding spliced image comprises the following steps: determining a position of the basic channel and relative positions of all other single channels relative to the basic channel; determining channel splicing coefficients between other single channels and the basic channel based on the relative positions and the unit splicing coefficients; splicing all other single channels to the basic channel according to the channel splicing coefficients to obtain the spliced image.
3. The method of determining image stitching coefficients of a linear array camera according to claim 2, characterized in that, The method of splicing all other single channels to the basic channel according to the channel splicing coefficients comprises the following steps: moving each single channel by a distance of N unit pixels in a direction of the basic channel according to a channel splicing coefficient corresponding to the single channel, wherein the distance of the unit pixel is a moving pixel distance corresponding to the unit splicing coefficient, the single channel is separated from the basic channel by (N-1) other single channels, and N is a positive integer greater than or equal to 1.
4. The method of determining image stitching coefficients of a linear array camera according to claim 1, characterized in that, The method of calculating a correlation coefficient of the basic channel and at least one other single channel in the spliced image comprises the following steps: obtaining a corresponding basic channel component x and a selected single channel component y to be calculated from the spliced image; calculating a correlation coefficient of the basic channel and the selected single channel under a unit splicing coefficient according to a correlation coefficient calculation formula, and the formula is: , wherein, , are the average values of the base channel component x and the selected single channel component y, respectively, of all pixels to be calculated in the current stitched image.
5. The method of determining image stitching coefficients of a linear array camera according to claim 4, characterized in that, The method of obtaining a plurality of sets of unit splicing coefficients and corresponding correlation coefficients and performing polynomial fitting based on the plurality of sets of unit splicing coefficients and the plurality of sets of corresponding correlation coefficients comprises the following steps: calculating a correlation coefficient of the corresponding basic channel and the selected single channel under different unit splicing coefficients; fitting a quadratic polynomial relationship between a unit splicing coefficient a and a correlation coefficient b by using a least square method, that is, 。 6. The method of determining image stitching coefficients of a linear array camera according to claim 5, characterized in that, The method of determining an optimal splicing coefficient based on a polynomial fitting result comprises the following steps: obtaining a unit splicing coefficient a corresponding to a maximum correlation coefficient b by finding an extreme value of the fitted binomial, and if a plurality of correlation coefficients of the selected single channels and the basic channel are calculated, then finding an average value of a plurality of unit splicing coefficients a as an optimal unit splicing coefficient.
7. An image stitching method characterized by, The method comprises the following steps: obtaining single channel parameters corresponding to a target object based on a linear array camera; determining a basic channel for image stitching; determining a splicing coefficient corresponding to splicing of each other single channel to the basic channel; The stitching image of the target object is obtained by stitching according to the stitching coefficients of each single channel; wherein the resolution of the stitching image is higher than that of the initial image captured by the linear array camera.
8. The image stitching method of claim 7, wherein, The method further comprises: The stitching coefficient of each single channel adjacent to the base channel is taken as a unit stitching coefficient, and the channel stitching coefficients of other single channels to the base channel are determined; The stitching of images is performed under different groups of unit stitching coefficients; At least one single channel is selected as a selected single channel; The correlation coefficient between the base channel and the selected single channel is calculated under each group of stitching images; The optimal unit stitching coefficient is found based on the numerical relationship between the unit stitching coefficients and the corresponding correlation coefficients; The channel stitching coefficients of other single channels to the base channel are determined based on the optimal unit stitching coefficient.
9. The image stitching method of claim 8, wherein, The method further comprises: The position of the base channel and the relative positions of all other single channels relative to the base channel are determined; The channel stitching coefficients of other single channels to the base channel are determined based on the relative positions and the unit stitching coefficients; Each single channel is moved by a distance of N unit pixels in the direction of the base channel according to the corresponding channel stitching coefficient; wherein the distance of N unit pixels is a moving pixel distance corresponding to the unit stitching coefficient, the single channel and the base channel are separated by (N-1) other single channels, and N is a positive integer greater than or equal to 1.
10. The image stitching method of claim 8 or 9, characterized in that, The method further comprises: The corresponding base channel component x and the selected single channel component y to be calculated are obtained according to the stitching image; The correlation coefficient of the base channel and the selected single channel under the unit stitching coefficient is calculated according to the correlation coefficient calculation formula, which is: , wherein, , are the average values of the base channel component x and the selected single channel component y, respectively, of all pixels to be calculated in the current stitched image.
11. The image stitching method of claim 10, wherein, The method further comprises: The correlation coefficients of the corresponding base channel and selected single channel are calculated under different unit stitching coefficients; The least square method is used to fit the quadratic polynomial relationship between the unit stitching coefficient a and the correlation coefficient b, i.e. , The extreme value of the fitted polynomial is obtained to obtain the unit stitching coefficient a corresponding to the maximum correlation coefficient b, and if multiple correlation coefficients of the selected single channel and the base channel are calculated, the average value of multiple unit stitching coefficients a is taken as the optimal unit stitching coefficient.