CN115311505A - Silkworm cocoon classification method and purchase system based on cloud service big data platform - Google Patents

Silkworm cocoon classification method and purchase system based on cloud service big data platform Download PDF

Info

Publication number
CN115311505A
CN115311505A CN202211238417.2A CN202211238417A CN115311505A CN 115311505 A CN115311505 A CN 115311505A CN 202211238417 A CN202211238417 A CN 202211238417A CN 115311505 A CN115311505 A CN 115311505A
Authority
CN
China
Prior art keywords
silkworm cocoon
silkworm
image
quality
pixel point
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.)
Granted
Application number
CN202211238417.2A
Other languages
Chinese (zh)
Other versions
CN115311505B (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.)
Sichuan Zhugan Information Technology Co ltd
Original Assignee
Sichuan Zhugan Information Technology 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 Sichuan Zhugan Information Technology Co ltd filed Critical Sichuan Zhugan Information Technology Co ltd
Priority to CN202211238417.2A priority Critical patent/CN115311505B/en
Publication of CN115311505A publication Critical patent/CN115311505A/en
Application granted granted Critical
Publication of CN115311505B publication Critical patent/CN115311505B/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
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Geometry (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention relates to the field of image processing, in particular to a silkworm cocoon classification method and a purchase system based on a cloud service big data platform, which comprise the following steps: the method comprises the steps of obtaining a rectangular surrounding frame of a silkworm cocoon image, reducing the rectangular surrounding frame of the silkworm cocoon image according to each reduction proportion to obtain a plurality of first surrounding frames, obtaining target pixel points, obtaining central pixel points of the silkworm cocoon image, obtaining a Gaussian fitting model according to the distance from each target pixel point to each central pixel point, obtaining a scatter diagram, fitting the scatter diagram by using least square to obtain a fitting curve, obtaining first quality of a silkworm cocoon sample corresponding to the silkworm cocoon image according to the scatter diagram, the fitting curve and the area of the silkworm cocoon image, obtaining second quality of the silkworm cocoon sample according to the same principle, obtaining the quality of the silkworm cocoon sample according to the first quality and the second quality of the silkworm cocoon sample, and purchasing the silkworm cocoon according to the quality of each silkworm cocoon sample. The invention ensures that the finally purchased silkworm cocoons with each quality more meet the actual requirements.

Description

Silkworm cocoon classification method and purchase system based on cloud service big data platform
Technical Field
The invention relates to the field of image processing, in particular to a silkworm cocoon classification method and a purchasing system based on a cloud service big data platform.
Background
The silkworm cocoons are also called silkworm clothes, namely the silkworm cocoons on the silkworm body as the name suggests, and have wider functions in life, such as pharmacy, silk manufacturing, silkworm oil extraction and livestock feed, so the silkworm cocoons have a wide market, a large amount of silkworm cocoons are required to be purchased and stored when a factory utilizes the silkworm cocoons to manufacture, raw materials of the factory cannot be interrupted, but the quality of the silkworm cocoons in the current market is uneven, so that the quality of the silkworm cocoons in each batch of silkworm cocoons is uneven, if the silkworm cocoons are directly purchased according to batches, the purchased silkworm cocoons of each quality are not corresponding to the required silkworm cocoons of each silkworm cocoon quality, so the raw material cost and the storage cost of the factory are increased, and therefore, the classification and purchase of the silkworm cocoons of each quality is very important when the silkworm cocoons are purchased.
In the prior art, the evaluation of the quality of the silkworm cocoons is to divide a silkworm cocoon image by utilizing an atrazine threshold value division technology, divide spot areas in the silkworm cocoon image by an adaptive threshold value and evaluate the quality of the silkworm cocoons according to the areas of the spot areas, wherein the larger the spot area in the silkworm cocoon image is, the less the silk area of the silkworm cocoons is, the poorer the quality of the silkworm cocoons is; however, the cocoons themselves have certain colors, and the different colors of the cocoons can cause different quality of the cocoons, and the method only combines the areas of spot areas on the cocoons and does not combine the colors of the cocoons, so that the evaluation on the quality of the cocoons is inaccurate, and the classification of the cocoons is inaccurate.
Disclosure of Invention
The invention provides a silkworm cocoon classification method and a purchase system based on a cloud service big data platform, which aim to solve the problem of inaccurate classification of the existing silkworm cocoons.
The invention discloses a silkworm cocoon classification method based on a cloud service big data platform, which adopts the following technical scheme:
s1, acquiring a silkworm cocoon sample image, acquiring an HSV (hue, saturation and value) image of a silkworm cocoon according to the silkworm cocoon sample image, acquiring a rectangular enclosure frame of the HSV image, setting a plurality of reduction ratios, reducing the rectangular enclosure frame of the HSV image according to each reduction ratio to obtain a plurality of reduced rectangular enclosure frames, and taking the reduced rectangular enclosure frames as first enclosure frames;
s2, obtaining each symmetry axis of the rectangular enclosing frame, respectively obtaining target pixel points of the rectangular enclosing frame and each first enclosing frame on each symmetry axis, obtaining central pixel points of the silkworm cocoon image, and performing Gaussian fitting according to the distance from each target pixel point to the central pixel points to obtain Gaussian values of corresponding target pixel points;
s3, obtaining a first difference value of each target pixel point according to the brightness value of each target pixel point and the Gaussian value of the corresponding target pixel point, drawing a scatter diagram by using the first difference value of each target pixel point and the distance from each target pixel point to the center pixel point, and fitting the scatter diagram by using least square to obtain a fitting curve;
and S4, obtaining the quality of the silkworm cocoon sample corresponding to the HSV image according to the scatter diagram, the fitting curve and the silkworm cocoon image area, and classifying the silkworm cocoons by using the quality of all the obtained silkworm cocoon samples.
Further, the silkworm cocoon image is determined according to the following method:
acquiring a front image and a back image of a silkworm cocoon sample, obtaining binary images of the front image and the back image of the silkworm cocoon sample according to the front image and the back image of the silkworm cocoon sample, and performing dot multiplication on the binary images of the front image and the back image of the silkworm cocoon sample and the front image and the back image of the corresponding silkworm cocoon sample to obtain a corresponding silkworm cocoon image;
and converting the silkworm cocoon image into an HSV space to obtain the HSV image of the silkworm cocoon.
Further, the plurality of reduced rectangular bounding boxes are determined as follows:
and reducing the rectangular surrounding frames in an equal proportion according to each reduction proportion to obtain a plurality of reduced rectangular surrounding frames, wherein when the rectangular surrounding frames are reduced in the equal proportion, the rectangular surrounding frames are reduced in the equal proportion from large to small according to the reduction proportion.
Further, the method for obtaining the gaussian value of the target pixel point comprises the following steps:
performing Gaussian fitting according to the distance difference between the distance from the target pixel point corresponding to the rectangular enclosure frame to the central pixel point and the distance from the target pixel point corresponding to each first enclosure frame to the central pixel point to obtain a Gaussian fitting model;
and obtaining the Gaussian value of the target pixel point according to the Gaussian fitting model.
Further, the quality of the silkworm cocoon sample is determined according to the following method:
acquiring the shortest distance from each point in the scatter diagram to the fitted curve;
acquiring the hue difference of each point in the scatter diagram and a point on the connection line with the shortest distance or near the connection line and closest to the fitting curve;
acquiring the area of a silkworm cocoon image;
multiplying the shortest distance from each point in the scatter diagram to the fitting curve by the corresponding hue difference to obtain a plurality of products, and accumulating each product to obtain an accumulated product;
and obtaining the quality of the cocoon sample corresponding to the HSV image according to the ratio of the accumulated product to the area of the HSV image.
Further, the method for classifying the silkworm cocoons comprises the following steps:
acquiring the number of the silkworm cocoons in the batch where the silkworm cocoon samples are located, and acquiring the silkworm cocoon samples in the batch of silkworm cocoons under each quality according to the quality of each silkworm cocoon sample and a preset silkworm cocoon quality grade;
obtaining the content of the silkworm cocoons of each quality in the batch of silkworm cocoons according to the ratio of the number of the silkworm cocoon samples in the batch of silkworm cocoons of each quality to the number of the silkworm cocoons of the batch of silkworm cocoon samples;
and acquiring the quality of the batch of silkworm cocoons, and obtaining the quality of each quality silkworm cocoon in the batch of silkworm cocoons according to the product of the content of each quality silkworm cocoon in the batch of silkworm cocoons and the quality of the batch of silkworm cocoons.
Silkworm cocoon purchasing system based on cloud service big data platform includes:
the image acquisition module is used for acquiring images of the silkworm cocoon samples;
the image input module is used for inputting the obtained silkworm cocoon sample image into a processor of the acquisition system;
an image processing module comprising: the device comprises a Gaussian fitting unit, a curve fitting unit and a silkworm cocoon classification unit; wherein:
the Gaussian fitting unit is used for acquiring each symmetry axis of the rectangular enclosing frame, respectively acquiring target pixel points of the rectangular enclosing frame and each first enclosing frame on each symmetry axis, acquiring central pixel points of the silkworm cocoon image, and performing Gaussian fitting according to the distance from each target pixel point to the central pixel points to obtain Gaussian values of corresponding target pixel points;
the curve fitting unit is used for obtaining a first difference value of each target pixel point according to the brightness value of each target pixel point and the Gaussian value of the corresponding target pixel point, drawing a scatter diagram by using the first difference value of each target pixel point and the distance from each target pixel point to the central pixel point, and fitting the scatter diagram by using least square to obtain a fitting curve;
the silkworm cocoon classification unit is used for obtaining the quality of the silkworm cocoon sample corresponding to the HSV image according to the scatter diagram, the fitting curve and the silkworm cocoon image area and classifying the silkworm cocoons by using the quality of all the obtained silkworm cocoon samples;
and the output module is used for outputting the quality of each classified silkworm cocoon with each quality.
The invention has the beneficial effects that: according to the method, firstly, the silkworm cocoon samples in each batch of silkworm cocoons are extracted, the silkworm cocoon images corresponding to the silkworm cocoon samples are obtained according to the silkworm cocoon samples, the silkworm cocoon images are converted into HSV space, the silkworm cocoon quality can be evaluated in a mode of combining the color and the brightness of the silkworm cocoons, secondly, the distance between the central pixel point and the target pixel point of the silkworm cocoon images is used for replacing the brightness value in the silkworm cocoon images, not only is the calculated amount reduced, but also the final evaluation value of the silkworm cocoons is more accurate, and finally, gaussian fitting is performed on the silkworm cocoons of each quality in each batch of silkworm cocoons during purchase, the silkworm cocoon quality of each silkworm cocoon quality after Gaussian fitting is accumulated, the accumulated sum is matched with the real required quantity of the silkworm cocoons of each quality, the silkworm cocoon batch with the highest matching degree is purchased, the silkworm cocoons of each quality are purchased according to need, and the increase of factory storage cost and raw material cost is prevented.
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 flowchart of an embodiment of a silkworm cocoon classification method based on a cloud service big data platform according to the present invention;
fig. 2 is a schematic diagram of a cocoon image rectangular enclosure frame in an embodiment of a cocoon classification method based on a cloud service big data platform according to the present invention;
FIG. 3 is a schematic diagram of a plurality of rectangular bounding boxes in an embodiment of the cocoon classification method based on the cloud service big data platform of the present invention;
fig. 4 is a schematic diagram of a target pixel point in an embodiment of the method for classifying cocoons based on a cloud service big data platform according to the present invention;
FIG. 5 is a schematic diagram illustrating a distance difference in an embodiment of a method for classifying silkworm cocoons based on a cloud service big data platform according to the present invention;
fig. 6 is a flowchart of a silkworm cocoon purchasing system based on a cloud service big data platform according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The embodiment of the silkworm cocoon classification method based on the cloud service big data platform, as shown in fig. 1, includes:
the method includes the steps of S1, obtaining a silkworm cocoon sample image, obtaining an HSV (hue, saturation and value) image of the silkworm cocoon according to the silkworm cocoon sample image, obtaining a rectangular enclosure frame of the HSV image, setting a plurality of reduction ratios, reducing the rectangular enclosure frame of the HSV image according to each reduction ratio to obtain a plurality of reduced rectangular enclosure frames, and taking the reduced rectangular enclosure frames as first enclosure frames.
The method for acquiring the front image of the silkworm cocoon sample comprises the following specific steps: determining the cocoons to be detected in the current batch, randomly extracting Q cocoons samples from the cocoons in the current batch by related purchasing staff, wherein the Q value is as large as possible, so that the integral counting detection result of the content of the cocoons in different types in the current batch is credible, and the Q cocoons samples are flatly laid on a detection device by the related purchasing staff, wherein two fixed cameras are erected above and below the cocoons detection device and are used for collecting images of the front and back sides of the cocoons to further obtain images of the front and back sides of the cocoons in the current batch, wherein the two cameras are used for preventing spots at the lower parts of the cocoons from being shot when the cocoons samples are placed to cause the counting of errors when the cocoons in the current batch are classified.
Graying the front image of the silkworm cocoon samples in the current batch of silkworm cocoons to obtain a gray image, carrying out image denoising on the gray image by adopting Gaussian filtering, carrying out edge detection on the denoised image by a canny algorithm to obtain an edge image after the edge detection, carrying out morphological filling treatment on the edge image to obtain a binary image of the front image of the corresponding silkworm cocoon sample, carrying out dot multiplication operation on the binary image of the front image of each silkworm cocoon sample and the front image of the silkworm cocoon sample to obtain the corresponding silkworm cocoon image, wherein spots exist in the silkworm cocoon, so that each silkworm cocoon image is converted into an HSV color space to obtain an HSV image of the silkworm cocoon.
The outline of each cocoon image is surrounded by a rectangle to obtain a rectangular surrounding frame of each cocoon image, and a specific schematic diagram is shown in fig. 2.
The specific steps for obtaining the first enclosure frame are as follows: setting a plurality of reduction ratios, each reduction ratio having an equal variation, e.g.
Figure 78045DEST_PATH_IMAGE001
The rectangular surrounding frame of each silkworm cocoon image is reduced according to the reduction ratio
Figure 791923DEST_PATH_IMAGE002
Sequentially reducing the size in equal proportion to obtain a plurality of reduced rectangular surrounding frames, wherein the specific schematic diagram is shown in fig. 3, and it should be noted that only fig. 3 showsThe rectangular surrounding frame of each silkworm cocoon image is reduced in proportion
Figure 102819DEST_PATH_IMAGE003
And sequentially carrying out isometric reduction on the schematic diagram, and taking the reduced rectangular enclosure frame as a first enclosure frame.
S2, obtaining each symmetry axis of the rectangular enclosing frame, respectively obtaining target pixel points of the rectangular enclosing frame and each first enclosing frame on each symmetry axis, obtaining central pixel points of the silkworm cocoon image, and performing Gaussian fitting according to the distance from each target pixel point to the central pixel points to obtain Gaussian values of corresponding target pixel points.
Each symmetry axis of the rectangular enclosure frame is obtained, pixel points of the rectangular enclosure frame and each first enclosure frame on each symmetry axis are respectively obtained, a specific schematic diagram is shown in fig. 4, and the pixel points of the rectangular enclosure frame and each first enclosure frame on each symmetry axis are used as target pixel points.
The brightness value of each target pixel point in each silkworm cocoon image in the HSV color space is obtained, and because the silkworm cocoons are in an oval shape, the gray value of the silkworm cocoons has the characteristics of high middle and low edge, the central pixel point of the silkworm cocoon image has the highest brightness value, and the brightness value is gradually decreased from the central pixel point to the edge. Therefore, the normal change of the brightness value on the silkworm cocoon image is approximately described by the two-dimensional single Gaussian model, wherein when the two-dimensional single Gaussian model is fitted, the central pixel point of the silkworm cocoon image is obtained, and the distance from the target pixel point to the central pixel point is used for fitting instead of the brightness value.
The specific steps of obtaining the Gaussian fitting model according to the distance from each target pixel point to the central pixel point are as follows: and performing Gaussian fitting according to the distance difference between the distance from the target pixel point corresponding to the rectangular enclosing frame to the central pixel point and the distance from the target pixel point corresponding to each first enclosing frame to the central pixel point to obtain a Gaussian fitting model. A schematic diagram of a specific distance difference is shown in figure 5,
Figure 29186DEST_PATH_IMAGE004
representing the target pixel point to the central image corresponding to the rectangular enclosing frameThe distance between the pixel points, OB and OC represent the distance between the central pixel point and different first bounding boxes,
Figure 577980DEST_PATH_IMAGE004
reducing
Figure 931600DEST_PATH_IMAGE005
Is greater than
Figure 729792DEST_PATH_IMAGE004
Reducing
Figure 459851DEST_PATH_IMAGE006
The distance difference is decreased from the center part to the edge part of the cocoon image, and is consistent with the brightness variation trend of the pixel points in the cocoon image. And obtaining the Gaussian value of each target pixel point in the Gaussian fitting model according to the Gaussian fitting model.
S3, obtaining a first difference value of each target pixel point according to the brightness value of each target pixel point and the Gaussian value of the corresponding target pixel point, drawing a scatter diagram by using the first difference value of each target pixel point and the distance from each target pixel point to the central pixel point, and fitting the scatter diagram by using least square to obtain a fitting curve.
The Gaussian fitting model is obtained by the distance between the target pixel point and the central pixel point, so that each target pixel point is bound to have a corresponding point in the Gaussian fitting model, the difference value of the brightness value of each target pixel point and the Gaussian value of the corresponding point in the Gaussian fitting model is obtained, the difference value of the brightness value of each target pixel point and the Gaussian value of the corresponding point in the Gaussian fitting model is used as a first difference value of the target pixel point, and the distance from each target pixel point to the central pixel point is used as a first difference value of the target pixel point
Figure 925467DEST_PATH_IMAGE007
As an abscissa, a first difference corresponding to each target pixel point
Figure 449989DEST_PATH_IMAGE008
Drawing a scatter diagram for the ordinate, and fitting the scatter diagram by using least square to obtain a fitting curve。
And S4, obtaining the quality of the silkworm cocoon sample corresponding to the HSV image according to the scatter diagram, the fitting curve and the silkworm cocoon image area, and classifying the silkworm cocoons by using the quality of all the obtained silkworm cocoon samples.
The specific steps for obtaining the first quality of the silkworm cocoon sample are as follows: acquiring a point on a shortest distance connecting line from each point in the scatter diagram to the fitting curve, acquiring a point on each connecting line or near the connecting line closest to the fitting curve, setting a specific range near the connecting line according to specific conditions, and acquiring the hue difference between each point and a point on the shortest distance connecting line or near the connecting line closest to the fitting curve
Figure 938740DEST_PATH_IMAGE009
(wherein each point in the scatter diagram is bound to correspond to a target pixel point, and the hue of the target pixel point is the component of an H channel in the HSV color space), and obtaining the shortest distance from each point in the scatter diagram to the fitting curve
Figure 472489DEST_PATH_IMAGE010
Obtaining area of cocoon image
Figure 541681DEST_PATH_IMAGE011
According to
Figure 502684DEST_PATH_IMAGE012
And
Figure 478730DEST_PATH_IMAGE011
obtaining a first quality of each silkworm cocoon sample, wherein a specific expression is as follows:
Figure 285012DEST_PATH_IMAGE013
in the formula:
Figure 725221DEST_PATH_IMAGE009
represents the first in a scatter diagram
Figure 591546DEST_PATH_IMAGE014
Hue difference between a point and the closest point to the fitted curve on or near the line connecting the points with their shortest distances,
Figure 54888DEST_PATH_IMAGE010
represents the first in a scatter diagram
Figure 930440DEST_PATH_IMAGE014
The shortest distance of a point to the fitted curve,
Figure 959576DEST_PATH_IMAGE015
represents the area of the image corresponding to the silkworm cocoon,
Figure 465644DEST_PATH_IMAGE016
the first quality of the cocoon sample corresponding to the cocoon image is represented.
The fitting curve represents the normal quality of the target pixel point, and the tone difference of each point on a connecting line with the shortest distance or a point which is near the connecting line and is closest to the fitting curve is calculated to measure the quality of each point in the scatter diagram, namely the quality of each target pixel point in the silkworm cocoon image can be measured; calculating the shortest distance from each point in the scatter diagram to the fitting curve, and measuring the quality of each point, namely measuring the quality of each target pixel point in the silkworm cocoon image; therefore, the quality of the silkworm cocoon image is measured from two dimensions of the shortest distance and the hue difference, and the larger the shortest distance and the hue difference are, the larger the deviation between the point and the fitting curve is, the poorer the quality of the point is, namely
Figure 213020DEST_PATH_IMAGE016
The larger the cocoon image, the worse the quality of the cocoon sample corresponding to the cocoon image.
Thus, the first quality of the silkworm cocoon samples is obtained, and the first quality of each silkworm cocoon sample can be obtained according to the first quality calculation formula.
Obtaining a back image of each silkworm cocoon sample according to the steps S1-S4, and obtaining a second quality of each silkworm cocoon sample
Figure 829946DEST_PATH_IMAGE017
Obtaining the quality of each cocoon sample of the current batch according to the first quality and the second quality of each cocoon sample
Figure 979168DEST_PATH_IMAGE018
And the quality of each silkworm cocoon sample is the sum of the corresponding first quality and the second quality, and each silkworm cocoon sample necessarily corresponds to one silkworm cocoon.
The method for classifying the silkworm cocoons comprises the following steps: acquiring the number of the silkworm cocoons in the batch where the silkworm cocoon sample is located, acquiring the silkworm cocoon sample in the batch of the silkworm cocoons under each quality according to the quality of each silkworm cocoon sample and a preset silkworm cocoon quality grade, acquiring the content of the silkworm cocoons with each quality in the batch according to the ratio of the silkworm cocoon sample in the batch of the silkworm cocoons under each quality to the number of the silkworm cocoons in the batch where the silkworm cocoon sample is located, acquiring the quality of the batch of the silkworm cocoons, and acquiring the quality of the silkworm cocoons with each quality in the batch of the silkworm cocoons according to the product of the content of the silkworm cocoons with each quality in the batch and the quality of the batch of the silkworm cocoons, wherein the silkworm cocoon quality grade is set to take the quality of each single silkworm cocoon at an interval of 10 as a quality grade, for example, the silkworm cocoon quality grade is set
Figure 452874DEST_PATH_IMAGE019
Is a first-level one-step one,
Figure 625230DEST_PATH_IMAGE020
the method is a second-level method, and by analogy, the interval division of the quality of the single silkworm cocoon can be adjusted according to the specific implementation requirements, and the empirical value obtained by the method is 10. Thus, the quality classification of the batch of silkworm cocoons is completed.
Silkworm cocoon acquisition system based on cloud service big data platform includes: image acquisition module, image input module, image processing module, output module, wherein image processing module includes: a Gaussian fitting unit, a curve fitting unit and a cocoon classification unit, as shown in FIG. 6.
The image acquisition module is used for acquiring images of the silkworm cocoon samples.
And the image input module is used for inputting the acquired silkworm cocoon sample image into a processor of the acquisition system.
An image processing module comprising: the device comprises a Gaussian fitting unit, a curve fitting unit and a silkworm cocoon classification unit; wherein:
and the Gaussian fitting unit is used for acquiring each symmetry axis of the rectangular enclosing frame, acquiring target pixel points of the rectangular enclosing frame and each first enclosing frame on each symmetry axis respectively, acquiring central pixel points of the silkworm cocoon image, and performing Gaussian fitting according to the distance from each target pixel point to the central pixel points to obtain Gaussian values of corresponding target pixel points.
And the curve fitting unit is used for obtaining a first difference value of each target pixel point according to the brightness value of each target pixel point and the Gaussian value of the corresponding target pixel point, drawing a scatter diagram by using the first difference value of each target pixel point and the distance from each target pixel point to the central pixel point, and fitting the scatter diagram by using least square to obtain a fitting curve.
And the silkworm cocoon classification unit is used for obtaining the quality of the silkworm cocoon sample corresponding to the HSV image according to the scatter diagram, the fitting curve and the silkworm cocoon image area, and classifying the silkworm cocoon by using the quality of all the obtained silkworm cocoon samples.
And the output module is used for outputting the quality of each classified silkworm cocoon with each quality.
The method comprises the steps of obtaining the number of the cocoons of the current batch where the cocoons are located, dividing the cocoons samples according to quality grades to obtain the cocoons samples of the batch of cocoons under each quality, obtaining the content of the cocoons of each quality in the batch of cocoons according to the ratio of the cocoons samples of the batch of cocoons under each quality to the number of the cocoons of the batch, obtaining the quality of the batch of cocoons, and obtaining the quality of the cocoons of each quality in the batch of cocoons according to the product of the content of the cocoons of each quality in the batch of cocoons and the quality of the batch of cocoons.
After the mass of each quality of silkworm cocoons in the current batch is obtained, due to the fact that the demanded quantities of different types of silkworm cocoons in a factory are different and the purchase quantities are different, the stock quantity and the demanded quantity of each quality of silkworm cocoons are obtained, and the real demanded quantity of each quality of silkworm cocoons is obtained by subtracting the corresponding stock quantity according to the demanded quantity of each quality of silkworm cocoons.
The method comprises the steps of obtaining the quality of each quality of silkworm cocoon in each batch of silkworm cocoons during purchase, conducting Gaussian fitting on the quality of each quality of silkworm cocoon in each batch of silkworm cocoons to obtain the quality of each quality of silkworm cocoon in each batch of silkworm cocoons after Gaussian fitting, accumulating the quality of each quality of silkworm cocoon in each batch of silkworm cocoons after Gaussian fitting to obtain the quality of each quality of silkworm cocoon after accumulation, matching the quality of each quality of silkworm cocoon after accumulation with the real demand of each quality of silkworm cocoon, and purchasing the silkworm cocoon batch with the highest matching degree.
The specific steps of accumulating the quality of each quality silkworm cocoon in each batch of silkworm cocoons after Gaussian fitting are as follows: obtaining the total number of silkworm cocoon batches during purchase
Figure 577005DEST_PATH_IMAGE021
To, for
Figure 580733DEST_PATH_IMAGE021
Arranging and combining the silkworm cocoons in batches, wherein the number of the arranged and combined elements is
Figure 490920DEST_PATH_IMAGE022
And is and
Figure 947310DEST_PATH_IMAGE023
for example, two batches are first extracted from the total number of silkworm cocoon batches as a permutation and combination element, i.e.
Figure 906038DEST_PATH_IMAGE024
When in use, will
Figure 764273DEST_PATH_IMAGE021
And arranging and combining every two silkworm cocoon batches to obtain a plurality of combinations, repeating the steps to obtain all combinations, and accumulating the mass of each quality silkworm cocoon in each batch of silkworm cocoons after Gaussian fitting in each combination to obtain the accumulated mass of each quality silkworm cocoon.
And matching the quality of all the accumulated cocoons with each quality with the real demand of each cocoon quality, and purchasing the cocoons in the combination with the highest matching degree in batches. The highest matching degree is the combination of the quality of each type of silkworm cocoon and the real demand of the quality of each type of silkworm cocoon.
The invention has the beneficial effects that: according to the method, firstly, the silkworm cocoon samples in each batch of silkworm cocoons are extracted, the silkworm cocoon images corresponding to the silkworm cocoon samples are obtained according to the silkworm cocoon samples, the silkworm cocoon images are converted into HSV space, and the silkworm cocoon quality can be evaluated in combination with the color and the brightness of the silkworm cocoons.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (7)

1. A silkworm cocoon classification method based on a cloud service big data platform is characterized by comprising the following steps:
s1, acquiring a silkworm cocoon sample image, acquiring an HSV (hue, saturation and value) image of a silkworm cocoon according to the silkworm cocoon sample image, acquiring a rectangular enclosure frame of the HSV image, setting a plurality of reduction ratios, reducing the rectangular enclosure frame of the HSV image according to each reduction ratio to obtain a plurality of reduced rectangular enclosure frames, and taking the reduced rectangular enclosure frames as first enclosure frames;
s2, obtaining each symmetry axis of the rectangular surrounding frame, respectively obtaining target pixel points of the rectangular surrounding frame and each first surrounding frame on each symmetry axis, obtaining central pixel points of the silkworm cocoon image, and performing Gaussian fitting according to the distance from each target pixel point to each central pixel point to obtain Gaussian values of the corresponding target pixel points;
s3, obtaining a first difference value of each target pixel point according to the brightness value of each target pixel point and the Gaussian value of the corresponding target pixel point, drawing a scatter diagram by using the first difference value of each target pixel point and the distance from each target pixel point to a central pixel point, and fitting the scatter diagram by using least square to obtain a fitting curve;
and S4, obtaining the quality of the silkworm cocoon sample corresponding to the HSV image according to the scatter diagram, the fitting curve and the silkworm cocoon image area, and classifying the silkworm cocoons by using the quality of all the obtained silkworm cocoon samples.
2. The silkworm cocoon classification method based on the cloud service big data platform according to claim 1, wherein the silkworm cocoon image is determined according to the following method:
acquiring a front image and a back image of a silkworm cocoon sample, acquiring binary images of the front image and the back image of the silkworm cocoon sample according to the front image and the back image of the silkworm cocoon sample, and performing dot multiplication on the binary images of the front image and the back image of the silkworm cocoon sample and the front image and the back image of the corresponding silkworm cocoon sample to obtain a corresponding silkworm cocoon image;
and converting the silkworm cocoon image into an HSV space to obtain the HSV image of the silkworm cocoon.
3. The silkworm cocoon classification method based on the cloud service big data platform according to claim 1, wherein the plurality of reduced rectangular enclosing frames are determined according to the following method:
and reducing the rectangular surrounding frame in an equal proportion according to each reduction proportion to obtain a plurality of reduced rectangular surrounding frames, wherein when the rectangular surrounding frames are reduced in the equal proportion, the rectangular surrounding frames are reduced in the equal proportion from large to small according to the reduction proportion.
4. The silkworm cocoon classification method based on the cloud service big data platform according to claim 1, wherein the gaussian value of the target pixel point is determined according to the following method:
performing Gaussian fitting according to the distance difference between the distance from the target pixel point corresponding to the rectangular enclosure frame to the central pixel point and the distance from the target pixel point corresponding to each first enclosure frame to the central pixel point to obtain a Gaussian fitting model;
and obtaining the Gaussian value of the target pixel point according to the Gaussian fitting model.
5. The silkworm cocoon classification method based on the cloud service big data platform as claimed in claim 1, wherein the quality of the silkworm cocoon sample is determined according to the following method:
obtaining the shortest distance from each point in the scatter diagram to the fitted curve;
acquiring the hue difference of each point in the scatter diagram and the point which is on the connection line of the shortest distance of each point or is near the connection line and is closest to the fitting curve;
acquiring the area of a silkworm cocoon image;
multiplying the shortest distance from each point in the scatter diagram to the fitting curve by the corresponding hue difference to obtain a plurality of products, and accumulating each product to obtain an accumulated product;
and obtaining the quality of the cocoon sample corresponding to the HSV image according to the ratio of the accumulated product to the area of the HSV image.
6. The silkworm cocoon classification method based on the cloud service big data platform according to claim 1, wherein the method for classifying the silkworm cocoons is as follows:
acquiring the number of the silkworm cocoons in the batch where the silkworm cocoon sample is located, and acquiring the silkworm cocoon sample in the batch of silkworm cocoons under each quality according to the quality of each silkworm cocoon sample and a preset silkworm cocoon quality grade;
obtaining the content of the silkworm cocoons of each quality in the batch of silkworm cocoons according to the ratio of the number of the silkworm cocoon samples in the batch of silkworm cocoons of each quality to the number of the silkworm cocoons of the batch of silkworm cocoon samples;
and acquiring the quality of the batch of silkworm cocoons, and obtaining the quality of each quality silkworm cocoon in the batch of silkworm cocoons according to the product of the content of each quality silkworm cocoon in the batch of silkworm cocoons and the quality of the batch of silkworm cocoons.
7. Silkworm cocoon acquisition system based on cloud service big data platform, its characterized in that includes:
the image acquisition module is used for acquiring images of the silkworm cocoon samples;
the image input module is used for inputting the acquired silkworm cocoon sample image into a processor of the acquisition system;
an image processing module comprising: the device comprises a Gaussian fitting unit, a curve fitting unit and a silkworm cocoon classifying unit; wherein:
the Gaussian fitting unit is used for acquiring each symmetry axis of the rectangular surrounding frame, respectively acquiring target pixel points of the rectangular surrounding frame and each first surrounding frame on each symmetry axis, acquiring central pixel points of the silkworm cocoon image, and performing Gaussian fitting according to the distance from each target pixel point to the central pixel points to obtain Gaussian values of the corresponding target pixel points;
the curve fitting unit is used for obtaining a first difference value of each target pixel point according to the brightness value of each target pixel point and the Gaussian value of the corresponding target pixel point, drawing a scatter diagram by using the first difference value of each target pixel point and the distance from each target pixel point to the central pixel point, and fitting the scatter diagram by using least square to obtain a fitting curve;
the silkworm cocoon classification unit is used for obtaining the quality of the silkworm cocoon sample corresponding to the HSV image according to the scatter diagram, the fitting curve and the silkworm cocoon image area and classifying the silkworm cocoons by using the quality of all the obtained silkworm cocoon samples;
and the output module is used for outputting the quality of each classified silkworm cocoon with each quality.
CN202211238417.2A 2022-10-11 2022-10-11 Silkworm cocoon classification method and purchase system based on cloud service big data platform Active CN115311505B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211238417.2A CN115311505B (en) 2022-10-11 2022-10-11 Silkworm cocoon classification method and purchase system based on cloud service big data platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211238417.2A CN115311505B (en) 2022-10-11 2022-10-11 Silkworm cocoon classification method and purchase system based on cloud service big data platform

Publications (2)

Publication Number Publication Date
CN115311505A true CN115311505A (en) 2022-11-08
CN115311505B CN115311505B (en) 2022-12-27

Family

ID=83868074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211238417.2A Active CN115311505B (en) 2022-10-11 2022-10-11 Silkworm cocoon classification method and purchase system based on cloud service big data platform

Country Status (1)

Country Link
CN (1) CN115311505B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106932408A (en) * 2017-03-20 2017-07-07 山东农业大学 A kind of paper cocooning frame pollution silk cocoon detection method based on image procossing
CN109215015A (en) * 2018-07-24 2019-01-15 北京工业大学 A kind of online visible detection method of silk cocoon based on convolutional neural networks
CN109829905A (en) * 2019-01-30 2019-05-31 中国矿业大学 It is a kind of face beautification perceived quality without reference evaluation method
CN110567888A (en) * 2019-09-12 2019-12-13 中国计量大学 silkworm cocoon dry shell amount nondestructive testing method based on visible/near infrared spectrum and deep learning
CN110749598A (en) * 2019-11-05 2020-02-04 中国计量大学 Silkworm cocoon surface defect detection method integrating color, shape and texture characteristics
WO2020247594A1 (en) * 2019-06-04 2020-12-10 Cocoon Biotech Inc. Silk-based products, formulations, and methods of use

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106932408A (en) * 2017-03-20 2017-07-07 山东农业大学 A kind of paper cocooning frame pollution silk cocoon detection method based on image procossing
CN109215015A (en) * 2018-07-24 2019-01-15 北京工业大学 A kind of online visible detection method of silk cocoon based on convolutional neural networks
CN109829905A (en) * 2019-01-30 2019-05-31 中国矿业大学 It is a kind of face beautification perceived quality without reference evaluation method
WO2020247594A1 (en) * 2019-06-04 2020-12-10 Cocoon Biotech Inc. Silk-based products, formulations, and methods of use
CN110567888A (en) * 2019-09-12 2019-12-13 中国计量大学 silkworm cocoon dry shell amount nondestructive testing method based on visible/near infrared spectrum and deep learning
CN110749598A (en) * 2019-11-05 2020-02-04 中国计量大学 Silkworm cocoon surface defect detection method integrating color, shape and texture characteristics

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
GUANGYOU YANG等: "Research on the Non-destructive Testing Method of Pod Based on Neural Networks", 《FIRST INTERNATIONAL CONFERENCE ON INNOVATIVE COMPUTING, INFORMATION AND CONTROL-VOLUME I (ICICIC"06)》 *
SHIJIE LI等: "Research on the Identification Method of Silkworm Cocoon Species Based on Improved YOLOv3", 《2020 5TH INTERNATIONAL CONFERENCE ON MECHANICAL, CONTROL AND COMPUTER ENGINEERING (ICMCCE)》 *
刘莫尘等: "基于FCM及HSV模型的方格蔟黄斑茧检测与剔除技术", 《农业机械学报》 *
孙卫红等: "基于椭圆重叠区域的蚕茧图像融合方法", 《纺织学报》 *
黄志鹏等: "基于机器学习的蚕茧疵点种类识别方法研究", 《中国优秀硕士学位论文全文数据库 (农业科技辑)》 *

Also Published As

Publication number Publication date
CN115311505B (en) 2022-12-27

Similar Documents

Publication Publication Date Title
Liu et al. A vision-based robust grape berry counting algorithm for fast calibration-free bunch weight estimation in the field
CN108230321A (en) Defect inspection method and device
Kaur et al. Evaluation of plum fruit maturity by image processing techniques
CN115018844B (en) Plastic film quality evaluation method based on artificial intelligence
CN108765433A (en) One kind is for carrying high-precision leafy area measurement method
Cointault et al. In‐field Triticum aestivum ear counting using colour‐texture image analysis
WO2022247840A1 (en) Light source spectrum and multispectral reflectivity image acquisition methods and apparatuses, and electronic device
CN105320970A (en) Potato disease diagnostic device, diagnostic system and diagnostic method
CN110782440A (en) Crop grain character measuring method
CN116246174B (en) Sweet potato variety identification method based on image processing
WO2019210707A1 (en) Image sharpness evaluation method, device and electronic device
CN111310571B (en) Hyperspectral image classification method and device based on spatial-spectral-dimensional filtering
CN114037835B (en) Grain quality estimation method, device, equipment and storage medium
Sari et al. Automatic food leftover estimation in tray box using image segmentation
CN112819017B (en) High-precision color cast image identification method based on histogram
CN115311505B (en) Silkworm cocoon classification method and purchase system based on cloud service big data platform
CN107392948B (en) Image registration method of amplitude-division real-time polarization imaging system
CN106898010A (en) Particle copies the method and device planted
CN114882042B (en) Internet of things transmission method based on image quality evaluation
CN111369531A (en) Image definition grading method, equipment and storage device
CN113340816B (en) Light source spectrum and multispectral reflectivity image acquisition method and device and electronic equipment
CN114638958A (en) Multi-feature fusion ternary positive electrode material roughness extraction method and device
CN111476253B (en) Clothing image classification method, device and equipment and image classification method and device
CN105389775A (en) Image group registration method combined with image gray feature and structured representation
CN116542973B (en) Image understanding-based precise grading method and device for leather mange defects

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