CN114882499B - Fruit acid-sweetness classification method and system based on artificial intelligence - Google Patents

Fruit acid-sweetness classification method and system based on artificial intelligence Download PDF

Info

Publication number
CN114882499B
CN114882499B CN202210797557.7A CN202210797557A CN114882499B CN 114882499 B CN114882499 B CN 114882499B CN 202210797557 A CN202210797557 A CN 202210797557A CN 114882499 B CN114882499 B CN 114882499B
Authority
CN
China
Prior art keywords
fruit
classification
obtaining
sweetness
connected domain
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.)
Active
Application number
CN202210797557.7A
Other languages
Chinese (zh)
Other versions
CN114882499A (en
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.)
Nantong Haiyang Food Co ltd
Original Assignee
Nantong Haiyang Food 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 Nantong Haiyang Food Co ltd filed Critical Nantong Haiyang Food Co ltd
Priority to CN202210797557.7A priority Critical patent/CN114882499B/en
Publication of CN114882499A publication Critical patent/CN114882499A/en
Application granted granted Critical
Publication of CN114882499B publication Critical patent/CN114882499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/68Food, e.g. fruit or vegetables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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

Abstract

The invention discloses a fruit acid and sweetness classification method and system based on artificial intelligence, relates to the field of artificial intelligence, obtains appearance characteristics of fruits through image processing and classifies the fruit acid and sweetness, effectively improves classification efficiency and can avoid errors of manual operation. The method mainly comprises the following steps: acquiring a preset visual angle image of a fruit to be classified; carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image; obtaining a connected domain of the fruit by using a fruit segmentation graph, and establishing a plane rectangular coordinate system for the connected domain of the fruit; obtaining a distance curve according to the distance from the pixels at the edge in the connected domain to the origin of the plane rectangular coordinate system; obtaining the steepness of a distance curve; obtaining classification indexes of the fruits according to the steepness; and the classification of the acid sweetness of the fruits is realized by utilizing the classification indexes of the fruits. The specific application scenarios of the invention are as follows: in the fruit processing process, different varieties of the same fruit are classified through the appearance, and then the different types of acid-sweetness are utilized to realize the classification of the acid-sweetness.

Description

Fruit acid-sweetness classification method and system based on artificial intelligence
Technical Field
The application relates to the field of artificial intelligence, in particular to a fruit acid-sweetness classification method and system based on artificial intelligence.
Background
For the same fruit, different varieties often exist, the sour and sweet degrees of the different varieties are different, and the appearances of the different varieties are different; therefore, different varieties of the same fruit need to be separated, and the processing such as classified packaging, sale and the like is further facilitated.
At present, aiming at collected fruits, varieties of the same fruits are judged through the appearance of the fruits by utilizing naked eyes manually, and the sour-sweet degree classification is realized by utilizing the difference of the sour-sweet degree among different varieties.
Disclosure of Invention
The invention provides a fruit acid-sweetness classification method and system based on artificial intelligence, which comprises the following steps: acquiring a preset visual angle image of a fruit to be classified; carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image; obtaining a connected domain of the fruit by using a fruit segmentation graph, and establishing a plane rectangular coordinate system in the connected domain of the fruit; obtaining a distance curve according to the distance from the pixels at the edge in the connected domain to the origin of the plane rectangular coordinate system; obtaining the steepness of a distance curve; obtaining classification indexes of the fruits according to the steepness; the fruit sorting method has the advantages that fruit sorting is achieved by using fruit sorting indexes, compared with the prior art, the fruit sorting method has the advantages that fruit varieties are sorted by using the appearance characteristics of the fruits, the sour and sweet degrees of the fruits are sorted by using the difference of the sour and sweet degrees of different varieties of the same fruit, and subsequent sorting, packaging, selling and other treatment are facilitated; the appearance characteristics of the fruits are obtained through image processing, and the fruit varieties are classified by utilizing the appearance characteristics of the fruits, so that the classification efficiency is effectively improved, and meanwhile, subjective errors caused by artificial classification can be avoided.
Aiming at the technical problems, the invention provides a fruit acid-sweetness classification method and system based on artificial intelligence.
In a first aspect, provided herein is an artificial intelligence-based method for classifying fruit acid sweetness, comprising:
and acquiring a preset visual angle image of the fruit to be classified.
And carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image.
And obtaining a connected domain of the fruit by using the fruit segmentation graph, and establishing a plane rectangular coordinate system for the connected domain of the fruit.
And obtaining a distance curve according to the distance from the pixels at the edge in the connected domain to the origin of the plane rectangular coordinate system.
The steepness of the distance curve is obtained.
And obtaining the classification index of the fruit according to the steepness.
And classifying the acid sweetness of the fruit by using the classification index of the fruit.
Further, the artificial intelligence-based fruit sour-sweetness classification method for obtaining connected components of fruit by using the fruit segmentation map comprises the following steps:
and separating the first fruit part and the second fruit part from each other in the fruit segmentation image to obtain a connected domain of the fruit.
Further, the method for classifying fruit sour and sweet based on artificial intelligence, which uses the fruit segmentation map to obtain a connected domain of the fruit and establishes a rectangular plane coordinate system for the connected domain of the fruit, includes:
and carrying out open operation on the fruit segmentation graph to obtain a connected domain of a single fruit.
Obtaining a center of gravity of the connected domains of the individual fruit.
And taking the shortest connecting line of the two pixels on the edge of the connected domain of the single fruit passing through the central point as a horizontal axis.
And establishing a plane rectangular coordinate system by using the central point and the transverse axis.
Further, the artificial intelligence-based fruit sour sweetness classification method for obtaining the steepness of the distance curve comprises:
and dividing the distance curve into different distance curves according to the connected domain of the fruit in the quadrant of the plane rectangular coordinate system.
And acquiring the steepness of the different distance curves.
And obtaining the steepness of the distance curve according to the steepness of the distance curves of different sections.
Further, the fruit sour sweetness classification method based on artificial intelligence, which obtains the steepness of the distance curve, includes:
Figure 257229DEST_PATH_IMAGE001
wherein
Figure 846473DEST_PATH_IMAGE002
In order to be the steepness of the distance curve,
Figure 563894DEST_PATH_IMAGE003
is as follows
Figure 568890DEST_PATH_IMAGE004
The vertical coordinate of the maximum point of the segment distance curve;
Figure 320945DEST_PATH_IMAGE005
is as follows
Figure 812582DEST_PATH_IMAGE004
The abscissa of the maximum point of the segment distance curve;
Figure 17298DEST_PATH_IMAGE006
is as follows
Figure 153882DEST_PATH_IMAGE004
The vertical coordinate of the minimum value point of the segment distance curve;
Figure 760443DEST_PATH_IMAGE007
is as follows
Figure 488228DEST_PATH_IMAGE008
The maximum value of the abscissa of the segment distance curve;
Figure 914661DEST_PATH_IMAGE009
is as follows
Figure 995881DEST_PATH_IMAGE010
The maximum value of the abscissa of the distance curve,
Figure 268335DEST_PATH_IMAGE011
further, the fruit acid-sweetness classification method based on artificial intelligence obtains a classification index of the fruit according to the steepness, and comprises the following steps:
the fruit is classified into
Figure 635863DEST_PATH_IMAGE012
Wherein
Figure 549592DEST_PATH_IMAGE002
The steepness of the distance curve of the fruit,
Figure 762399DEST_PATH_IMAGE013
is the aspect ratio of the fruit
Figure 15657DEST_PATH_IMAGE014
Wherein
Figure 288506DEST_PATH_IMAGE015
The distance between two pixels intersected by the longitudinal axis of the rectangular plane coordinate system and the edge of the connected domain of the fruit is
Figure 689532DEST_PATH_IMAGE016
The distance between two pixels of which the horizontal axis of the rectangular plane coordinate system is intersected with the edge of the connected domain of the fruit is obtained.
In a second aspect, the present invention provides an artificial intelligence-based fruit acid-sweetness classification system, including:
and the image acquisition module is used for acquiring the preset visual angle image of the fruit to be classified.
And the image segmentation module is used for carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image.
And the connected domain obtaining module is used for obtaining the connected domain of the fruit by using the fruit segmentation graph and establishing a plane rectangular coordinate system for the connected domain of the fruit.
And the distance curve acquisition module is used for acquiring a distance curve according to the distance from the pixels at the edge in the connected domain to the origin of the plane rectangular coordinate system.
And the abruptness calculation module is used for obtaining the abruptness of the distance curve.
And the classification index calculation module is used for obtaining the classification index of the fruit according to the steepness.
And the acid sweetness classification module is used for classifying the acid sweetness of the fruit by utilizing the classification index of the fruit.
The invention provides a fruit acid-sweetness classification method and system based on artificial intelligence, which comprises the following steps: acquiring a preset visual angle image of a fruit to be classified; carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image; obtaining a connected domain of the fruit by using a fruit segmentation graph, and establishing a plane rectangular coordinate system in the connected domain of the fruit; obtaining a distance curve according to the distance from the pixels at the edge in the connected domain to the origin of the plane rectangular coordinate system; obtaining the steepness of a distance curve; obtaining a classification index of the fruits according to the steepness; the fruit classification is realized by using the fruit classification indexes, compared with the prior art, the fruit classification method has the advantages that the fruit varieties are classified by using the appearance characteristics of the fruits, and the sour-sweet degree of the fruits is classified by using the difference of the sour-sweet degree between different varieties of the same fruit, so that the subsequent classification, packaging, sale and other treatment are facilitated; the appearance characteristics of the fruits are obtained through image processing, the fruit varieties are classified by utilizing the appearance characteristics of the fruits, the classification efficiency is effectively improved, and meanwhile subjective errors caused by artificial classification can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of an artificial intelligence-based fruit acid-sweetness classification method according to an embodiment of the present invention.
Fig. 2 is a schematic flow chart of another artificial intelligence-based fruit acid sweetness classification method provided by the embodiment of the invention.
Fig. 3 is a schematic diagram of a rectangular plane coordinate system of a connected component provided in an embodiment of the present invention.
Fig. 4 is a schematic diagram of a distance curve provided by an embodiment of the present invention.
Fig. 5 is a schematic flow chart of an artificial intelligence-based system for classifying the sweetness and acidity of a fruit according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature; in the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
Example 1
The embodiment of the invention provides an artificial intelligence-based fruit acid-sweetness classification method, which comprises the following steps of:
s101, acquiring a preset visual angle image of the fruit to be classified.
Wherein, the preset visual angle in this embodiment can be adjusted correspondingly according to the concrete type of current fruit, for example: if the current fruit is a fruit with a general fruit shape (apple, peach, persimmon, kiwi fruit and the like), selecting overlook as a preset visual angle; if the current fruit is the fruit with special fruit shape (carambola, banana and the like), the preset visual angle can be adjusted according to actual needs.
Since fruits are often transported on a conveyor belt in the production process, in the embodiment, a camera is used for shooting a preset visual angle image of the fruits to be classified, the image obtained in the embodiment is an RGB image, RGB is a color standard, and various colors are obtained by changing three color channels of red (R), green (G) and blue (B) and superposing the three color channels of red (R), green (G) and blue (B), wherein RGB is the color representing the three channels of red, green and blue.
And S102, carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image.
Image segmentation is a technique and process that divides an image into several specific regions with unique properties and proposes an object of interest. It is a key step from image processing to image analysis. The existing image segmentation methods mainly include the following categories: a threshold-based segmentation method, a region-based segmentation method, an edge-based segmentation method, a particular theory-based segmentation method, and the like. From a mathematical point of view, image segmentation is the process of dividing a digital image into mutually disjoint regions. The process of image segmentation is also a labeling process, i.e. pixels belonging to the same region are assigned the same number.
In this embodiment, a fruit part in an image is distinguished from a background part by image segmentation to obtain a fruit segmentation image, where the fruit segmentation image is a binary image, the binary image is an image in which each pixel is black or white, and the background part and the fruit part in the fruit segmentation image obtained in this embodiment are black and white.
S103, obtaining a connected domain of the fruit by using the fruit segmentation graph, and establishing a plane rectangular coordinate system for the connected domain of the fruit.
The connected component, also called connected component, refers to a pixel set composed of adjacent pixels with the same pixel value, in this embodiment, an opening operation is performed on the connected component in the fruit segmentation image, so as to separate a first fruit part and a second fruit part in the fruit segmentation image from each other, where the first fruit part and the second fruit part are connected components of the same fruit, and there is an overlapping portion between the first fruit part and the second fruit part, so as to obtain connected components of the fruit.
The opening operation is a method in image processing, which is used to eliminate small objects, objects separated at fine points, and smooth the boundary of a larger object without significantly changing its area.
And S104, obtaining a distance curve according to the distance from the pixels at the edge of the connected domain to the origin of the plane rectangular coordinate system.
Pixels are defined by tiles of the image that have a well-defined location and assigned color values that determine how the image appears.
In this embodiment, an intersection point of an edge of a connected domain and a positive half axis of a longitudinal axis of a planar rectangular coordinate system is taken as a starting point, the edge of the connected domain is traversed clockwise, an arc length accumulated in the traversing process is taken as an abscissa, a linear distance from the point to an origin of the planar rectangular coordinate system in the traversing process is taken as an ordinate, and a distance curve is obtained according to the abscissa and the ordinate, wherein traversing refers to sequentially making one visit to points in a searched route along a certain search route.
And S105, obtaining the steepness of the distance curve.
In this embodiment, the change of the distance curve is reflected by the steepness to obtain the change of the shape of the fruit, the distance curve is first divided into different segments of distance curves in a quadrant of a planar rectangular coordinate system according to the connected domain of the fruit, then the steepness of the different segments of distance curves is obtained, and finally the steepness of the distance curve is obtained according to the steepness of the different segments of distance curves.
And S106, obtaining a classification index of the fruit according to the steepness.
The aspect ratio of the fruit is taken into consideration in the embodiment, the aspect ratio in the embodiment refers to a ratio of the length of the fruit connected domain edge in the longitudinal axis of the planar rectangular coordinate system to the length of the fruit connected domain edge in the transverse axis of the planar rectangular coordinate system, the ratio of the height to the width of the fruit can be reflected through the aspect ratio, for example, when the fruit to be classified is kiwi fruit, different kiwi fruits may have a strip shape, a uniform shape of the length and the width, and the like, and finally, the classification index of the fruit is obtained by combining the steepness and a preset threshold value.
And S107, classifying the acid sweetness of the fruit by using the classification index of the fruit.
Generally, due to the continuous development of planting technology and agriculture, a variety of fruits exist, taking apples as an example, red fuji, akxose heart, galha, yellow marshal and the like exist in the existing market, the shapes of different varieties have great difference, and the acid sweetness of the tastes of different varieties have difference.
The classification of fruit sour sweetness degree is realized to the categorised index realization that utilizes the fruit that obtains in S106 in this embodiment, uses this kind of fruit of kiwi fruit as the example in this embodiment, learns through sour sweetness and appearance analysis to the different cultivars of kiwi fruit: for different varieties of kiwi fruits, the varieties with large classification indexes have large sweetness, namely small acidity, and the varieties with small classification indexes have small sweetness, namely large acidity.
Compared with the traditional technical scheme, the beneficial effects of the embodiment are as follows:
the appearance characteristics of the fruits are utilized to classify the varieties of the same fruit, and the sour-sweet degree of the fruits is classified by utilizing the difference of the sour-sweet degree between different varieties of the same fruit, so that the subsequent classified packaging, sale and other treatment are facilitated; the appearance characteristics of the fruits are obtained through image processing, and the fruit varieties are classified by utilizing the appearance characteristics of the fruits, so that the classification efficiency is effectively improved, and meanwhile, subjective errors caused by artificial classification can be avoided.
Example 2
The embodiment of the invention provides another fruit acid-sweetness classification method based on artificial intelligence, which is shown in fig. 2 and comprises the following steps:
s201, acquiring a preset visual angle image of the fruit to be classified.
Wherein, the preset visual angle in this embodiment can be adjusted correspondingly according to the concrete type of current fruit, for example: if the current fruit is a fruit with a general fruit shape (apple, peach, persimmon, kiwi fruit and the like), selecting overlook as a preset visual angle; if the current fruit is the fruit with special fruit shape (carambola, banana and the like), the preset visual angle can be adjusted according to actual needs.
Since fruits are often transported on a conveyor in the production process, in this embodiment, a camera is used to capture a preset viewing angle image of the fruits to be sorted on the conveyor, the image obtained in this embodiment is an RGB image, RGB is a color standard, and various colors are obtained by changing three color channels of red (R), green (G), and blue (B) and superimposing the three color channels on each other, wherein RGB is a color representing the three channels of red, green, and blue.
S202, carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image.
Image segmentation is a technique and process that divides an image into several specific regions with unique properties and proposes an object of interest. It is a key step from image processing to image analysis. The existing image segmentation methods mainly include the following categories: a threshold-based segmentation method, a region-based segmentation method, an edge-based segmentation method, a particular theory-based segmentation method, and the like. From a mathematical point of view, image segmentation is the process of dividing a digital image into mutually disjoint regions. The process of image segmentation is also a labeling process, i.e. pixels belonging to the same region are assigned the same number.
In this embodiment, a fruit part in the image is distinguished from a background part by image segmentation to obtain a fruit segmentation image, where the fruit segmentation image is a binary image, the binary image is an image in which each pixel is black or white, and the background part and the fruit part in the fruit segmentation image obtained in this embodiment are black and white.
In this embodiment, image segmentation is performed by adopting a semantic segmentation method of Deep Neural Network (DNN), and the content of the DNN is as follows:
(1) the data set used is a fruit image data set on the conveyor belt acquired from above.
(2) The pixels needing to be segmented are divided into 2 types, namely the labeling process of the corresponding labels of the training set is as follows: pixels belonging to the background are labeled 0 and pixels belonging to the fruit are labeled 1.
(3) The loss function used is cross entropy.
After the network training is completed in this embodiment, the preset view angle image of the fruit to be classified may be input into the DNN to obtain a fruit segmentation image.
S203, obtaining the connected domain of the fruit by using the fruit segmentation graph, and establishing a plane rectangular coordinate system for the connected domain of the fruit.
In this embodiment, S203 specifically includes S2031, S2032, S2033, and S2034.
S2031, performing open operation on the fruit segmentation graph to obtain a connected domain of a single fruit.
Since the multiple fruits are contacted with each other and can be identified as the same connected domain, the connected domain in the fruit segmentation image is subjected to the opening operation in the embodiment, the first fruit part and the second fruit part in the fruit segmentation image are separated from each other, the first fruit part and the second fruit part have an overlapping part, the first fruit part and the second fruit part are the connected domain of the same fruit, and therefore the connected domain of the fruit is obtained, and only one fruit exists in the connected domain of each fruit in the embodiment.
The opening operation is a method in image processing, which is used to eliminate small objects, objects separated at fine points, and smooth the boundary of a larger object without significantly changing the area of the object.
The connected component is also referred to as a connected component, and refers to a set of pixels composed of adjacent pixels having the same pixel value.
S2032, obtaining the central point of the connected domain of the single fruit through the connected domain analysis
Figure 703099DEST_PATH_IMAGE017
S2033, passing two pixels on the edge of the connected domain of the single fruit through the center point
Figure 138760DEST_PATH_IMAGE017
The shortest connecting line of (2) is taken as the horizontal axis.
Specifically, the over-center point is calculated in this embodiment
Figure 848090DEST_PATH_IMAGE017
Obtaining the length set of all line segments by the line segments intersected with the edges of the connected domain
Figure 533149DEST_PATH_IMAGE018
Wherein the first
Figure 353338DEST_PATH_IMAGE019
Has a length of
Figure 643505DEST_PATH_IMAGE020
Get a set
Figure 258157DEST_PATH_IMAGE021
The shortest line segment in the set is taken as the horizontal axis of the connected domain.
S2034, a plane rectangular coordinate system is established by the central point and the transverse axis.
Taking a line segment which is perpendicular to the transverse axis and crossed with the edge point of the connected domain by the over-center point as the longitudinal axis of the connected domain, and taking the center point of the connected domain
Figure 633775DEST_PATH_IMAGE017
And establishing a plane rectangular coordinate system by taking the original point as the horizontal axis as the x axis and the vertical axis as the y axis. FIG. 3 is a schematic diagram of a rectangular coordinate system of the plane in the present embodiment, as shown in FIG. 3, the center point
Figure 667108DEST_PATH_IMAGE017
Has the coordinates of
Figure 77361DEST_PATH_IMAGE022
The coordinates of two end points of the cross axis and the edge of the connected domain are respectively
Figure 128494DEST_PATH_IMAGE023
Figure 725828DEST_PATH_IMAGE024
Wherein
Figure 887819DEST_PATH_IMAGE025
. If it is
Figure 683737DEST_PATH_IMAGE026
The connected components are then processed symmetrically about the vertical, y-axis.
The coordinates of two end points of which the longitudinal axis intersects with the edge of the connected domain are respectively
Figure 905771DEST_PATH_IMAGE027
Figure 987472DEST_PATH_IMAGE028
The distance from the intersection point of the positive half axis of the longitudinal axis and the edge of the connected domain to the center point is
Figure 953154DEST_PATH_IMAGE029
The distance between the negative half axis of the longitudinal axis and the edge of the connected domain from the center point is
Figure 72420DEST_PATH_IMAGE030
Wherein
Figure 871879DEST_PATH_IMAGE031
If, if
Figure 709385DEST_PATH_IMAGE032
The connected component is processed symmetrically about the horizontal axis, i.e., the x-axis.
And S204, obtaining a distance curve according to the distance from the pixels at the edge of the connected domain to the origin of the plane rectangular coordinate system.
In this embodiment, an intersection point of an edge of the connected domain and a positive half axis of a longitudinal axis of the planar rectangular coordinate system is taken as a starting point, the edge of the connected domain is traversed clockwise, traversal is ended when the edge returns to the starting point, an arc length accumulated in the traversal process is taken as an abscissa, and a second arc length accumulated in the traversal process is taken as an abscissa
Figure 947600DEST_PATH_IMAGE033
Dot
Figure 186951DEST_PATH_IMAGE034
Linear distance to origin in a rectangular plane coordinate system
Figure 476420DEST_PATH_IMAGE035
Is the ordinate in which
Figure 597959DEST_PATH_IMAGE036
And obtaining a distance curve according to the abscissa and the ordinate, wherein traversing means that all points in a searched route are visited once in sequence along a certain searched route.
As shown in fig. 4, of the abscissa of a point in the distance curve
Figure 905444DEST_PATH_IMAGE037
Sequentially corresponding to connected domain edge points
Figure 733723DEST_PATH_IMAGE027
The cumulative arc length of the edges is initially traversed in a clockwise direction,
Figure 202881DEST_PATH_IMAGE038
for the length of the arc over which the traversal is started, i.e.
Figure 749400DEST_PATH_IMAGE038
=0;
Figure 532680DEST_PATH_IMAGE039
Rectangular plane coordinate system of connected domain
Figure 478114DEST_PATH_IMAGE027
Clockwise along the edge of the connected domain to
Figure 118174DEST_PATH_IMAGE024
The length of the arc of (a) is,
Figure 151989DEST_PATH_IMAGE040
in a rectangular plane coordinate system of connected domains
Figure 801276DEST_PATH_IMAGE027
Clockwise along the edge of the connected domain to
Figure 604147DEST_PATH_IMAGE041
The length of the arc of (a) is,
Figure 477425DEST_PATH_IMAGE042
in a rectangular plane coordinate system of connected domains
Figure 998537DEST_PATH_IMAGE027
Clockwise along the edge of the connected domain to
Figure 185935DEST_PATH_IMAGE023
The length of the arc of (a) is,
Figure 846243DEST_PATH_IMAGE043
the length of the accumulated arc line is the perimeter of the edge of the connected domain when the edge of the whole connected domain is traversed clockwise; the ordinate of the midpoint of the distance curve represents the distance from the edge point in the connected domain to the center point of the connected domain in performing the clockwise traversal.
And S205, obtaining the steepness of the distance curve.
The change degree of the edge arc of the fruit in different quadrants is reflected by each stage of the distance curve, and the change condition of the edge arc of each quadrant of the fruit is obtained by analyzing the steepness of each stage of the distance curve, so that the change condition of the whole edge arc of the fruit is obtained.
In this embodiment, S205 specifically includes S2051, S2052, and S2053.
S2051, dividing the distance curve into different distance curves according to connected domains of the fruits in a quadrant of the plane rectangular coordinate system.
Since the abscissa of the midpoint of the distance curve represents
Figure 93684DEST_PATH_IMAGE027
Start of sequenceThe hour hand traverses the accumulated arc length of the edge point of the connected domain of the fruit, so the distance curve is divided into four segments according to the quadrant in the plane rectangular coordinate system of the connected domain in the embodiment
Figure 774195DEST_PATH_IMAGE044
Figure 765285DEST_PATH_IMAGE045
Figure 542748DEST_PATH_IMAGE046
Figure 961091DEST_PATH_IMAGE047
The first stage is
Figure 191216DEST_PATH_IMAGE044
The second stage is
Figure 717487DEST_PATH_IMAGE045
The third stage is
Figure 349457DEST_PATH_IMAGE048
The fourth section is
Figure 938701DEST_PATH_IMAGE047
And S2052, acquiring the steepness of the distance curves of different segments.
First, the
Figure 921701DEST_PATH_IMAGE004
Abruptness of segment distance curve
Figure 51331DEST_PATH_IMAGE049
Wherein the content of the first and second substances,
Figure 537807DEST_PATH_IMAGE003
is a distance curve in
Figure 563532DEST_PATH_IMAGE004
The ordinate of the maximum point of each stage indicates that the fruit is in the second stage
Figure 768248DEST_PATH_IMAGE004
The maximum distance from the edge points to the center point in the quadrant,
Figure 653901DEST_PATH_IMAGE005
is a distance curve in
Figure 994883DEST_PATH_IMAGE004
The abscissa of the maximum point of each phase.
Figure 191509DEST_PATH_IMAGE006
Is a distance curve in
Figure 883522DEST_PATH_IMAGE004
The ordinate of the minimum point of each phase.
Analyzing the steepness of each distance curve, wherein the greater the steepness of a certain distance curve is, the greater the change of the distance curve in the section is, and the more curved the edge arc line of the fruit image in the corresponding quadrant is; the less steep a certain distance curve is, the more gradual the distance curve is at that stage, and the more gradual the edge arc is in the corresponding quadrant for the fruit image.
And S2053, acquiring the steepness of the distance curve according to the steepness of the distance curves of different segments.
Figure 558217DEST_PATH_IMAGE050
Reflects the distance curve in
Figure 691389DEST_PATH_IMAGE033
The change of the stage, to measure the overall change of the distance curve, is
Figure 58916DEST_PATH_IMAGE050
Weighted average is calculated to obtain the steepness of the whole distance curve
Figure 704137DEST_PATH_IMAGE051
Wherein
Figure 182523DEST_PATH_IMAGE052
Is as follows
Figure 763677DEST_PATH_IMAGE004
The weight coefficient of the stage reflects the ratio of the arc length of the corresponding fruit in the total circumference, and
Figure 36526DEST_PATH_IMAGE053
and S206, obtaining the classification index of the fruit according to the steepness.
First, the aspect ratio of the connected region of the single fruit is determined
Figure 499869DEST_PATH_IMAGE013
Figure 516366DEST_PATH_IMAGE014
Wherein
Figure 952027DEST_PATH_IMAGE015
The distance between two pixels intersected by the longitudinal axis of the rectangular plane coordinate system and the edge of the connected domain of the fruit is
Figure 395778DEST_PATH_IMAGE016
The distance between two pixels where the horizontal axis of the rectangular plane coordinate system intersects with the edge of the connected domain of the fruit is shown in this embodiment
Figure 287029DEST_PATH_IMAGE054
Then defining the classification index as
Figure 107217DEST_PATH_IMAGE055
In this embodiment, the classification indexes are divided into three types, and the implementer can determine the total number of the classified varieties according to specific requirements, and the first classification threshold and the second classification threshold are combined to obtain the classification indexes
Figure 69488DEST_PATH_IMAGE055
The first classification threshold in this embodiment is
Figure 949720DEST_PATH_IMAGE056
The second classification threshold is
Figure 653233DEST_PATH_IMAGE057
In this embodiment, the specific SD value calculation method is as follows:
Figure 683637DEST_PATH_IMAGE058
wherein]To round up, the data is, illustratively,
Figure 93890DEST_PATH_IMAGE059
when the temperature of the water is higher than the set temperature,
Figure 610935DEST_PATH_IMAGE060
i.e. SD =1 at this time.
And S207, classifying the acid sweetness of the fruits by using the classification indexes of the fruits.
Generally, due to the continuous development of planting technology and agriculture, a variety of fruits exist, taking apples as an example, red fuji, akxose heart, galha, yellow marshal and the like exist in the existing market, the shapes of different varieties have great difference, and the acid sweetness of the tastes of different varieties have difference.
Utilize the categorised index of fruit that obtains in S206 to realize the classification to fruit sour sweetness in this embodiment, use this kind of fruit of kiwi fruit as the example in this embodiment, learn through the sour sweetness and the appearance to the different cultivars of kiwi fruit to analyze: for different varieties of kiwi fruits, the varieties with large classification indexes have large sweetness, namely small acidity, and the varieties with small classification indexes have small sweetness, namely large acidity; therefore, in this embodiment, the kiwi fruit variety with the classification index SD =1 is sour, the kiwi fruit variety with the classification index SD =2 is moderate in sour and sweet, and the kiwi fruit variety with the classification index SD =3 is sweet.
Compared with the traditional technical scheme, the beneficial effects of the embodiment are as follows:
the appearance characteristics of the fruits are utilized to classify the varieties of the same fruit, and the sour-sweet degree of the fruits is classified by utilizing the difference of the sour-sweet degree between different varieties of the same fruit, so that the subsequent classified packaging, sale and other treatment are facilitated; the appearance characteristics of the fruits are obtained through image processing, and the fruit varieties are classified by utilizing the appearance characteristics of the fruits, so that the classification efficiency is effectively improved, and meanwhile, subjective errors caused by artificial classification can be avoided.
Example 3
The embodiment of the invention provides an artificial intelligence-based fruit acid-sweetness classification system, which is characterized by comprising the following components in percentage by weight as shown in figure 5:
the image obtaining module 301 is configured to obtain a preset view image of a fruit to be classified.
The image segmentation module 302 is configured to perform image segmentation on the preset view image to obtain a fruit segmentation image.
And the connected domain obtaining module 303 is configured to obtain a connected domain of the fruit by using the fruit segmentation map, and establish a rectangular plane coordinate system for the connected domain of the fruit.
A distance curve obtaining module 304, configured to obtain a distance curve according to a distance from a pixel at an edge in the connected domain to an origin of the planar rectangular coordinate system.
A steepness calculation module 305 for obtaining a steepness of the distance curve.
And a classification index calculation module 306, configured to obtain a classification index of the fruit according to the steepness.
And the sour-sweet degree classification module 307 is configured to classify the sour-sweet degree of the fruit by using the classification index of the fruit.
Here, it should be noted that: for detailed description of each module in this embodiment, reference may be made to other embodiments, and details are not repeated herein.
In conclusion, compared with the prior art, the fruit type classification method has the advantages that the appearance characteristics of the fruits are utilized to classify the varieties of the same fruit, and the sour-sweet degree of the fruits is classified by utilizing the difference of the sour-sweet degree of different varieties of the same fruit, so that the subsequent classification, packaging, sale and other treatment are facilitated; the appearance characteristics of the fruits are obtained through image processing, and the fruit varieties are classified by utilizing the appearance characteristics of the fruits, so that the classification efficiency is effectively improved, and meanwhile, subjective errors caused by artificial classification can be avoided.
The use of words such as "including," "comprising," "having," and the like, in the present invention is an open-ended word that refers to "including, but not limited to," and that may be used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
It should also be noted that the various components or steps may be broken down and/or re-combined in the methods and systems of the present invention. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The above-mentioned embodiments are merely examples for clearly illustrating the present invention and do not limit the scope of the present invention. It will be apparent to those skilled in the art that other variations and modifications may be made in the foregoing description, and it is not necessary or necessary to exhaustively enumerate all embodiments herein. All designs identical or similar to the present invention are within the scope of the present invention.

Claims (6)

1. An artificial intelligence-based fruit acid-sweetness classification method is characterized by comprising the following steps:
acquiring a preset visual angle image of a fruit to be classified;
carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image;
obtaining a connected domain of the fruit by using the fruit segmentation graph, and establishing a plane rectangular coordinate system for the connected domain of the fruit;
obtaining a distance curve according to the distance from the pixels at the edge of the connected domain to the origin of the plane rectangular coordinate system;
obtaining the steepness of the distance curve;
obtaining a classification index of the fruit according to the steepness;
the classification of the acid sweetness of the fruit is realized by utilizing the classification index of the fruit;
wherein, obtaining a classification index of the fruit according to the steepness comprises:
Figure DEST_PATH_IMAGE002
wherein
Figure DEST_PATH_IMAGE004
Is a classification index of fruit [ alpha ], [ beta ], [ alpha ], [ beta ], [ alpha ], [ beta ] or a]In order to get the whole upwards,
Figure DEST_PATH_IMAGE006
is the abruptness of the distance curve of the fruit,
Figure DEST_PATH_IMAGE008
is the aspect ratio of the fruit
Figure DEST_PATH_IMAGE010
In which
Figure DEST_PATH_IMAGE012
The distance between two pixels intersected by the longitudinal axis of the rectangular plane coordinate system and the edge of the connected domain of the fruit is
Figure DEST_PATH_IMAGE014
The distance between two pixels of which the horizontal axis of the rectangular plane coordinate system intersects with the edge of the connected domain of the fruit,
Figure DEST_PATH_IMAGE016
is a natural constantCounting;
wherein, utilize the categorised index of fruit realizes the classification to fruit acid sweetness, includes: the kiwi fruit variety with the classification index SD =1 is sour, the kiwi fruit variety with the classification index SD =2 is moderate in sweetness and sourness, and the kiwi fruit variety with the classification index SD =3 is sweet.
2. The method as claimed in claim 1, wherein the step of obtaining the connected components of the fruit by using the fruit segmentation graph comprises:
and separating the first fruit part and the second fruit part from each other in the fruit segmentation image to obtain a connected domain of a single fruit.
3. The artificial intelligence based fruit sour sweetness classification method according to claim 1, wherein the obtaining of the connected region of the fruit by using the fruit segmentation map and the establishing of the plane rectangular coordinate system for the connected region of the fruit comprises:
performing opening operation on the fruit segmentation graph to obtain a connected domain of a single fruit;
obtaining a center point of the single fruit through connected domain analysis;
taking the shortest connecting line of two pixels on the edge of the connected domain of the single fruit passing through the central point as a horizontal axis;
and establishing a plane rectangular coordinate system by using the central point and the transverse axis.
4. The artificial intelligence based fruit sour sweetness classification method of claim 1, wherein obtaining the steepness of the distance curve comprises:
dividing the distance curve into different sections of distance curves in a quadrant of the plane rectangular coordinate system according to the connected domain of the fruit;
acquiring the steepness of the different distance curves;
and obtaining the steepness of the distance curve according to the steepness of the distance curves of different sections.
5. The artificial intelligence based fruit sour sweetness classification method of claim 4, wherein obtaining the steepness of the distance curve comprises:
Figure DEST_PATH_IMAGE018
wherein the content of the first and second substances,
Figure 681011DEST_PATH_IMAGE006
in order to be the steepness of the distance curve,
Figure DEST_PATH_IMAGE020
is as follows
Figure DEST_PATH_IMAGE022
The ordinate of the maximum point of the segment distance curve,
Figure DEST_PATH_IMAGE024
is as follows
Figure 207939DEST_PATH_IMAGE022
The abscissa of the maximum point of the segment distance curve,
Figure DEST_PATH_IMAGE026
is as follows
Figure 345266DEST_PATH_IMAGE022
The ordinate of the minimum point of the segment distance curve,
Figure DEST_PATH_IMAGE028
is as follows
Figure DEST_PATH_IMAGE030
The maximum value of the abscissa of the segment distance curve,
Figure DEST_PATH_IMAGE032
is as follows
Figure DEST_PATH_IMAGE034
The maximum value of the abscissa of the distance curve,
Figure DEST_PATH_IMAGE036
6. an artificial intelligence based fruit acid and sweetness classification system, comprising:
the image acquisition module is used for acquiring a preset visual angle image of the fruit to be classified;
the image segmentation module is used for carrying out image segmentation on the preset visual angle image to obtain a fruit segmentation image;
the connected region acquisition module is used for acquiring the connected regions of the fruits by using the fruit segmentation graph and establishing a plane rectangular coordinate system for the connected regions of the fruits;
the distance curve acquisition module is used for acquiring a distance curve according to the distance from the pixels at the edge in the connected domain to the origin of the plane rectangular coordinate system;
a steepness calculation module for obtaining a steepness of the distance curve;
the classification index calculation module is used for obtaining the classification index of the fruit according to the steepness;
the acid-sweetness classification module is used for classifying the acid sweetness of the fruit by using the classification index of the fruit;
wherein, obtaining a classification index of the fruit according to the steepness comprises:
Figure DEST_PATH_IMAGE002A
wherein
Figure 301327DEST_PATH_IMAGE004
Is a classification index of fruit [ alpha ], [ beta ], [ alpha ], [ beta ], [ alpha ], [ beta ] or a]In order to get the whole upwards,
Figure 178016DEST_PATH_IMAGE006
the steepness of the distance curve of the fruit,
Figure 564260DEST_PATH_IMAGE008
is the aspect ratio of the fruit
Figure 628031DEST_PATH_IMAGE010
Wherein
Figure 889248DEST_PATH_IMAGE012
The distance between two pixels intersected by the longitudinal axis of the rectangular plane coordinate system and the edge of the connected domain of the fruit is
Figure 620444DEST_PATH_IMAGE014
The distance between two pixels of which the horizontal axis of the rectangular plane coordinate system intersects with the edge of the connected domain of the fruit,
Figure 909081DEST_PATH_IMAGE016
is a natural constant;
wherein, utilize the categorised index of fruit realizes the classification to fruit acid sweetness, includes: the kiwi fruit variety with the classification index SD =1 is sour, the kiwi fruit variety with the classification index SD =2 is moderate in sour and sweet, and the kiwi fruit variety with the classification index SD =3 is sweet.
CN202210797557.7A 2022-07-08 2022-07-08 Fruit acid-sweetness classification method and system based on artificial intelligence Active CN114882499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210797557.7A CN114882499B (en) 2022-07-08 2022-07-08 Fruit acid-sweetness classification method and system based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210797557.7A CN114882499B (en) 2022-07-08 2022-07-08 Fruit acid-sweetness classification method and system based on artificial intelligence

Publications (2)

Publication Number Publication Date
CN114882499A CN114882499A (en) 2022-08-09
CN114882499B true CN114882499B (en) 2022-09-20

Family

ID=82682628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210797557.7A Active CN114882499B (en) 2022-07-08 2022-07-08 Fruit acid-sweetness classification method and system based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN114882499B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007195024A (en) * 2006-01-20 2007-08-02 Sony Corp Image processing apparatus and method, learning apparatus and method, and program
CN109115775A (en) * 2018-08-08 2019-01-01 长沙理工大学 A kind of betel nut level detection method based on machine vision
CN111968144A (en) * 2020-09-07 2020-11-20 北京凌云光技术集团有限责任公司 Image edge point acquisition method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007195024A (en) * 2006-01-20 2007-08-02 Sony Corp Image processing apparatus and method, learning apparatus and method, and program
CN109115775A (en) * 2018-08-08 2019-01-01 长沙理工大学 A kind of betel nut level detection method based on machine vision
CN111968144A (en) * 2020-09-07 2020-11-20 北京凌云光技术集团有限责任公司 Image edge point acquisition method and device

Also Published As

Publication number Publication date
CN114882499A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
US9852344B2 (en) Systems and methods for semantically classifying and normalizing shots in video
CN107392925B (en) Remote sensing image ground object classification method based on super-pixel coding and convolutional neural network
Jidong et al. Recognition of apple fruit in natural environment
US8311344B2 (en) Systems and methods for semantically classifying shots in video
US9020263B2 (en) Systems and methods for semantically classifying and extracting shots in video
CN111428781A (en) Remote sensing image ground object classification method and system
CN109636784B (en) Image saliency target detection method based on maximum neighborhood and super-pixel segmentation
CN110310241B (en) Method for defogging traffic image with large air-light value by fusing depth region segmentation
CN110866879B (en) Image rain removing method based on multi-density rain print perception
CN104834933A (en) Method and device for detecting salient region of image
CN107622280B (en) Modularized processing mode image saliency detection method based on scene classification
JP2010511215A (en) How to indicate an object in an image
CN110717921B (en) Full convolution neural network semantic segmentation method of improved coding and decoding structure
CN109871900A (en) The recognition positioning method of apple under a kind of complex background based on image procossing
CN110728640A (en) Double-channel single-image fine rain removing method
CN111291818B (en) Non-uniform class sample equalization method for cloud mask
CN108596244A (en) A kind of high spectrum image label noise detecting method based on spectrum angle density peaks
CN114882499B (en) Fruit acid-sweetness classification method and system based on artificial intelligence
Zhao et al. Image dehazing based on haze degree classification
CN110033443B (en) Display panel defect detection method
CN114550167B (en) Artificial intelligence based pear quality classification method and device
Nawawi et al. Comprehensive pineapple segmentation techniques with intelligent convolutional neural network
CN115063603B (en) Wood annual ring line accurate extraction and restoration method based on edge information
CN115330721A (en) Banana fruit comb plumpness detection method and system based on shape and color information
CN115049865A (en) Tobacco leaf grading method and system based on computer vision

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
GR01 Patent grant
GR01 Patent grant