Method for quantitatively determining batch consistency of fruit and vegetable extract
By acquiring images of fruit and vegetable extracts under controlled lighting sequences and applying dual preset correction parameters, a dynamic response feature fingerprint is constructed, which solves the problem of difficult identification of pseudo-consistency in appearance mimicry in the prior art and realizes reliable quantitative determination of batch consistency of fruit and vegetable extracts.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU JIHAI FRUIT & VEGETABLE BEVERAGE ENG TECH CO LTD
- Filing Date
- 2026-02-04
- Publication Date
- 2026-06-05
Smart Images

Figure CN122157242A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of image processing and computer vision technology, and more specifically, to a method for quantitatively determining the batch consistency of fruit and vegetable extracts. Background Technology
[0002] In scenarios such as production release, warehousing acceptance, and channel sampling of fruit and vegetable extracts, current practices often transform batch consistency into an image recognition task of sample liquid appearance: sample liquid images are collected at fixed or semi-fixed shooting positions, and standard batch images or historical qualified samples are used as references. First, image correction processing such as white balance, exposure normalization, color mapping, distortion correction, and background segmentation is performed. Then, static visual features such as color distribution, turbidity texture, particle bubble spots, and liquid surface boundary gradient are extracted from the corrected sample liquid area, similarity is calculated, and a consistency score is output. However, structural risks are exposed layer by layer in the real business chain: First, appearance targets can be fitted. The overall color and clarity are highly sensitive to and operable to minor adjustments in formulation and process. Slight adjustments to trace amounts of pigments, clarifying agents, dilution ratios, or filtration intensity can bring the static appearance into the target range. Second, correction leads to difference compression. Image correction is geared towards reducing shooting differences. Normalization and bias removal processes compress subtle differences that should reflect batch deviations into a more difficult-to-discern range, making subsequent image identification more inclined to look more similar. Third, static features can be disguised. When the judgment mainly relies on single-frame color and texture statistics, appearance mimicry can easily meet multiple static thresholds simultaneously, forming a hidden distortion where the score is consistent but the composition system, microstructure state, or potential risks have deviated. This is exposed in the form of batch fluctuations in storage and transportation stability, terminal taste, or subsequent testing. Therefore, in the image identification process that relies primarily on static appearance as evidence, the existing image correction mechanism, while improving comparability, weakens discriminability, making it difficult to reliably identify pseudo-consistency caused by appearance mimicry in quantitative judgment. It is also impossible to reliably distinguish between genuine batch consistency and inconsistency masked by static appearance parameter tuning, which has become a technical problem that urgently needs to be solved. Summary of the Invention
[0003] To overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a quantitative determination method for batch consistency of fruit and vegetable extracts. The method involves sequentially acquiring images of a standard reference batch and a test batch under controlled illumination, combining dual preset correction parameters for parallel correction to form a comparison score between the test fingerprint and the reference fingerprint, and triggering a verification command based on the correction sensitivity. This solves the problem that existing image correction methods improve comparability but weaken distinguishability, making it difficult to identify pseudo-consistency in appearance.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for quantitatively determining the batch consistency of fruit and vegetable extracts, comprising: S1. Place the fruit and vegetable extract samples from the standard reference batch and the batch to be tested in the same preset shooting position, and take controlled lighting sequence continuous shots according to the preset lighting state, and sort them to form a standard image sequence and a test image sequence; S2. Perform container region recognition and sample liquid region localization frame by frame on the standard image sequence and the image sequence to be tested, and perform geometric alignment with the container boundary and the liquid surface boundary as constraints to form the standard sample liquid region sequence and the sample liquid region sequence to be tested, respectively. S3. The standard sample liquid region sequence is corrected through a preset image correction link to output a standard correction sequence; the test sample liquid region sequence is image corrected according to the preset image correction link using the first preset correction parameters and the second preset correction parameters respectively, and the first correction sequence and the second correction sequence are output; the correction residuals of the first correction sequence and the second correction sequence are calculated in the same frame under the same illumination state and within the same test sample liquid region, and the correction sensitivity is generated based on the correction residuals; S4. Perform image discrimination on the standard calibration sequence according to the preset illumination state order to extract dynamic response features and form a reference fingerprint; perform image discrimination on the first calibration sequence and the second calibration sequence respectively to form a first fingerprint to be tested and a second fingerprint to be tested; S5. Calculate the similarity between the first fingerprint to be tested and the reference fingerprint to obtain the first consistency score, and calculate the similarity between the second fingerprint to be tested and the reference fingerprint to obtain the second consistency score; compare the first consistency score and the second consistency score with the preset consistency threshold to generate a consistency judgment mark, and output the consistency quantification judgment result of the batch to be tested based on the consistency judgment mark; compare the correction sensitivity with the preset sensitivity threshold to generate a review trigger mark, and output the review instruction based on the review trigger mark.
[0005] In a preferred embodiment, S1 includes, under the same preset shooting position, sequentially controlling the light source to output the corresponding lighting state according to a preset lighting state sequence, thereby constructing a controlled lighting sequence based on the preset lighting state sequence; The fruit and vegetable extract samples of the standard reference batch were placed in a preset shooting position, and continuous shooting was triggered synchronously under each lighting condition of the controlled lighting sequence to acquire a set of sample images of the standard reference batch; The sample image set of the standard reference batch is sorted according to the preset lighting state order to obtain a standard image sequence that corresponds one-to-one with the preset lighting state order; The fruit and vegetable extract samples of the batch to be tested are placed under the preset shooting position. The light source outputs the corresponding lighting states in sequence according to the preset lighting state, and continuous shooting is triggered synchronously under each lighting state to obtain a set of sample images of the batch to be tested. The sample image set of the batch to be tested is sorted according to the preset lighting state order to obtain the test image sequence that corresponds one-to-one with the preset lighting state order.
[0006] In a preferred embodiment, S2 includes performing container region identification frame by frame on the standard image sequence and the image sequence to be tested, outputting the container boundary corresponding to each frame, and determining the container coordinate reference of each frame using the container boundary; Under the container coordinate reference of each frame, the liquid surface boundary is extracted within the container boundary range, and the liquid surface boundary is used to determine the liquid surface constraint of each frame; In each frame of the image, the sample liquid area is defined according to the container boundary and the liquid surface boundary. The standard sample liquid area frame and the sample liquid to be tested area frame are cropped respectively. Anchor points inside the sample liquid are extracted in the standard sample liquid area frame and the sample liquid to be tested area frame to generate anchor point constraints. For frames corresponding to the same lighting state, the geometric transformation relationship is solved based on the container coordinate reference, liquid surface constraint, and anchor point constraint. This geometric transformation relationship is then applied to the standard sample liquid region frame and the sample liquid region frame to be tested, resulting in aligned standard sample liquid region frames and aligned sample liquid region frames to be tested. Simultaneously, the alignment residual is calculated based on the aligned container boundary, aligned liquid surface boundary, and aligned anchor points inside the sample liquid. The aligned residuals are compared with the preset convergence criteria. When the alignment residual does not meet the preset convergence condition, abnormal anchor points are removed based on the alignment residual, and the geometric transformation relationship is resolved. The aligned standard sample liquid region frame and the aligned test sample liquid region frame are updated, and the alignment residual is recalculated. When the preset number of iterations is reached and the alignment residual still does not meet the preset convergence condition, a culling mark is generated for the frame corresponding to the same lighting state. The aligned standard sample region frames without rejection marks are combined according to the frame order of the standard image sequence to form a standard sample region sequence, and the aligned test sample region frames without rejection marks are combined according to the frame order of the test image sequence to form a test sample region sequence.
[0007] In a preferred embodiment, S3 includes inputting the standard sample liquid region sequence frame by frame into a preset image correction link, performing white balance correction, exposure correction, distortion correction and color mapping sequentially on each frame through the preset image correction link, and outputting a standard correction sequence that corresponds one-to-one with the preset lighting state sequence; For each frame corresponding to the same illumination state in the sequence of the sample liquid area to be tested: read the first preset correction parameter and write it into the parameter input of white balance correction and exposure correction; output the frame image corresponding to the same illumination state in the first correction sequence through the preset image correction link; read the second preset correction parameter and write it into the parameter input of white balance correction and exposure correction; output the frame image corresponding to the same illumination state in the second correction sequence through the preset image correction link; and combine the frame images corresponding to the same illumination state in the preset illumination state order to form the first correction sequence and the second correction sequence. For each frame corresponding to the same illumination state, the absolute difference of each frame in the first correction sequence and the frame in the second correction sequence corresponding to the same illumination state is calculated within the same sample liquid area, and the correction difference map is output; and the mean of the absolute difference of each pixel in the correction difference map is statistically analyzed to generate the first frame-level correction residual.
[0008] In a preferred embodiment, S3 further includes performing threshold discrimination on the correction difference map and statistically analyzing the percentage of pixels in the correction difference map whose absolute pixel difference is greater than a preset difference threshold; When the pixel ratio is not less than a preset ratio threshold, the positions where the absolute pixel difference is greater than the preset difference threshold are marked as abnormal regions, and the remaining positions are marked as non-abnormal regions. An abnormal difference mask is generated, and the mean value of the absolute pixel difference in the correction difference map is calculated within the non-abnormal region defined by the abnormal difference mask to generate the second frame-level correction residual. When the pixel ratio is less than the preset ratio threshold, the first frame-level correction residual is used as the second frame-level correction residual; The second-frame-level correction residual is compared with a preset residual threshold: when the second-frame-level correction residual is greater than the preset residual threshold, a sensitive marker is generated for the frame corresponding to the same lighting state; when the second-frame-level correction residual is not greater than the preset residual threshold, no sensitive marker is generated; and the second-frame-level correction residuals corresponding to the frames of the same lighting state for which no sensitive markers have been generated are aggregated in the order of the preset lighting states to form a residual sequence. Sensitivity statistics are performed on the residual sequence to generate correction sensitivity.
[0009] In a preferred embodiment, S4 includes processing the standard calibration sequence frame by frame according to a preset illumination state order, dividing the sample liquid area into multiple sub-regions according to a preset spatial division rule within the sample liquid area corresponding to the standard calibration sequence of each frame with the same illumination state, and generating a corresponding region identifier for each sub-region; Within each sub-region, the brightness value statistics, color channel difference statistics, and spatial gradient change statistics of the pixels in that sub-region are performed respectively. The color channel difference statistics include calculating the pairwise differences of the color channel values of the pixels and performing statistics on the difference results. The spatial gradient change statistics include calculating the gradient of the pixels and performing statistics on the gradient results to obtain the region response vector of the sub-region under the current lighting condition. Then, the region response vectors of each sub-region in the frame corresponding to the same lighting state are combined in order of region identifier to generate the frame-level response vector of the frame corresponding to that lighting state; The frame-level response vectors corresponding to different lighting states are sequentially concatenated according to the preset lighting state order to form a standard dynamic response feature sequence; and the difference calculation is performed on the frame-level response vectors corresponding to adjacent lighting states in the standard dynamic response feature sequence to generate a time-series response difference sequence.
[0010] In a preferred embodiment, S4 further includes performing a consistency determination process on the time-series response difference sequence by statistically analyzing the proportion of items in the time-series response difference sequence whose differences are greater than a preset time-series difference threshold; When the ratio is not less than the preset ratio threshold, the preset spatial partitioning rule is adjusted based on the time-series response difference sequence, and a standard dynamic response feature sequence is generated based on the adjusted preset spatial partitioning rule. A time-series response difference sequence is generated, and consistency determination processing is performed. When the ratio is less than the preset ratio threshold, the standard dynamic response characteristic sequence is confirmed. The confirmed standard dynamic response feature sequence is subjected to fingerprint construction processing, which includes vectorizing the frame-level response vector according to the preset illumination state order and concatenating them according to the sub-region order to form a reference fingerprint; For the first correction sequence and the second correction sequence, frame-level response vectors corresponding to the lighting state are generated sequentially according to the preset lighting state order and spliced to form the dynamic response feature sequence to be tested. Then, difference calculation, consistency judgment processing and fingerprint construction processing are performed on the dynamic response feature sequence to be tested to generate the first fingerprint to be tested and the second fingerprint to be tested.
[0011] In a preferred embodiment, S5 includes establishing a positional correspondence between the first fingerprint to be tested and the reference fingerprint according to a preset illumination state order and a sub-region order, performing difference calculation at the corresponding positions, and performing mean statistics on the difference results to generate a first consistency score; The second fingerprint to be tested and the reference fingerprint are established in a positional correspondence with the sub-region sequence according to the preset illumination state sequence. The difference is calculated at the corresponding position and the mean of the difference results is statistically analyzed to generate a second consistency score. The first consistency score and the second consistency score are compared with a preset consistency threshold: a consistency pass flag is generated when both the first consistency score and the second consistency score are not less than the preset consistency threshold; a consistency fail flag is generated when either the first consistency score or the second consistency score is less than the preset consistency threshold. The consistency quantification judgment result of the batch under test is output based on the consistency pass flag and the consistency fail flag. The calibration sensitivity is compared with a preset sensitivity threshold: a review trigger flag is generated when the calibration sensitivity is greater than the preset sensitivity threshold, and no review trigger flag is generated when the calibration sensitivity is not greater than the preset sensitivity threshold; and a review instruction is output based on the review trigger flag.
[0012] Technical effects and advantages of the present invention: By constructing a first test fingerprint and a second test fingerprint from the first correction sequence and a second correction sequence respectively, and calculating a first consistency score and a second consistency score with the reference fingerprint respectively to generate a consistency judgment mark, the correction sensitivity is compared with a preset sensitivity threshold to generate a review trigger mark and output a review instruction. This allows batches that are similar in appearance but sensitive to correction parameters to be identified and isolated in the scoring and review links, preventing inconsistencies from being masked by appearance and allowing direct release. By constructing a controlled lighting sequence according to a preset lighting state under the same preset shooting position and simultaneously triggering continuous shooting, and then sorting the sample image set according to the preset lighting state to form a standard image sequence and a test image sequence, a stable correspondence is established between the standard reference batch and the test batch at the frame level under the same lighting state. This provides a reusable frame sequence input for subsequent image identification and reference fingerprint construction according to the preset lighting state. The container coordinate reference is determined by the container boundary, the liquid surface constraint is formed by the liquid surface boundary, and the anchor point constraint is formed by the anchor point inside the sample liquid. The abnormal anchor point removal, iterative re-solution and removal mark are controlled by the alignment residual and preset convergence conditions. This ensures that the standard sample liquid region sequence and the sample liquid region sequence to be tested are consistent in geometric position and liquid surface constraint when entering the correction and image recognition stage, reducing the interference of posture, framing and liquid surface fluctuation on the consistency score. By generating sub-regions and region identifiers within the sample liquid area according to preset spatial division rules, and performing brightness value statistics, color channel difference statistics, and spatial gradient change statistics within the sub-regions to form region response vectors, and then splicing them together with the region identifiers and preset lighting states in sequence to form a standard dynamic response feature sequence, the reference fingerprint is composed of a combination of responses from multiple sub-regions and multiple lighting states, transforming the single-frame static appearance into comparable dynamic response evidence, thereby improving the completeness of evidence for batch consistency quantitative judgment. Attached Figure Description
[0013] Figure 1This is a flowchart of the method steps of the present invention. Detailed Implementation
[0014] 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 some embodiments of the present invention, and not all embodiments. 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.
[0015] Refer to the instruction manual appendix Figure 1 An embodiment of the present invention provides a method for quantitatively determining the batch consistency of fruit and vegetable extracts, comprising: S1. Place the fruit and vegetable extract samples from the standard reference batch and the batch to be tested in the same preset shooting position, and take controlled lighting sequence continuous shots according to the preset lighting state, and sort them to form a standard image sequence and a test image sequence; S2. Perform container region recognition and sample liquid region localization frame by frame on the standard image sequence and the image sequence to be tested, and perform geometric alignment with the container boundary and the liquid surface boundary as constraints to form the standard sample liquid region sequence and the sample liquid region sequence to be tested, respectively. S3. The standard sample liquid region sequence is corrected through a preset image correction link to output a standard correction sequence; the test sample liquid region sequence is image corrected according to the preset image correction link using the first preset correction parameters and the second preset correction parameters respectively, and the first correction sequence and the second correction sequence are output; the correction residuals of the first correction sequence and the second correction sequence are calculated in the same frame under the same illumination state and within the same test sample liquid region, and the correction sensitivity is generated based on the correction residuals; S4. Perform image discrimination on the standard calibration sequence according to the preset illumination state order to extract dynamic response features and form a reference fingerprint; perform image discrimination on the first calibration sequence and the second calibration sequence respectively to form a first fingerprint to be tested and a second fingerprint to be tested; S5. Calculate the similarity between the first fingerprint to be tested and the reference fingerprint to obtain the first consistency score, and calculate the similarity between the second fingerprint to be tested and the reference fingerprint to obtain the second consistency score; compare the first consistency score and the second consistency score with the preset consistency threshold to generate a consistency judgment mark, and output the consistency quantification judgment result of the batch to be tested based on the consistency judgment mark; compare the correction sensitivity with the preset sensitivity threshold to generate a review trigger mark, and output the review instruction based on the review trigger mark.
[0016] S1 includes controlling the light source output corresponding lighting states sequentially according to the preset lighting state sequence under the same preset shooting position, and constructing a controlled lighting sequence based on the preset lighting state sequence; The fruit and vegetable extract samples of the standard reference batch were placed in a preset shooting position, and continuous shooting was triggered synchronously under each lighting condition of the controlled lighting sequence to acquire a set of sample images of the standard reference batch; The sample image set of the standard reference batch is sorted according to the preset lighting state order to obtain a standard image sequence that corresponds one-to-one with the preset lighting state order; The fruit and vegetable extract samples of the batch to be tested are placed under the preset shooting position. The light source outputs the corresponding lighting states in sequence according to the preset lighting state, and continuous shooting is triggered synchronously under each lighting state to obtain a set of sample images of the batch to be tested. The sample image set of the batch to be tested is sorted according to the preset lighting state order to obtain the test image sequence that corresponds one-to-one with the preset lighting state order.
[0017] S2 includes performing container region recognition frame by frame on the standard image sequence and the image sequence to be tested, outputting the container boundary corresponding to each frame, and determining the container coordinate reference of each frame based on the container boundary; Under the container coordinate reference of each frame, the liquid surface boundary is extracted within the container boundary range, and the liquid surface boundary is used to determine the liquid surface constraint of each frame; In each frame of the image, the sample liquid area is defined according to the container boundary and the liquid surface boundary. The standard sample liquid area frame and the sample liquid to be tested area frame are cropped respectively. Anchor points inside the sample liquid are extracted in the standard sample liquid area frame and the sample liquid to be tested area frame to generate anchor point constraints. For frames corresponding to the same lighting state, the geometric transformation relationship is solved based on the container coordinate reference, liquid surface constraint, and anchor point constraint. This geometric transformation relationship is then applied to the standard sample liquid region frame and the sample liquid region frame to be tested, resulting in aligned standard sample liquid region frames and aligned sample liquid region frames to be tested. Simultaneously, the alignment residual is calculated based on the aligned container boundary, aligned liquid surface boundary, and aligned anchor points inside the sample liquid. The aligned residuals are compared with the preset convergence criteria. When the alignment residual does not meet the preset convergence condition, abnormal anchor points are removed based on the alignment residual, and the geometric transformation relationship is resolved. The aligned standard sample liquid region frame and the aligned test sample liquid region frame are updated, and the alignment residual is recalculated. When the preset number of iterations is reached and the alignment residual still does not meet the preset convergence condition, a culling mark is generated for the frame corresponding to the same lighting state. The aligned standard sample region frames without rejection marks are combined according to the frame order of the standard image sequence to form a standard sample region sequence, and the aligned test sample region frames without rejection marks are combined according to the frame order of the test image sequence to form a test sample region sequence; It should be noted that, in the specific implementation, the preset convergence condition is used to determine whether the alignment residual meets the convergence criterion, and the preset number of iterations is used to limit the maximum number of iterations for performing abnormal anchor point removal and resolving the geometric transformation relationship on the anchor point constraint; the alignment residual is calculated under the same lighting state corresponding frame: the average pixel distance between the aligned container boundaries, the average pixel distance between the aligned liquid surface boundaries, and the average pixel distance between the aligned sample liquid internal anchor points are calculated respectively, and the above three average pixel distances are added together to obtain the alignment residual; in this implementation, the preset convergence condition is set to the alignment residual being no more than three pixels. When the alignment residual does not meet the preset convergence condition, based on the... The alignment residual performs abnormal anchor point removal on the anchor point constraint and re-solves the geometric transformation relationship, updates the aligned standard sample liquid region frame and the aligned test sample liquid region frame, and recalculates the alignment residual. In this embodiment, the preset number of iterations is set to five. When the preset number of iterations is reached and the alignment residual still does not meet the preset convergence condition, a removal mark is generated for the frame corresponding to the same lighting state. When combining the standard sample liquid region sequence and the test sample liquid region sequence, the aligned standard sample liquid region frame and the aligned test sample liquid region frame with the removal mark are removed. Only the aligned standard sample liquid region frame and the aligned test sample liquid region frame without the removal mark are retained for subsequent processing.
[0018] S3 includes inputting the standard sample liquid region sequence frame by frame into a preset image correction link, performing white balance correction, exposure correction, distortion correction and color mapping on each frame sequentially through the preset image correction link, and outputting a standard correction sequence that corresponds one-to-one with the preset lighting state sequence; For each frame corresponding to the same illumination state in the sequence of the sample liquid area to be tested: read the first preset correction parameter and write it into the parameter input of white balance correction and exposure correction; output the frame image corresponding to the same illumination state in the first correction sequence through the preset image correction link; read the second preset correction parameter and write it into the parameter input of white balance correction and exposure correction; output the frame image corresponding to the same illumination state in the second correction sequence through the preset image correction link; and combine the frame images corresponding to the same illumination state in the preset illumination state order to form the first correction sequence and the second correction sequence. For each frame corresponding to the same illumination state, the absolute difference of each frame in the first correction sequence and the frame in the second correction sequence corresponding to the same illumination state is calculated within the same sample liquid area, and the correction difference map is output; and the mean of the absolute difference of each pixel in the correction difference map is statistically analyzed to generate the first frame-level correction residual.
[0019] S3 also includes performing threshold discrimination on the correction difference map and statistically analyzing the percentage of pixels in the correction difference map whose absolute pixel difference is greater than a preset difference threshold; When the pixel ratio is not less than a preset ratio threshold, the positions where the absolute pixel difference is greater than the preset difference threshold are marked as abnormal regions, and the remaining positions are marked as non-abnormal regions. An abnormal difference mask is generated, and the mean value of the absolute pixel difference in the correction difference map is calculated within the non-abnormal region defined by the abnormal difference mask to generate the second frame-level correction residual. When the pixel ratio is less than the preset ratio threshold, the first frame-level correction residual is used as the second frame-level correction residual; The second-frame-level correction residual is compared with a preset residual threshold: when the second-frame-level correction residual is greater than the preset residual threshold, a sensitive marker is generated for the frame corresponding to the same lighting state; when the second-frame-level correction residual is not greater than the preset residual threshold, no sensitive marker is generated; and the second-frame-level correction residuals corresponding to the frames of the same lighting state for which no sensitive markers have been generated are aggregated in the order of the preset lighting states to form a residual sequence. Sensitivity statistics are performed on the residual sequence to generate correction sensitivity.
[0020] S4 includes processing the standard calibration sequence frame by frame according to a preset illumination state order, dividing the sample liquid region into multiple sub-regions according to a preset spatial division rule within the sample liquid region corresponding to the standard calibration sequence of each frame with the same illumination state, and generating a corresponding region identifier for each sub-region; Within each sub-region, the brightness value statistics, color channel difference statistics, and spatial gradient change statistics of the pixels in that sub-region are performed respectively. The color channel difference statistics include calculating the pairwise differences of the color channel values of the pixels and performing statistics on the difference results. The spatial gradient change statistics include calculating the gradient of the pixels and performing statistics on the gradient results to obtain the region response vector of the sub-region under the current lighting condition. Then, the region response vectors of each sub-region in the frame corresponding to the same lighting state are combined in order of region identifier to generate the frame-level response vector of the frame corresponding to that lighting state; The frame-level response vectors corresponding to different lighting states are sequentially concatenated according to the preset lighting state order to form a standard dynamic response feature sequence; and the difference calculation is performed on the frame-level response vectors corresponding to adjacent lighting states in the standard dynamic response feature sequence to generate a time-series response difference sequence.
[0021] S4 also includes performing consistency determination processing on the time-series response difference sequence by statistically analyzing the proportion of items in the time-series response difference sequence whose differences are greater than a preset time-series difference threshold; When the ratio is not less than the preset ratio threshold, the preset spatial partitioning rule is adjusted based on the time-series response difference sequence, and a standard dynamic response feature sequence is generated based on the adjusted preset spatial partitioning rule. A time-series response difference sequence is generated, and consistency determination processing is performed. When the ratio is less than the preset ratio threshold, the standard dynamic response characteristic sequence is confirmed. The confirmed standard dynamic response feature sequence is subjected to fingerprint construction processing, which includes vectorizing the frame-level response vector according to the preset illumination state order and concatenating them according to the sub-region order to form a reference fingerprint; For the first correction sequence and the second correction sequence, frame-level response vectors corresponding to the lighting state are generated sequentially according to the preset lighting state order and spliced to form the dynamic response feature sequence to be tested. Then, difference calculation, consistency judgment processing and fingerprint construction processing are performed on the dynamic response feature sequence to be tested to generate the first fingerprint to be tested and the second fingerprint to be tested.
[0022] S5 includes establishing a positional correspondence between the first fingerprint to be tested and the reference fingerprint according to a preset illumination state order and a sub-region order, performing difference calculation at the corresponding positions, and performing mean statistics on the difference results to generate a first consistency score; The second fingerprint to be tested and the reference fingerprint are established in a positional correspondence with the sub-region sequence according to the preset illumination state sequence. The difference is calculated at the corresponding position and the mean of the difference results is statistically analyzed to generate a second consistency score. The first consistency score and the second consistency score are compared with a preset consistency threshold: a consistency pass flag is generated when both the first consistency score and the second consistency score are not less than the preset consistency threshold; a consistency fail flag is generated when either the first consistency score or the second consistency score is less than the preset consistency threshold. The consistency quantification judgment result of the batch under test is output based on the consistency pass flag and the consistency fail flag. The calibration sensitivity is compared with a preset sensitivity threshold: a review trigger flag is generated when the calibration sensitivity is greater than the preset sensitivity threshold, and no review trigger flag is generated when the calibration sensitivity is not greater than the preset sensitivity threshold; and a review instruction is output based on the review trigger flag.
[0023] It should be noted that in the current process of production release, warehousing acceptance, and channel sampling of fruit and vegetable extracts, batch consistency is often compressed into image identification of the sample liquid's appearance: first, image correction is performed on white balance, exposure, distortion, and color mapping; then, static features such as color, texture, spots, and boundary gradients are extracted from the corrected sample liquid area, and a consistency score is given. However, in real business processes, structural risks are exposed layer by layer, and the appearance target can be fitted by process fine-tuning. Moreover, image correction is bias-removing oriented, which compresses the subtle differences that should reflect batch deviations into a more difficult-to-identify range. Ultimately, this results in hidden distortions where the static threshold is met, but the component system, microstructure state, or potential risks have deviated. This makes it difficult to quantitatively distinguish between true consistency and inconsistencies masked by appearance mimicry. In this scheme, the static appearance of a single frame is transformed into a dynamic response under controlled lighting sequence, and image correction itself is transformed into the object of inspection. In practice, a controlled lighting sequence is first constructed in the same preset shooting position according to the preset lighting state order. The standard reference batch and the batch to be tested are simultaneously triggered for continuous shooting and sorted according to the preset lighting state order to form a standard image sequence and a test image sequence. The lighting state and frame order are locked as a common index for subsequent alignment, correction and identification from the source. Subsequently, container region recognition and sample liquid region localization were performed frame by frame on both types of image sequences. First, the container coordinate reference was determined by the container boundary. Then, the liquid surface boundary was extracted within the container boundary range to form a liquid surface constraint. Anchor points inside the sample liquid were extracted in the standard sample liquid region frame and the sample liquid region frame to form an anchor point constraint. For frames corresponding to the same lighting state, the geometric transformation relationship was solved based on the container coordinate reference, liquid surface constraint, and anchor point constraint and applied to the two types of sample liquid region frames to obtain aligned frames. At the same time, the alignment residual was calculated. If the residual did not meet the preset convergence condition, abnormal anchor points were removed and the solution was resolved. If the iteration reached a preset number of times and still did not converge, a removal mark was generated. Finally, only the alignment results without removal marks were combined in frame order to form the standard sample liquid region sequence and the sample liquid region sequence to be tested. This isolated the geometric misalignment caused by container posture difference, liquid surface fluctuation, and local reflection in the alignment process and blocked its propagation backward with removal marks. In the image correction stage, this scheme quantifies the impact of correction on the judgment: the standard sample liquid region sequence is input frame by frame into the preset image correction link, and white balance correction, exposure correction, distortion correction and color mapping are performed sequentially for each frame to obtain the standard correction sequence; the sample liquid region sequence to be tested is processed in two paths under the same preset image correction link, reading the first preset correction parameters and the second preset correction parameters respectively and writing them into the parameter inputs of white balance correction and exposure correction, and outputting the first correction sequence and the second correction sequence; then, in the same frame under the same lighting condition and within the same sample liquid region to be tested, the absolute difference of the first correction sequence and the second correction sequence is calculated pixel by pixel to output the correction difference map, and the mean is statistically analyzed on the correction difference map to obtain the first frame-level correction residual; then, the correction difference map is thresholded. Value discrimination: When the pixel proportion is not less than a preset proportion threshold, an abnormal difference mask is generated and limited to non-abnormal areas to obtain the second frame-level correction residual. When the pixel proportion is less than the preset proportion threshold, the first frame-level correction residual is used as the second frame-level correction residual. The second frame-level correction residual is compared with the preset residual threshold to generate a sensitive marker. The second frame-level correction residuals that do not generate sensitive markers are aggregated in the order of preset illumination states to form a residual sequence. Sensitivity statistical processing is performed on the residual sequence to generate correction sensitivity. This makes the correction difference map and residual sequence of the same sample liquid area under two sets of preset correction parameters explicit, turning the risk of the correction causing the difference to be compressed into correction sensitivity. Subsequent review instructions no longer rely on abstract experience, but are triggered by the comparison result of correction sensitivity and preset sensitivity threshold. In the image recognition and scoring stage, this scheme transforms the controlled illumination sequence into a comparable dynamic response fingerprint: the standard calibration sequence is processed frame by frame according to the preset illumination state order; within the sample liquid region corresponding to the same illumination state, sub-regions are divided according to the preset spatial division rules, and region identifiers are generated; within each sub-region, brightness value statistics, color channel difference statistics, and spatial gradient change statistics are performed to obtain the region response vector, which is then combined into a frame-level response vector according to the region identifier order; the frame-level response vectors corresponding to different illumination states are concatenated according to the preset illumination state order to form a standard dynamic response feature sequence, and the difference between the frame-level response vectors corresponding to adjacent illumination states is calculated to obtain the temporal response difference sequence; Subsequently, a consistency determination process is performed on the temporal response difference sequence. The proportion of terms with differences greater than a preset temporal difference threshold is counted and compared with a preset proportion threshold. If the proportion is not less than the preset proportion threshold, the preset spatial partitioning rules are adjusted, and the standard dynamic response feature sequence and temporal response difference sequence are regenerated, and the consistency determination process is performed again. If the proportion is less than the preset proportion threshold, the standard dynamic response feature sequence is confirmed, and fingerprint construction is performed. The frame-level response vector is vectorized according to the preset illumination state order and spliced according to the sub-region order to form a reference fingerprint. The first correction sequence and the second correction sequence form the first test fingerprint and the second test fingerprint respectively according to the same rule. Finally, the output results are broken down into two clearly defined links: First, the first fingerprint to be tested and the reference fingerprint are established with a positional correspondence according to the preset lighting state order and sub-region order. Difference calculation is performed at the corresponding positions and the results are aggregated to generate a first consistency score. The same process is performed on the second fingerprint to be tested and the reference fingerprint to generate a second consistency score. The two consistency scores are compared with a preset consistency threshold to generate a consistency pass or consistency fail flag, and the consistency quantification judgment result of the batch to be tested is output based on the flag. Second, the correction sensitivity is compared with a preset sensitivity threshold to generate a review trigger flag, and a review instruction is output based on the review trigger flag. In this way, the consistency quantification judgment result is generated by the threshold comparison of the dual fingerprint similarity scores, and the review instruction is generated by the threshold comparison of the correction sensitivity. The two correspond to the judgment basis of batch consistency and appearance mimicry risk exposure, respectively. The source and triggering conditions are kept in closed-loop alignment within the process.
[0024] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for quantitatively determining the batch consistency of fruit and vegetable extracts, characterized in that... ,include: S1. Place the fruit and vegetable extract samples from the standard reference batch and the batch to be tested in the same preset shooting position, and take controlled lighting sequence continuous shots according to the preset lighting state, and sort them to form a standard image sequence and a test image sequence; S2. Perform container region recognition and sample liquid region localization frame by frame on the standard image sequence and the image sequence to be tested, and perform geometric alignment with the container boundary and the liquid surface boundary as constraints to form the standard sample liquid region sequence and the sample liquid region sequence to be tested, respectively. S3. The standard sample liquid region sequence is corrected through a preset image correction link to output a standard correction sequence; the test sample liquid region sequence is image corrected according to the preset image correction link using the first preset correction parameters and the second preset correction parameters respectively, and the first correction sequence and the second correction sequence are output; the correction residuals of the first correction sequence and the second correction sequence are calculated in the same frame under the same illumination state and within the same test sample liquid region, and the correction sensitivity is generated based on the correction residuals; S4. Perform image discrimination on the standard calibration sequence according to the preset illumination state order to extract dynamic response features and form a reference fingerprint; perform image discrimination on the first calibration sequence and the second calibration sequence respectively to form a first fingerprint to be tested and a second fingerprint to be tested; S5. Calculate the similarity between the first fingerprint to be tested and the reference fingerprint to obtain the first consistency score, and calculate the similarity between the second fingerprint to be tested and the reference fingerprint to obtain the second consistency score; compare the first consistency score and the second consistency score with the preset consistency threshold to generate a consistency judgment mark, and output the consistency quantification judgment result of the batch to be tested based on the consistency judgment mark; compare the correction sensitivity with the preset sensitivity threshold to generate a review trigger mark, and output the review instruction based on the review trigger mark.
2. The method for quantitatively determining batch consistency of fruit and vegetable extracts according to claim 1, characterized in that... S1 includes controlling the light source output corresponding lighting states sequentially according to the preset lighting state sequence under the same preset shooting position, and constructing a controlled lighting sequence based on the preset lighting state sequence; The fruit and vegetable extract samples of the standard reference batch were placed in a preset shooting position, and continuous shooting was triggered synchronously under each lighting condition of the controlled lighting sequence to obtain a set of sample images of the standard reference batch; The sample image set of the standard reference batch is sorted according to the preset lighting state order to obtain a standard image sequence that corresponds one-to-one with the preset lighting state order; The fruit and vegetable extract samples of the batch to be tested are placed under the preset shooting position. The light source outputs the corresponding lighting states in sequence according to the preset lighting state, and continuous shooting is triggered synchronously under each lighting state to obtain a set of sample images of the batch to be tested. The sample image set of the batch to be tested is sorted according to the preset lighting state order to obtain the test image sequence that corresponds one-to-one with the preset lighting state order.
3. The method for quantitatively determining the batch consistency of fruit and vegetable extracts according to claim 2, characterized in that... S2 includes performing container region recognition frame by frame on the standard image sequence and the image sequence to be tested, outputting the container boundary corresponding to each frame, and determining the container coordinate reference of each frame based on the container boundary; Under the container coordinate reference of each frame, the liquid surface boundary is extracted within the container boundary range, and the liquid surface boundary is used to determine the liquid surface constraint of each frame; In each frame of the image, the sample liquid area is defined according to the container boundary and the liquid surface boundary. The standard sample liquid area frame and the sample liquid to be tested area frame are cropped respectively. Anchor points inside the sample liquid are extracted in the standard sample liquid area frame and the sample liquid to be tested area frame to generate anchor point constraints. For frames corresponding to the same lighting state, the geometric transformation relationship is solved based on the container coordinate reference, liquid surface constraint, and anchor point constraint. This geometric transformation relationship is then applied to the standard sample liquid region frame and the sample liquid region frame to be tested, resulting in aligned standard sample liquid region frames and aligned sample liquid region frames to be tested. Simultaneously, the alignment residual is calculated based on the aligned container boundary, aligned liquid surface boundary, and aligned anchor points inside the sample liquid. The aligned residuals are compared with preset convergence criteria. When the alignment residual does not meet the preset convergence condition, abnormal anchor points are removed based on the alignment residual, and the geometric transformation relationship is resolved. The aligned standard sample liquid region frame and the aligned test sample liquid region frame are updated, and the alignment residual is recalculated. When the preset number of iterations is reached and the alignment residual still does not meet the preset convergence condition, a culling mark is generated for the frame corresponding to the same lighting state. The aligned standard sample region frames without rejection marks are combined according to the frame order of the standard image sequence to form a standard sample region sequence, and the aligned test sample region frames without rejection marks are combined according to the frame order of the test image sequence to form a test sample region sequence.
4. The method for quantitatively determining the batch consistency of fruit and vegetable extracts according to claim 3, characterized in that... S3 includes inputting the standard sample liquid region sequence frame by frame into a preset image correction link, performing white balance correction, exposure correction, distortion correction and color mapping on each frame sequentially through the preset image correction link, and outputting a standard correction sequence that corresponds one-to-one with the preset lighting state sequence; For each frame corresponding to the same illumination state in the sequence of the sample liquid area to be tested: read the first preset correction parameter and write it into the parameter input of white balance correction and exposure correction; output the frame image corresponding to the same illumination state in the first correction sequence through the preset image correction link; read the second preset correction parameter and write it into the parameter input of white balance correction and exposure correction; output the frame image corresponding to the same illumination state in the second correction sequence through the preset image correction link; and combine the frame images corresponding to the same illumination state in the preset illumination state order to form the first correction sequence and the second correction sequence. For each frame corresponding to the same illumination state, the absolute difference of each frame in the first correction sequence and the frame in the second correction sequence corresponding to the same illumination state is calculated within the same sample liquid area, and the correction difference map is output; and the mean of the absolute difference of each pixel in the correction difference map is statistically analyzed to generate the first frame-level correction residual.
5. The method for quantitatively determining batch consistency of fruit and vegetable extracts according to claim 4, characterized in that... S3 also includes performing threshold discrimination on the correction difference map and counting the percentage of pixels in the correction difference map whose absolute pixel difference is greater than a preset difference threshold; When the pixel ratio is not less than a preset ratio threshold, the positions where the absolute pixel difference is greater than the preset difference threshold are marked as abnormal regions, and the remaining positions are marked as non-abnormal regions. An abnormal difference mask is generated, and the mean value of the absolute pixel difference in the correction difference map is calculated within the non-abnormal region defined by the abnormal difference mask to generate the second frame-level correction residual. When the pixel ratio is less than the preset ratio threshold, the first frame-level correction residual is used as the second frame-level correction residual; The second-frame-level correction residual is compared with a preset residual threshold: when the second-frame-level correction residual is greater than the preset residual threshold, a sensitive marker is generated for the frame corresponding to the same lighting state; when the second-frame-level correction residual is not greater than the preset residual threshold, no sensitive marker is generated; and the second-frame-level correction residuals corresponding to the frames of the same lighting state for which no sensitive markers have been generated are aggregated in the order of the preset lighting states to form a residual sequence. Sensitivity statistics are performed on the residual sequence to generate correction sensitivity.
6. The method for quantitatively determining the batch consistency of fruit and vegetable extracts according to claim 5, characterized in that... S4 includes processing the standard calibration sequence frame by frame according to a preset illumination state order, dividing the sample liquid area into multiple sub-regions according to a preset spatial division rule within the sample liquid area corresponding to the standard calibration sequence of each frame with the same illumination state, and generating a corresponding region identifier for each sub-region; Within each sub-region, the brightness value statistics, color channel difference statistics, and spatial gradient change statistics of the pixels in that sub-region are performed respectively. The color channel difference statistics include calculating the pairwise differences of the color channel values of the pixels and performing statistics on the difference results. The spatial gradient change statistics include calculating the gradient of the pixels and performing statistics on the gradient results to obtain the region response vector of the sub-region under the current lighting condition. Then, the region response vectors of each sub-region in the frame corresponding to the same lighting state are combined in order of region identifier to generate the frame-level response vector of the frame corresponding to that lighting state; The frame-level response vectors corresponding to different lighting states are sequentially concatenated according to the preset lighting state order to form a standard dynamic response feature sequence; and the difference calculation is performed on the frame-level response vectors corresponding to adjacent lighting states in the standard dynamic response feature sequence to generate a time-series response difference sequence.
7. The method for quantitatively determining batch consistency of fruit and vegetable extracts according to claim 6, characterized in that... S4 also includes performing consistency determination processing on the time-series response difference sequence by statistically analyzing the proportion of items in the time-series response difference sequence whose differences are greater than a preset time-series difference threshold; When the ratio is not less than the preset ratio threshold, the preset spatial partitioning rule is adjusted based on the time-series response difference sequence, and a standard dynamic response feature sequence is generated based on the adjusted preset spatial partitioning rule. A time-series response difference sequence is generated, and consistency determination processing is performed. When the ratio is less than the preset ratio threshold, the standard dynamic response characteristic sequence is confirmed; The confirmed standard dynamic response feature sequence is subjected to fingerprint construction processing, which includes vectorizing the frame-level response vector according to the preset illumination state order and concatenating them according to the sub-region order to form a reference fingerprint; For the first correction sequence and the second correction sequence, frame-level response vectors corresponding to the lighting state are generated sequentially according to the preset lighting state order and spliced to form the dynamic response feature sequence to be tested. Then, difference calculation, consistency judgment processing and fingerprint construction processing are performed on the dynamic response feature sequence to be tested to generate the first fingerprint to be tested and the second fingerprint to be tested.
8. The method for quantitatively determining the batch consistency of fruit and vegetable extracts according to claim 7, characterized in that... S5 includes establishing a positional correspondence between the first fingerprint to be tested and the reference fingerprint according to a preset illumination state order and a sub-region order, performing difference calculation at the corresponding positions, and performing mean statistics on the difference results to generate a first consistency score; The second fingerprint to be tested and the reference fingerprint are established in a positional correspondence with the sub-region sequence according to the preset illumination state sequence. The difference is calculated at the corresponding position and the mean of the difference results is statistically analyzed to generate a second consistency score. The first consistency score and the second consistency score are compared with a preset consistency threshold: a consistency pass flag is generated when both the first consistency score and the second consistency score are not less than the preset consistency threshold; a consistency fail flag is generated when either the first consistency score or the second consistency score is less than the preset consistency threshold. The consistency quantification judgment result of the batch under test is output based on the consistency pass flag and the consistency fail flag. The calibration sensitivity is compared with a preset sensitivity threshold: a review trigger flag is generated when the calibration sensitivity is greater than the preset sensitivity threshold, and no review trigger flag is generated when the calibration sensitivity is not greater than the preset sensitivity threshold; and a review instruction is output based on the review trigger flag.