CN117496254A - Intelligent identification method, device and equipment for black tea fermentation state and storage medium - Google Patents

Intelligent identification method, device and equipment for black tea fermentation state and storage medium Download PDF

Info

Publication number
CN117496254A
CN117496254A CN202311515581.8A CN202311515581A CN117496254A CN 117496254 A CN117496254 A CN 117496254A CN 202311515581 A CN202311515581 A CN 202311515581A CN 117496254 A CN117496254 A CN 117496254A
Authority
CN
China
Prior art keywords
black tea
image
identified
color
hsv
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311515581.8A
Other languages
Chinese (zh)
Inventor
马坤
赵明明
陈志毅
张森
刘宝巨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CISDI Research and Development Co Ltd
Original Assignee
CISDI Research and Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CISDI Research and Development Co Ltd filed Critical CISDI Research and Development Co Ltd
Priority to CN202311515581.8A priority Critical patent/CN117496254A/en
Publication of CN117496254A publication Critical patent/CN117496254A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides an intelligent black tea fermentation state identification method, device, equipment and storage medium, wherein the method comprises the following steps: acquiring an initial black tea image to be processed, acquiring a mask matrix of a plurality of different colors based on an HSV image format to be processed of the initial black tea image, dividing the initial black tea image into a plurality of areas to be identified of different colors based on a preset HSV color dictionary and the to-be-processed black tea image, calculating RGB values of the areas to be identified, calculating chromaticity difference values of the obtained RGB values and a preset RGB threshold value, determining a color change state of the area to be identified based on the chromaticity difference values, and determining the color change state as a black tea fermentation state of the initial black tea image area corresponding to the area to be identified; through obtaining the color value of the image, the image recognition technology replaces the biochemical experiment to recognize the fermentation state and retrograde of the black tea, so that the complicated process of the biochemical experiment is avoided, the cost investment is reduced, and the judging efficiency is effectively improved.

Description

Intelligent identification method, device and equipment for black tea fermentation state and storage medium
Technical Field
The application relates to the technical field of image processing, in particular to an intelligent black tea fermentation state identification method, device and equipment and a storage medium.
Background
Black tea is a fermented (oxidized) tea leaf, one of the most widely consumed teas in the world. Black tea is favored because of its dark reddish brown soup color, intense aroma and mellow mouthfeel. The manufacturing process is roughly divided into: picking, withering, rolling, fermenting (oxidizing), deactivating enzymes and drying, wherein the fermentation is one of the very important links, and is also a key step in the formation of the unique flavor of black tea, and the method changes the chemical components in the tea to generate the unique color, aroma and taste of black tea.
The existing technology for judging whether the black tea is fermented well is mainly a biochemical experiment, and although the method is very accurate, the processing is too complicated, so that the relevant work efficiency of the black tea fermentation state identification is low, a large amount of manpower and material resource cost is required, and the method is not beneficial to industrial continuous production.
Disclosure of Invention
In view of the shortcomings of the prior art, the invention provides an intelligent black tea fermentation state identification method, device, equipment and storage medium, so as to solve the technical problem of low working efficiency caused by complicated biochemical experiment process.
The invention provides an intelligent identification method for black tea fermentation state, which comprises the following steps: acquiring an initial black tea image to be processed, and acquiring the black tea image to be processed in an HSV image format based on the initial black tea image; obtaining a plurality of mask matrixes with different colors based on a preset HSV color dictionary and the black tea image to be processed, and dividing the initial black tea image into a plurality of areas with different colors to be identified based on the mask matrixes; calculating RGB values of the areas to be identified, and calculating chromaticity difference values of the obtained RGB values and a preset RGB threshold value; and determining the color change state of the region to be identified based on the chromaticity difference value, and determining the color change state as the black tea fermentation state of the initial black tea image region corresponding to the region to be identified.
In an embodiment of the present invention, before obtaining the HSV image format to-be-processed black tea image based on the initial black tea image, the method further includes: acquiring standard color description and HSV value intervals corresponding to all initial color words; and generating an HSV color dictionary based on each standard color description and the corresponding HSV value interval.
In an embodiment of the present invention, the obtaining an HSV image format of a black tea image to be processed based on the initial black tea image includes: acquiring an initial RGB value of the initial black tea image and an image conversion rule between the RGB image and the HSV image; calculating HSV values corresponding to the initial black tea image based on the image conversion rules and the initial RGB values; and generating a black tea image to be processed in an HSV image format based on the HSV value.
In an embodiment of the present invention, obtaining a plurality of mask matrices of different colors based on a preset HSV color dictionary and the black tea image to be processed includes: acquiring the pixel size, and creating a first matrix which is the same as each color in the preset HSV color dictionary, wherein the size of the first matrix is equal to the pixel size; traversing all pixel points in the black tea image to be processed, and setting the value of a corresponding first matrix of the pixel points meeting any color range in the preset HSV color dictionary in the black tea image to be processed to be 1.
In an embodiment of the present invention, dividing the initial black tea image into a plurality of areas to be identified with different colors based on the mask matrix includes: creating a second matrix which is the same as each color in the preset HSV color dictionary, wherein the size of the second matrix is equal to the size of the pixel; traversing all pixel points in the black tea image to be processed, and setting the value of a corresponding second matrix of the pixel points meeting any color range in the preset HSV color dictionary in the black tea image to be processed as the product of the first matrix and the second matrix.
In an embodiment of the present invention, calculating RGB values of each region to be identified, and calculating a chromaticity difference between the calculated RGB values and a preset RGB threshold value includes: determining any area to be identified as a target area to be identified, and acquiring RGB values of each pixel point in the target area to be identified; calculating the average value of RGB values of all pixel points in the target area to be identified, and determining the average value as the RGB value of the area to be identified; and calculating RGB difference values of the RGB values of the region to be identified and preset standard RGB values, and determining the RGB difference values as the chromaticity difference values.
In an embodiment of the present invention, determining a color change state of the to-be-identified area based on the chromaticity difference value, and determining the color change state as a black tea fermentation state of an initial black tea image area corresponding to the to-be-identified area includes: comparing color differences of all areas to be identified in the initial image to be identified, if the color differences are smaller than a preset difference threshold, judging the color change state of the areas to be identified as qualified, and determining the areas to be identified as qualified areas; traversing all the areas to be identified, and counting the number of qualified areas; and calculating the qualified duty ratio of all the qualified areas in the initial image to be identified based on the number of the qualified areas, and judging that the fermentation state of the black tea represented by the initial image to be identified corresponding to all the areas to be identified is qualified if the qualified duty ratio is greater than or equal to a preset qualified duty ratio threshold value.
The invention provides an intelligent black tea fermentation state identification device, which comprises: the information acquisition module is used for acquiring an initial black tea image to be processed and acquiring the HSV image format black tea image to be processed based on the initial black tea image; the region dividing module is used for obtaining a plurality of mask matrixes with different colors based on a preset HSV color dictionary and the black tea image to be processed, and dividing the initial black tea image into a plurality of regions to be identified with different colors based on the mask matrixes; the color difference calculation module is used for calculating RGB values of the areas to be identified and calculating a chromaticity difference value between the obtained RGB values and a preset RGB threshold value; the state identification module is used for determining the color change state of the region to be identified based on the chromaticity difference value, and determining the color change state as the black tea fermentation state of the initial black tea image region corresponding to the region to be identified.
The present invention provides an electronic device including: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic equipment realizes the intelligent identification method of the black tea fermentation state.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the intelligent identification method of black tea fermentation status as described above
The invention has the beneficial effects that: the invention discloses an intelligent black tea fermentation state identification method, device, equipment and storage medium, wherein the method comprises the following steps: acquiring an initial black tea image to be processed, acquiring a mask matrix of a plurality of different colors based on an HSV image format to be processed of the initial black tea image, dividing the initial black tea image into a plurality of areas to be identified of different colors based on a preset HSV color dictionary and the to-be-processed black tea image, calculating RGB values of the areas to be identified, calculating chromaticity difference values of the obtained RGB values and a preset RGB threshold value, determining a color change state of the area to be identified based on the chromaticity difference values, and determining the color change state as a black tea fermentation state of the initial black tea image area corresponding to the area to be identified; through obtaining the color value of the image, the image recognition technology replaces the biochemical experiment to recognize the fermentation state and retrograde of the black tea, so that the complicated process of the biochemical experiment is avoided, the cost investment is reduced, and the judging efficiency is effectively improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application, from which other drawings can be obtained for a person of ordinary skill in the art without inventive effort. In the drawings:
fig. 1 is a schematic diagram of an implementation environment of a black tea fermentation state intelligent identification method according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a black tea fermentation status intelligent identification method according to an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating steps of a black tea fermentation status intelligent identification method according to an exemplary embodiment of the present application;
FIG. 4 is a schematic illustration of a specific variation of average RGB for a green region as shown in an exemplary embodiment of the present application;
FIG. 5 (a) is a schematic diagram of color segmentation of experimental photographs, as shown in an exemplary embodiment of the present application;
FIG. 5 (b) is a schematic diagram of color segmentation of experimental photographs, as shown in another exemplary embodiment of the present application;
FIG. 5 (c) is a schematic diagram of color segmentation of experimental photographs, as shown in another exemplary embodiment of the present application;
FIG. 5 (d) is a schematic diagram of color segmentation of experimental photographs, as shown in another exemplary embodiment of the present application;
FIG. 6 is a block diagram of a black tea fermentation status intelligent identification device, as shown in an exemplary embodiment of the present application;
fig. 7 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application.
Detailed Description
Further advantages and effects of the present invention will become readily apparent to those skilled in the art from the disclosure herein, by referring to the accompanying drawings and the preferred embodiments. The invention may be practiced or carried out in other embodiments that depart from the specific details, and the details of the present description may be modified or varied from the spirit and scope of the present invention. It should be understood that the preferred embodiments are presented by way of illustration only and not by way of limitation.
It should be noted that the illustrations provided in the following embodiments merely illustrate the basic concept of the present invention by way of illustration, and only the components related to the present invention are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In the following description, numerous details are set forth in order to provide a more thorough explanation of embodiments of the present invention, it will be apparent, however, to one skilled in the art that embodiments of the present invention may be practiced without these specific details, in other embodiments, well-known structures and devices are shown in block diagram form, rather than in detail, in order to avoid obscuring the embodiments of the present invention.
It is first noted that both RGB and HSV are color spaces for describing and representing colors. Wherein RGB is an abbreviation for Red, green, blue, a commonly used color space that uses three components to describe color, red, green, and Blue intensities, respectively; HSV is an abbreviation for Hue, saturation and Value, and is also a commonly used color space that uses three components to describe color, hue, saturation and brightness, respectively, and is a perceived color model that more closely approximates the perception of color by the human eye.
Fig. 1 is a schematic diagram of an implementation environment of a black tea fermentation state intelligent identification method according to an exemplary embodiment of the present application. As shown in fig. 1, the implementation environment of the intelligent black tea fermentation status identifying method includes a data acquisition device 101 and a computer device 102, wherein the parameter acquisition device 101 is used for acquiring an initial image of black tea for identifying a fermentation status, and sending the acquired image to the computer device 102, and the computer device 102 is used for identifying and analyzing the acquired image, including but not limited to identifying the image, so as to obtain the fermentation status of black tea in a related picture. The computer device 102 may be at least one of a desktop graphics processor (Graphic Processing Unit, GPU) computer, a GPU computing cluster, a neural network computer, etc., or may be an intelligent processor integrated on the current vehicle, which is not limited in this application.
Fig. 2 is a flowchart illustrating a black tea fermentation status intelligent identification method according to an exemplary embodiment of the present application.
As shown in fig. 2, in an exemplary embodiment, the intelligent black tea fermentation status identifying method at least includes steps S210 to S240, which are described in detail as follows:
step S210, acquiring an initial black tea image to be processed, and acquiring the HSV image format of the black tea image to be processed based on the initial black tea image.
In one embodiment of the present application, before obtaining the HSV image format of the pending black tea image based on the initial black tea image, the method further comprises: acquiring standard color description and HSV value intervals corresponding to all initial color words; and generating an HSV color dictionary based on each standard color description and the corresponding HSV value interval.
In one embodiment of the present application, an initial black tea image is first acquired, where the image may be a photograph taken by a digital camera or an image scanned by a scanner; secondly, converting the initial black tea image into an HSV image format; then, obtaining standard color descriptions, wherein the standard color descriptions can be standard color descriptions about black tea color, soup color, leaf bottom and the like obtained from professional black tea books, tea websites and tea professionals; then, determining HSV value intervals corresponding to all standard color descriptions, for example, for colors, determining HSV value intervals corresponding to color words such as black, reddish brown, yellow brown and the like; for the soup color, HSV value intervals corresponding to color words such as red brilliant, red bright, red thick and the like can be determined; for the leaf bottom, HSV value intervals corresponding to color words such as light green, turquoise, yellow green and the like can be determined; then, generating an HSV color dictionary based on each standard color description and the corresponding HSV value interval, for example, for the color, color words such as black, reddish brown, yellow brown and the like and the corresponding HSV value interval can be stored in the HSV color dictionary; for the soup color, color words such as red brilliant, red bright, red thick and the like and corresponding HSV value intervals can be stored in an HSV color dictionary; for the leaf bottom, color words such as light green, dark green, yellow green and the like and corresponding HSV value intervals can be stored in an HSV color dictionary; and finally, performing color matching on the black tea image to be processed based on the HSV color dictionary. Specifically, the closest color word can be found by comparing the HSV value of the black tea image to be processed with the HSV value interval corresponding to each color word in the HSV color dictionary, so that the color description of the black tea image to be processed is obtained; in addition, the initial black tea image can be further processed according to the acquired standard color description and the acquired color description, for example, brightness, contrast, color balance and the like of the image are adjusted, so that the image is more in line with the characteristics of the actual black tea, such as color, soup color and the like. It should be noted that, in the process of converting the initial black tea image into the HSV image format, the image format conversion may be performed by using image processing software, such as Adobe Photoshop or GIMP, or by a programming language, such as the OpenCV library of Python, and any other realizable manner.
It should be noted that the foregoing embodiments are merely exemplary, and the present application is not limited to these embodiments, and may be modified accordingly based on actual environments and situations in the specific implementation process.
In one embodiment of the present application, a pending black tea image in HSV image format based on an initial black tea image, comprises: acquiring an initial RGB value of an initial black tea image and an image conversion rule between the RGB image and the HSV image; calculating HSV values corresponding to the initial black tea images based on image conversion rules and initial RGB values; and generating a black tea image to be processed in an HSV image format based on the HSV values.
In one embodiment of the present application, first, initial RGB values of an initial black tea image are obtained, where the initial RGB values may be raw RGB values obtained from a digital camera, scanner or other device, or RGB values read from an existing image file; secondly, acquiring image conversion rules between the RGB image and the HSV image, wherein the rules can be acquired from professional documents, image processing software or a programming library; then, an HSV value corresponding to the above-described initial black tea image is calculated based on the image conversion rule and the initial RGB value. Specifically, the conversion can be performed using the following formula:
Hue=(1/3)*(R-G+R-B)
Saturation=(max(R,G,B)-min(R,G,B))/(max(R,G,B)+min(R,G,B))
Value=max(R,G,B)
wherein R, G, B represents the pixel values of the three red, green and blue channels, respectively.
And then generating the black tea image to be processed in an HSV image format based on the HSV values. Specifically, the calculated HSV values may be mapped into an HSV color space using a programming language or image processing software, such as the OpenCV library of Python or Adobe Photoshop, to generate a corresponding HSV image format black tea image to be processed; finally, according to actual needs, other processing can be further carried out on the black tea image to be processed in the generated HSV image format, such as adjusting parameters of hue, saturation, brightness and the like, or carrying out image enhancement or analysis in other forms.
Step S220, a plurality of mask matrixes with different colors are obtained based on a preset HSV color dictionary and the black tea image to be processed, and the initial black tea image is divided into a plurality of areas with different colors to be identified based on the mask matrixes.
In one embodiment of the present application, obtaining a plurality of mask matrices of different colors based on a preset HSV color dictionary and a black tea image to be processed includes: acquiring the pixel size, and creating a first matrix which is the same as each color in a preset HSV color dictionary, wherein the size of the first matrix is equal to the pixel size; traversing all pixel points in the black tea image to be processed, and setting the value of a first matrix corresponding to the pixel points meeting any color range in a preset HSV color dictionary in the black tea image to be processed to be 1.
In a specific embodiment of the present application, first, a preset HSV color dictionary and a black tea image to be processed are obtained; secondly, acquiring the pixel size of a black tea image to be processed, and creating a first matrix which is the same as each color in a preset HSV color dictionary, wherein the size of the first matrix is equal to the pixel size; then traversing all pixel points in the black tea image to be processed, and obtaining a corresponding HSV value for each pixel point; then judging whether the HSV value of the pixel point meets any color range in a preset HSV color dictionary, and if so, setting the value of the corresponding position in the first matrix to be 1; and finally repeating the process until all pixel points in the black tea image to be processed are traversed.
In one embodiment of the present application, dividing an initial black tea image into a plurality of differently colored areas to be identified based on a mask matrix includes: creating a second matrix which is the same as each color in a preset HSV color dictionary, wherein the size of the second matrix is equal to the size of the pixel; traversing all pixel points in the black tea image to be processed, and setting the value of a second matrix corresponding to the pixel points meeting any color range in a preset HSV color dictionary in the black tea image to be processed as the product of the first matrix and the second matrix.
Step S230, calculating RGB values of each region to be identified, and calculating chromaticity difference values between the obtained RGB values and a preset RGB threshold.
In one embodiment of the present application, calculating RGB values of each region to be identified, and calculating a chromaticity difference between the calculated RGB values and a preset RGB threshold value includes: determining any area to be identified as a target area to be identified, and acquiring RGB values of each pixel point in the target area to be identified; calculating the average value of RGB values of all pixel points in the target area to be identified, and determining the average value as the RGB value of the area to be identified; and calculating RGB difference values of the region to be identified and a preset standard RGB value, and determining the RGB difference values as chromaticity difference values.
In a specific embodiment of the present application, first, each area to be identified is obtained, where the areas to be identified may be a plurality of areas to be identified with different colors obtained by dividing a color block, or may be areas to be identified determined in other manners; and secondly, determining any area to be identified as a target area to be identified. This may be a random selection of the region to be identified, or may be selected according to other factors (such as the area, shape, etc. of the region to be identified); then, the RGB values of each pixel point in the target to-be-identified area are obtained, and the average value of the RGB values of each pixel point in the target to-be-identified area is calculated, wherein the calculation process can calculate the average value by using the following formula:
R_mean=(R1+R2+...+Rn)/n
G_mean=(G1+G2+...+Gn)/n
B_mean=(B1+B2+...+Bn)/n
wherein R1, G1, B1, R2, G2, B2, & gt, rn, gn, bn represent RGB values of each pixel point in the target area to be identified, respectively, and n is the number of pixel points in the target area to be identified.
Then, the average value is determined as the RGB value of the area to be identified, which may be the calculated r_mean, g_mean, b_mean as the RGB value of the area to be identified, or the average value is further processed (e.g. rounded, adjusted, etc.) and then determined as the RGB value of the area to be identified, and the RGB difference between the RGB value of the area to be identified and the RGB value of the preset standard RGB value is calculated, where the calculating process may calculate the difference using the following formula:
R_diff=|R_mean-R_standard|
G_diff=|G_mean-G_standard|
B_diff=|B_mean-B_standard|
wherein R_Standard, G_Standard, B_Standard are preset standard RGB values.
Finally, the RGB difference value is determined as a chroma difference value, which may be directly r_diff, g_diff, b_diff as the chroma difference value, or may be obtained by further processing (such as taking absolute value, weighting average, etc.) the difference values.
And step S240, determining the color change state of the region to be identified based on the chromaticity difference value, and determining the color change state as the black tea fermentation state of the initial black tea image region corresponding to the region to be identified.
In one embodiment of the present application, determining a color change state of an area to be identified based on a chromaticity difference value, and determining the color change state as a black tea fermentation state of an initial black tea image area corresponding to the area to be identified includes: comparing color difference values of all areas to be identified in the initial image to be identified, if the color difference values are smaller than a preset difference value threshold, judging the color change state of the areas to be identified as qualified, and determining the areas to be identified as qualified areas; traversing all the areas to be identified, and counting the number of qualified areas; and calculating the qualified duty ratio of all the qualified areas in the initial image to be identified based on the number of the qualified areas, and if the qualified duty ratio is greater than or equal to a preset qualified duty ratio threshold value, judging that the fermentation state of the black tea represented by the initial image to be identified corresponding to all the areas to be identified is qualified.
In a specific embodiment of the application, firstly, determining a color change state of a region to be identified based on a chromaticity difference value, specifically, comparing the chromaticity difference value of the region to be identified with a preset difference value threshold, and if the chromaticity difference value is smaller than the preset difference value threshold, determining that the color change state of the region to be identified is qualified; secondly, determining the color change state as a black tea fermentation state of an initial black tea image area corresponding to the area to be identified, and determining the area to be identified as a qualified area if the color change state of the area to be identified is qualified; then, traversing all the areas to be identified, and counting the number of qualified areas, which can be realized by traversing all the areas to be identified in the black tea image to be processed and counting; then, calculating the qualified ratio of all the qualified areas in the initial image to be identified based on the number of the qualified areas, specifically, calculating the proportion of the number of the qualified areas to the number of the all the areas to be identified, and obtaining the qualified ratio; and finally, judging whether the qualified duty ratio is larger than or equal to a preset qualified duty ratio threshold value, and if so, judging that the fermentation state of the black tea represented by the initial image to be identified corresponding to all the areas to be identified is qualified.
Fig. 3 is a schematic diagram illustrating steps of intelligent identification of black tea fermentation status according to an exemplary embodiment of the present application. As shown in fig. 3, the intelligent identification of the fermentation state of black tea comprises the following steps:
first, define different colors: black, white, red 2, orange, yellow, green, cyan, blue, violet, a color dictionary under HSV color space;
secondly, converting the tea picture to be calculated from an RGB color space to an HSV color space by utilizing the conversion relation of the color space;
thirdly, using an HSV color dictionary and an HSV picture to obtain mask matrixes with different colors;
fourth, multiplying the mask matrixes with different colors with the original image according to elements to obtain areas with different colors of the original image;
fifthly, calculating average RGB of areas with different colors of the original image;
and sixthly, respectively calculating average RGB of red 2, green, yellow and orange areas of the well-fermented tea picture and the tea picture to be identified. And finally obtaining a judging result through comparing the differences.
In one embodiment of the present application, the following is specific:
s1, defining different colors: black, white, red 2, orange, yellow, green, cyan, blue, violet, a color dictionary under HSV color space; the specific information of the color dictionary is shown in the following table one:
list one
S2, converting the tea picture to be calculated from an RGB color space to an HSV color space by utilizing the conversion relation of the color space; the method specifically comprises the following steps:
each pixel in the RGB picture to be detected is traversed, and for each RGB pixel, the maximum value MAX and the minimum value MIN in the R, G, B values are calculated. The value of V is equal to MAX and the value of S is equal to (MAX-MIN)/MAX. If R is equal to MAX, then H is equal to (G-B)/(MAX-MIN) 60; if the G value is equal to the MAX value, then the H value is equal to 120+ (B-R)/(MAX-MIN) 60; if the B value is equal to the MAX value, then the H value is equal to 240+ (R-G)/(MAX-MIN) 60. If the calculated H value is less than 0, then 360 is added to the H value. Finally, HSV pictures corresponding to the original pictures can be obtained.
S3, obtaining mask matrixes with different colors by using the HSV color dictionary and the HSV picture; the method specifically comprises the following steps:
creating a zero matrix M of equal size to the image for each color in the color dictionary i Traversing each pixel in the HSV picture obtained in S2, and if the HSV pixel points accord with a certain color value range in the color dictionary, then corresponding to the matrix M i The value of the corresponding position is modified to 1.
S4, multiplying mask matrixes with different colors with the original image according to elements to obtain areas with different colors of the original image; the method specifically comprises the following steps:
creating a zero matrix N of equal size to the image for each color in the color dictionary i Traversing each pixel point in the original image, and adding N i The corresponding position is updated to the original image pixel point value and N i The product of the corresponding position values.
S5, calculating the average RGB of the areas with different colors of the original image, namely, for each N i The matrix averages all of its RGB pixel values.
S6, respectively calculating average RGB of red 2, green, yellow and orange areas of the well-fermented tea picture and the tea picture to be identified. And finally obtaining a judging result through comparing the differences. The method specifically comprises the following steps:
comparing the difference between the fermented tea picture and the red 2, green, yellow and orange of the tea picture to be identified
If the difference is less than 1%, the tea leaves to be identified are considered to be fermented well.
Fig. 4 is a specific variation diagram of the average RGB of the green area shown in an exemplary embodiment of the present application.
As shown in fig. 4, RGB corresponding to the image becomes smaller gradually during the black tea fermentation process, and the average RGB in the green area does not change significantly until the black tea fermentation end.
In addition, the experimental result shows that the current black tea fermentation condition and degree can be judged by using a color segmentation method. At the end of fermentation, the average RGB value of the green region of the black tea photograph was [68.25250667,85.1158151,80.66577995], the average RGB value of the yellow region of the black tea photograph was [78.2381548506716,98.1710506229241,99.7248475812819], the average RGB value of the orange region of the black tea photograph was [93.6678797571602,113.34086781543,129.845470742695], and the average RGB value of the red 2 region of the black tea photograph was [101.336016107901,110.555574770556,135.061743223514].
FIG. 5 (a) is a schematic diagram of color segmentation of experimental photographs, as shown in an exemplary embodiment of the present application; FIG. 5 (b) is a schematic diagram of color segmentation of experimental photographs, as shown in another exemplary embodiment of the present application; FIG. 5 (c) is a schematic diagram of color segmentation of experimental photographs, as shown in another exemplary embodiment of the present application; fig. 5 (d) is a schematic diagram showing color segmentation of experimental photographs according to another exemplary embodiment of the present application.
In one embodiment of the present application, the black tea fermentation process is divided into different image areas for comparison observation, and images with different colors of RGB values as shown in fig. 5 (a), 5 (b), 5 (c) and 5 (d) can be obtained at different stages of black tea fermentation degrees.
Fig. 6 is a block diagram of an intelligent recognition device for black tea fermentation status according to an exemplary embodiment of the present application. The device may be applied to the implementation environment shown in fig. 1. The apparatus may also be adapted to other exemplary implementation environments and may be specifically configured in other devices, and the present embodiment is not limited to the implementation environments to which the apparatus is adapted.
As shown in fig. 6, the exemplary black tea fermentation state intelligent recognition apparatus includes: an information acquisition module 610, a region division module 620, a color difference calculation module 630, and a state identification module 640.
The information obtaining module 610 is configured to obtain an initial black tea image to be processed, and obtain an HSV image format black tea image to be processed based on the initial black tea image; the region dividing module 620 is configured to obtain a plurality of mask matrices with different colors based on a preset HSV color dictionary and a black tea image to be processed, and divide the initial black tea image into a plurality of regions to be identified with different colors based on the mask matrices; the color difference calculating module 630 is configured to calculate RGB values of each region to be identified, and calculate a chromaticity difference between the obtained RGB values and a preset RGB threshold; the state recognition module 640 is configured to determine a color change state of the area to be recognized based on the chromaticity difference value, and determine the color change state as a black tea fermentation state of an initial black tea image area corresponding to the area to be recognized.
It should be noted that, the intelligent identification device for the fermentation status of black tea provided in the above embodiment and the intelligent identification method for the fermentation status of black tea provided in the above embodiment belong to the same concept, and the specific manner in which each module and unit perform the operation has been described in detail in the method embodiment, which is not described herein again. In practical application, the intelligent black tea fermentation state identification device provided in the above embodiment can distribute the functions to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above, which is not limited herein.
The embodiment of the application also provides electronic equipment, which comprises: one or more processors; and the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic equipment realizes the intelligent identification method for the black tea fermentation state provided in each embodiment.
Fig. 7 shows a schematic diagram of a computer system suitable for use in implementing the electronic device of the embodiments of the present application. It should be noted that, the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a central processing unit (Central Processing Unit, CPU) 701 that can perform various appropriate actions and processes, such as performing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 702 or a program loaded from a storage section 708 into a random access Memory (Random Access Memory, RAM) 703. In the RAM 703, various programs and data required for the system operation are also stored. The CPU 701, ROM 702, and RAM 703 are connected to each other through a bus 704. An Input/Output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed on the drive 710 as needed, so that a computer program read out therefrom is installed into the storage section 708 as needed.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. When executed by a Central Processing Unit (CPU) 701, performs the various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium may be, for example, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with a computer-readable computer program embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
Another aspect of the present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform the intelligent identification method of black tea fermentation status as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment or may exist alone without being incorporated in the electronic device.
Another aspect of the present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the intelligent identification method of black tea fermentation status provided in the above embodiments.
The above embodiments are merely illustrative of the principles of the present invention and its effectiveness, and are not intended to limit the invention. Modifications and variations may be made to the above-described embodiments by those skilled in the art without departing from the spirit and scope of the invention. It is therefore intended that all equivalent modifications and changes made by those skilled in the art without departing from the spirit and technical spirit of the present invention shall be covered by the appended claims.

Claims (10)

1. An intelligent identification method for black tea fermentation state is characterized by comprising the following steps:
acquiring an initial black tea image to be processed, and acquiring the black tea image to be processed in an HSV image format based on the initial black tea image;
obtaining a plurality of mask matrixes with different colors based on a preset HSV color dictionary and the black tea image to be processed, and dividing the initial black tea image into a plurality of areas with different colors to be identified based on the mask matrixes;
calculating RGB values of the areas to be identified, and calculating chromaticity difference values of the obtained RGB values and a preset RGB threshold value;
and determining the color change state of the region to be identified based on the chromaticity difference value, and determining the color change state as the black tea fermentation state of the initial black tea image region corresponding to the region to be identified.
2. A black tea fermentation status intelligent identification method according to claim 1, further comprising, prior to obtaining the HSV image format of the to-be-processed black tea image based on the initial black tea image:
acquiring standard color description and HSV value intervals corresponding to all initial color words;
and generating an HSV color dictionary based on each standard color description and the corresponding HSV value interval.
3. A black tea fermentation status intelligent identification method according to claim 1, wherein obtaining an HSV image format of a to-be-processed black tea image based on the initial black tea image comprises:
acquiring an initial RGB value of the initial black tea image and an image conversion rule between the RGB image and the HSV image;
calculating HSV values corresponding to the initial black tea image based on the image conversion rules and the initial RGB values;
and generating a black tea image to be processed in an HSV image format based on the HSV value.
4. A black tea fermentation state intelligent recognition method according to claim 3, wherein obtaining a plurality of mask matrices of different colors based on a preset HSV color dictionary and the black tea image to be processed comprises:
acquiring the pixel size, and creating a first matrix which is the same as each color in the preset HSV color dictionary, wherein the size of the first matrix is equal to the pixel size;
traversing all pixel points in the black tea image to be processed, and setting the value of a corresponding first matrix of the pixel points meeting any color range in the preset HSV color dictionary in the black tea image to be processed to be 1.
5. A black tea fermentation state intelligent identification method according to claim 4, wherein dividing the initial black tea image into a plurality of different color areas to be identified based on the mask matrix comprises:
creating a second matrix which is the same as each color in the preset HSV color dictionary, wherein the size of the second matrix is equal to the size of the pixel;
traversing all pixel points in the black tea image to be processed, and setting the value of a corresponding second matrix of the pixel points meeting any color range in the preset HSV color dictionary in the black tea image to be processed as the product of the first matrix and the second matrix.
6. An intelligent black tea fermentation state identification method according to claim 1, wherein calculating RGB values of each region to be identified and calculating a chromaticity difference between the calculated RGB values and a preset RGB threshold value comprises:
determining any area to be identified as a target area to be identified, and acquiring RGB values of each pixel point in the target area to be identified;
calculating the average value of RGB values of all pixel points in the target area to be identified, and determining the average value as the RGB value of the area to be identified;
and calculating RGB difference values of the RGB values of the region to be identified and preset standard RGB values, and determining the RGB difference values as the chromaticity difference values.
7. An intelligent black tea fermentation state identification method according to any one of claims 1 to 6, wherein determining the color change state of the region to be identified based on the chromaticity difference value, and determining the color change state as the black tea fermentation state of the initial black tea image region corresponding to the region to be identified, comprises:
comparing color differences of all areas to be identified in the initial image to be identified, if the color differences are smaller than a preset difference threshold, judging the color change state of the areas to be identified as qualified, and determining the areas to be identified as qualified areas;
traversing all the areas to be identified, and counting the number of qualified areas;
and calculating the qualified duty ratio of all the qualified areas in the initial image to be identified based on the number of the qualified areas, and judging that the fermentation state of the black tea represented by the initial image to be identified corresponding to all the areas to be identified is qualified if the qualified duty ratio is greater than or equal to a preset qualified duty ratio threshold value.
8. An intelligent identification device for black tea fermentation state, which is characterized by comprising:
the information acquisition module is used for acquiring an initial black tea image to be processed and acquiring the HSV image format black tea image to be processed based on the initial black tea image;
the region dividing module is used for obtaining a plurality of mask matrixes with different colors based on a preset HSV color dictionary and the black tea image to be processed, and dividing the initial black tea image into a plurality of regions to be identified with different colors based on the mask matrixes;
the color difference calculation module is used for calculating RGB values of the areas to be identified and calculating a chromaticity difference value between the obtained RGB values and a preset RGB threshold value;
the state identification module is used for determining the color change state of the region to be identified based on the chromaticity difference value, and determining the color change state as the black tea fermentation state of the initial black tea image region corresponding to the region to be identified.
9. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the electronic device to implement a black tea fermentation state intelligent identification method as claimed in any one of claims 1 to 7.
10. A computer readable storage medium having stored thereon a computer program which, when executed by a processor of a computer, causes the computer to perform a black tea fermentation state intelligent identification method as claimed in any one of claims 1 to 7.
CN202311515581.8A 2023-11-13 2023-11-13 Intelligent identification method, device and equipment for black tea fermentation state and storage medium Pending CN117496254A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311515581.8A CN117496254A (en) 2023-11-13 2023-11-13 Intelligent identification method, device and equipment for black tea fermentation state and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311515581.8A CN117496254A (en) 2023-11-13 2023-11-13 Intelligent identification method, device and equipment for black tea fermentation state and storage medium

Publications (1)

Publication Number Publication Date
CN117496254A true CN117496254A (en) 2024-02-02

Family

ID=89679779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311515581.8A Pending CN117496254A (en) 2023-11-13 2023-11-13 Intelligent identification method, device and equipment for black tea fermentation state and storage medium

Country Status (1)

Country Link
CN (1) CN117496254A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118037732A (en) * 2024-04-12 2024-05-14 陕西仙喜辣木茯茶有限公司 Fuzhuan tea flowering dynamic detection method based on artificial intelligence
CN118071741A (en) * 2024-04-18 2024-05-24 陕西仙喜辣木茯茶有限公司 Method for measuring fermentation degree of moringa oleifera Fu tea

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118037732A (en) * 2024-04-12 2024-05-14 陕西仙喜辣木茯茶有限公司 Fuzhuan tea flowering dynamic detection method based on artificial intelligence
CN118071741A (en) * 2024-04-18 2024-05-24 陕西仙喜辣木茯茶有限公司 Method for measuring fermentation degree of moringa oleifera Fu tea

Similar Documents

Publication Publication Date Title
KR102225266B1 (en) Image processing methods and devices, electronic devices and computer storage media
CN117496254A (en) Intelligent identification method, device and equipment for black tea fermentation state and storage medium
US8355574B2 (en) Determination of main object on image and improvement of image quality according to main object
CN109147005B (en) Self-adaptive dyeing method and system for infrared image, storage medium and terminal
CN108230407B (en) Image processing method and device
CN108337496A (en) White balancing treatment method, processing unit, processing equipment and storage medium
CN108230256A (en) Image processing method, device, computer installation and computer readable storage medium
EP3624432B1 (en) Color processing program, color processing method, chromatic sensation examination system, output system, color vision correction image processing system, and color vision simulation image processing system
WO2022120799A9 (en) Image processing method and apparatus, electronic device, and storage medium
CN112200747B (en) Image processing method and device and computer readable storage medium
CN112016621B (en) Training method of classification model, color classification method and electronic equipment
US20130195353A1 (en) Digital Image Color Correction
CN110298812B (en) Image fusion processing method and device
JP2019046225A (en) Recognition device, recognition program, and recognition method
CN107622098A (en) Method to set up and device, the storage medium and electronic installation of web site contents color
CN112381073A (en) IQ (in-phase/quadrature) adjustment method and adjustment module based on AI (Artificial Intelligence) face detection
WO2010128683A1 (en) Blue sky color detection technique
CN109102473B (en) Method for improving color digital image quality
CN112614471B (en) Tone mapping method and system
JP3482106B2 (en) Luminance image generation method and apparatus, and recording medium recording this method
CN113658157A (en) Color segmentation method and device based on HSV space
US7437016B2 (en) Image enhancement
Kumar et al. Grey level to RGB using YCbCr color space Technique
CN105184746A (en) Histogram equalization-based color image enhanced treatment method
CN118301305A (en) Method and device for calibrating and mixing colors of image, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination