The method for sorting and system of fruit classification and color and luster based on ARM
Technical field
The present invention relates to image procossing identification technology fields, and in particular to a kind of fruit classification and color and luster based on ARM
Method for sorting and system.
Background technology
For a long time, the postharvest treatment of fruit also rests on the stage of manual sorting, by a large amount of manpower to fruit
Classification, color and luster carry out human hand classification.Manual sorting not only consumes a large amount of manpower and time, but also (people is regarded by subjective impact
Feel the factors such as deviation, subjective understanding), it may appear that the case where sorting malfunctions.
With the development of machine learning techniques, machine learning also begins to use in fruit sorting field, but engineering
Habit has the following deficiencies:1. needing to preset target signature, different features can have recognition result prodigious contrast.Therefore
Developer needs with priori correlated characteristic;2. the discrimination of machine learning is not high, when aberration occurs in image, blocks
Situation discrimination can be lower.
Therefore, it is above urgently to propose that a kind of method for sorting of the fruit classification and color and luster being based on ARM improves at present
Situation.
Invention content
The purpose of the present invention is to solve drawbacks described above in the prior art, provide a kind of fruit classification based on ARM
With the method for sorting and system of color and luster.
According to disclosed embodiment, the first aspect of the present invention discloses a kind of fruit classification based on ARM and color and luster
Method for sorting, the method for sorting include the following steps:
S1, Image Acquisition is carried out to various fruits by camera module in the embedded device of ARM frameworks;
S2, all pictures are subjected to a subseries by the type of fruit, then, the fruit of same type are pressed to the color of fruit
Pool carries out secondary classification;
S3, deep learning frame is built on PC, classification picture and color and luster picture are trained respectively by PC, respectively
Type identification model and the storage of color and luster disaggregated model are obtained to SD card memory module in embedded device;
S4, fruit sorting is carried out using the embedded device of ARM frameworks, Image Acquisition, needle is carried out by camera module
To collected picture, usage type identification model positions the type of the position and identification fruit of fruit, then using color and luster point
Class model carries out color and luster classification to each fruit, obtains inspection result.
S5, manipulation manipulator sorts fruit automatically according to testing result.
Further, the method for sorting further includes the following steps:
S6, testing result is shown or is sent to the ends PC by LCD display module in embedded device.
Further, the step S4 includes:
S41, type identification model export the coordinate position of fruit and the type of fruit simultaneously by full convolutional network.Coordinate
It is erected and is sat by upper left corner abscissa, upper left corner ordinate, lower right corner abscissa, the lower right corner according to the position of pixel in picture in position
Mark is constituted;
S42, color and luster disaggregated model carry out color and luster classification by convolutional network to the fruit detected.
Further, the color and luster of the fruit includes following message:It is bright, dim and/or have immaculate.
Further, the type identification model passes sequentially through convolutional layer, pond layer, full articulamentum to image slices vegetarian refreshments
Recombinated, sampled and then be calculated the coordinate of target and the probability value of classification.
Further, after the type identification model is calculated by multiple convolutional layers, while multigroup coordinate and class being obtained
Not, it is then set by the threshold value of probability value to export prediction coordinate and classification.
Further, the color and luster disaggregated model passes sequentially through convolutional layer, pond layer, full articulamentum to image slices vegetarian refreshments
Recombinated, sampled and then be calculated the color and luster of fruit.
Further, the quantity of target fruit is unlimited in every pictures.
According to disclosed embodiment, the second aspect of the present invention discloses a kind of fruit classification based on ARM and color and luster
Sorting system, the sorting system include:For transmit the fruit transmission device of fruit, the manipulator for sorting fruit,
And the embedded device based on ARM frameworks for carrying out type identification and color and luster classification to fruit,
The embedded device includes camera module, SD card memory module, LCD display module, wherein described takes the photograph
Picture head module is arranged right over fruit transmission device, for shooting the fruit image on fruit transmission device;Described
Embedded device is connected with external PC, deep learning frame is built on PC, by PC respectively to classification picture and color and luster picture
It is trained, respectively obtains type identification model file and color and luster disaggregated model file;The SD card memory module is for depositing
Store up type identification model file and color and luster disaggregated model file;The LCD display module is used to show the testing result of fruit;
The manipulator is described to being located at according to the fruit testing result of the embedded device based on ARM frameworks
Fruit transmission device sorted.
The present invention has the following advantages and effects with respect to the prior art:
The present invention proposes the method with deep learning, acquires target image by camera, then uses the side of deep learning
Method detects and identifies the type of several targets (such as apple, banana, orange) in image, and then to the fruit root of same type
Classified according to color and luster, sorted.Deep learning not only saves manpower and time, and the accuracy sorted can be far above machine
Study.
Description of the drawings
Fig. 1 is the model training flow chart of the method for the present invention;
Fig. 2 is the sorting flow chart of the method for the present invention;
Fig. 3 is the schematic diagram of the class models one of fruit type identification in the present invention;
Fig. 4 is the schematic diagram of the class models two of fruit type identification in the present invention;
Fig. 5 is the schematic diagram for the color and luster disaggregated model that fruit color and luster is classified in the present invention;
Fig. 6 is the implementation figure of the method for sorting of fruit classification and color and luster disclosed by the invention based on ARM.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Embodiment
The specific implementation and operating process of the present invention is discussed in detail by 1~Fig. 6 of attached drawing for the present embodiment.
First, the embedded device of ARM frameworks is developed.The embedded device need to include camera module, SD card storage mould
The modules such as block, LCD display module.
Secondly, Image Acquisition is carried out to various fruits using the embedded device of the ARM frameworks.Each fruit is both needed to
Plurality of pictures, quantity do not set the upper limit, and dimension of picture needs consistent.All pictures by fruit type (such as apple, banana,
Orange etc., class number is unlimited) carry out a subseries.Then, the fruit of same type by fruit color and luster (such as it is bright, dim,
Spottiness etc., class number is unlimited) carry out secondary classification.
Then, deep learning frame is built on PC, and classification picture and color and luster picture are trained respectively by PC, point
Type identification model file and color and luster disaggregated model file are not obtained.
Then, the SD card for the type identification model and color and luster disaggregated model that training obtains being stored in embedded device stores
Module, and the frame of deep learning and identification classification code are transplanted on embedded device.
Fruit sorting is carried out using the embedded device of ARM frameworks.Carry out Image Acquisition makes for collected picture
The type that the position and identification fruit of fruit are positioned with full convolutional network, then uses convolutional network to carry out color and luster to each fruit
Classification.
Finally, testing result is shown or is sent to the ends PC, and root by LCD display module in embedded device
Manipulate manipulator sorting fruit automatically according to testing result.
The model of the method for sorting of as shown in FIG. 1, FIG. 1 is disclosed by the invention fruit classification and color and luster based on ARM is instructed
Practice the preparation stage:
1, the embedded device of ARM frameworks is placed on right over fruit transmission device, the camera on embedded device
Module face fruit transmission device.During transmission belt travels at the uniform speed, embedded device is with the speed acquisition figure of 1 frame per second
Picture.The image collected is stored in the SD card memory module of embedded device.The image collected is with jpg or bmp
Form preserve, in order to ensure that the accuracy rate that identifies in successive depths study, training dataset ensure that picture number is expired as far as possible
Foot requires, and therefore, each fruit, each color and luster all preserve several images, and quantity is The more the better.
2, prepare a PC of the configuration with Gpu video cards, deep learning Open Framework is built on PC.
3, the collected picture of step 1 is stored on PC.(target herein refers exclusively to water to target in the every pictures of record
It is fruit, unlimited per the quantity of target in pictures) the pixel position (upper left corner abscissa, upper left corner ordinate, the lower right corner that occur
Abscissa, lower right corner ordinate), and mark the fruit type (such as apple, banana, orange etc.) and color and luster (such as it is bright,
Dimness, spottiness etc.).
4, by PC, fruit type and fruit color and luster is trained respectively using convolutional network, obtain type identification mould
Type and color and luster disaggregated model.The two models are saved on the SD of ARM.Fig. 3 and Fig. 4 is the type identification mould that the present invention uses
The function of classification of type can be all implemented separately in type, the two.Fig. 5 is the color and luster disaggregated model that the present invention uses.Fig. 3 passes through convolution
Layer, pond layer, full articulamentum are recombinated, sampled and then are calculated the coordinate of target and the probability of classification to image pixel point
Value.Fig. 4 is calculated by multiple convolutional layers while being obtained multigroup coordinate and classification, is then set by the threshold value of probability value to export
Predict coordinate and classification.Fig. 5 mainly recombinates image pixel point by convolutional layer, pond layer, full articulamentum, is sampled then
The color and luster of fruit is calculated.
5, deep learning frame is built on the embedded device of ARM frameworks, is write, is compiled target detection and picture classification
Code.
As shown in Fig. 2, Fig. 2 is the sorting rank of the method for sorting of fruit classification and color and luster disclosed by the invention based on ARM
Section:
1, the embedded device of ARM frameworks is placed on right over fruit transmission device, by the embedded device of ARM frameworks
On camera module face fruit transmission device.During transmission belt travels at the uniform speed, camera is adopted with the speed of 1 frame per second
Collect image.
2, using convolutional network and type identification model inspection and the fruit occurred in image is identified, it then again will identification
To several fruit carry out color and luster classification again using convolutional network and color and luster disaggregated model.
3, it according to recognition result, sends instructions to manipulator and carries out sort operation.
4, by current picture and recognition result include embedded device LCD display module or be sent on PC.
As shown in fig. 6, Fig. 6 discloses the sorting system of fruit classification and color and luster based on ARM in the present invention, the sorting system
The method for sorting based on fruit classification and color and luster disclosed above based on ARM of uniting realizes fruit sorting, specifically includes:For passing
Send the fruit transmission device of fruit, the manipulator for sorting fruit and for carrying out type identification and color and luster point to fruit
The embedded device based on ARM frameworks of class.
Wherein, the embedded device based on ARM frameworks includes camera module, SD card memory module, LCD display module,
Wherein, the camera module is arranged right over fruit transmission device, for shooting the water on fruit transmission device
Fruit image;The embedded device is connected with external PC, deep learning frame is built on PC, by PC respectively to classification figure
Piece and color and luster picture are trained, and respectively obtain type identification model file and color and luster disaggregated model file;The SD card is deposited
It stores up module and is used for storage class identification model file and color and luster disaggregated model file;The LCD display module is for showing water
The testing result of fruit.
Wherein, manipulator is controlled by the embedded device based on ARM frameworks, according to the fruit testing result of embedded device
To being sorted positioned at the fruit transmission device.
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodiment
Limitation, it is other it is any without departing from the spirit and principles of the present invention made by changes, modifications, substitutions, combinations, simplifications,
Equivalent substitute mode is should be, is included within the scope of the present invention.