ISSN: 2350-0328
International Journal of Advanced Research in Science,
Engineering and Technology
Vol. 3, Issue 5 , May 2016
Implementation of Grain sorting algorithm by
using Raspberry PI
Ms. Shraddha N. Ranaware, Prof .Dr. K. N. Barbole
PG student, (Electronics & Telecommunications), TSSM’S PVPIT, Bavdhan, Savitribai Phule Pune University, Pune
Principal, (Electronics & Telecommunications) ), TSSM’S PVPIT, Bavdhan, Savitribai Phule Pune University, Pune
ABSTRACT: If we see the economy of India, everyone come to know that more than 40% population income depend
on the agriculture. Some people is producing the agricultural product, others are buying that stuff and export that to
another country or state where demand for that product is good or sell that to the local market as per the product value
and quality. We can conclude that from the above mention paragraph product value of the agricultural product depends
on its quality and value, if the quality of product increases then value also increases so quality become dominant factor
in the agricultural production, now a day, there is no system that can capable of giving maximum quality output in less
production time and cost. there is system that measure the quality of product as the testing is done by human, so it is
not reliable at the all-time of its working hour because of the human limits. so we have developed the proposed system
that can capable of giving the more reliable and efficient output of production for quality testing of agricultural
products. This can work efficiently in his working hour without deflecting its efficiency. For the testing purpose we
have selected the rice as the testing product and testing parameter are the whiteness, size, physical defect and color
defect.
KEYWORDS:Raspberry PI, Image Processing, Matplotlib, Segmentation, Blob analysis
I.INTRODUCTION
A. Motivation
The agriculture in the country like India is vast there is grain are produce like rice, Bajara, Sugar, etc. so we have
to control their quality for the packaging section in according to their size, color, weight. So for that we have developed
the embedded solution with the help of image processing. Here we can estimate their quality using the simultaneously
taking frame and applying the image processing algorithm for that frame and get result as the quality of the grains.
However, we can implement the same process for the all type of the grain only considering parameter are going to
change so we can have the mode selection for the different type the grain. We can have the better result than the
ordinary human eye. This work is going to be Product implement for the different packaging industries or quality
testing department for the market Yard. Grain quality evaluation is done manually but it is relative, time consuming,
may be varying results and costly. To overcome these limitations and shortcoming image processing techniques is the
alternative solution can be used for grain quality analysis.
B. Objectives
In our project, we are going to research on the future requirement of the agricultural product quality of the grain for
different purposes like export and quality assurance and as raw material of agricultural goods. Proposed system is
designed to show all related aspect of the quality testing of the rice with respect to its size, whiteness, defect in physical
and color. Show the graph of all parameter which mention earlier.
Copyright to IJARSET www.ijarset.com 2110
ISSN: 2350-0328
International Journal of Advanced Research in Science,
Engineering and Technology
Vol. 3, Issue 5 , May 2016
II. PROPOSED METHODOLOGY
A.System Initialization:
At this step, the entire component will be start. System will check the entire component for its status. If any
component fails, then system correct that error or notify the user about component failure. If there is no such failure,
then system goes online and starts working. Operation like following takes place in this stage Conveyor start running in
forward motion. GUI application on monitor will display. Camera takes the number of snapshot per second and send it
to system. Sorting Mechanism at the initial Position.
B.Capture Frame:
At this stage Camera Takes the Snapshot of the Conveyor with the Grains which moving with the Conveyor.
Camera takes the Snapshot and transmit it to the System to process using Raspberry with OpenCV Software.
Then OpenCV package based Python scripting changes the image to matrix using simple commands and function.
Fig1.Operation GUI Of proposed project
C.Perform Preprocessing:
Image we got from the last stage does not have that many details in the captured frame so we have to perform
preprocessing operation on the captured frame so that we get some details about the grains. At this stage we perform
following operation on the captured frame, to get detail output like Contrast Stretching, Segmentation, Detect Grains:
After preprocessing detail in the frame enhance to the greater extent, no we have to find out if how many grains are
detected on frame. For that purpose, we use the High Pass Filtering Method. It is technique to find out there is grains in
the frame or not.
Fig2.Sample Fame Provided to camera
Copyright to IJARSET www.ijarset.com 2111
ISSN: 2350-0328
International Journal of Advanced Research in Science,
Engineering and Technology
Vol. 3, Issue 5 , May 2016
After the grains detection:
After previous stage if there is no sign of Grains detection then camera initialize itself for new frame take the new
snapshot from the Model Environment, If We get the sign of Grains detection then we proceed to next Stage of finding
estimation of sampled Grain Frame.
D.Perform Display analysis:
After getting the Result of detected grain we have display information about which grain quality measurement,
then this interrupt should be generated through this swapping Card, so that we get maximum output efficiency from the
proposed system. E.g. Suppose frame Has 100 grains on the conveyor then GUI of result should be graph of mean
value and the sample data from frame of the Display. And then output of the OS as the GUI of Menu system will be
Displayed on the LCD Monitor.
Fig3.Detected blob in Sample image
E,Sorting:
Initialize Sorting Mechanism using the Raspberry PI. after executing interrupt service routine program as per the
grain Sort System should give the satisfied output at the Sorting Section and So that the interaction of USER should be
real time or say fast. It gives the highest interacting System using above proposed Methodology.
After above process once again camera takes the image and the algorithm also start once again to sort the rice grain
to specified range of bucket like small grain bucket, good grain bucket, average grain bucket and defected grain bucket.
Fig4.Part of sorting assembly of proposed system
Copyright to IJARSET www.ijarset.com 2112
ISSN: 2350-0328
International Journal of Advanced Research in Science,
Engineering and Technology
Vol. 3, Issue 5 , May 2016
III. SYSTEM DESIGN
Here going to see about various type of methods of system architectures and Algorithm to achieve this project’s
specification. we are going to discuss proposed system architecture it’s Benefit and Algorithm for grain sort
implementation
A. Algorithm
1. Start
2. Initialize the System on PI system.
3. Start the Conversion and Convertor.
4. Take the Snapshot of the Conveyor
5. Receive the Image to memory
6. Perform Image Preprocessing
7. Perform Thresholding
8. Perform Blob Analysis
9. Show Graph On the Monitor
10. Find the Category of Grain
11. Show the result
12. Update the Graph Screen
13. Actuate the Mechanism according to Result
14. If Filler empty then stop
15. Or go to the Step to 3
B. Flowchart
Copyright to IJARSET www.ijarset.com 2113
ISSN: 2350-0328
International Journal of Advanced Research in Science,
Engineering and Technology
Vol. 3, Issue 5 , May 2016
C. Block Diagram
The following diagram shows the block diagram of Raspberry PI Based Grain quality check with sorting
mechanism Using Open CV.
Fig5.Block Diagram of proposed system
The above block diagram shows how this sorting system works and how data and interrupt controls passes though
system.
D. Block Diagram Description
Hardware Description
A conveyor belt:
Conveyor belt is mainly a carrying medium of a belt conveyor system (Abbreviated as belt conveyor). A belt conveyor
system is one of many types of conveyor systems. A belt conveyor system comes with two or more pulleys (which can
be called as drums).
Raspberry PI 3:
Raspberry Pi is mainly a credit-card sized computer which is manufactured and also designed in the United Kingdom
by the Raspberry Pi foundation with the focus of teaching basic computer science to school students and every person
interested in computer hardware, programming and Do-it Yourself projects.
The Raspberry Pi as basic computer system has a Broadcom BCM 2835 system on a chip (SoC), with an ARM 1176
JZF-S 700MHz processor, a Video Core IV GPU and it was originally shipped with 512 megabytes of RAM, later
upgraded (Model B) to 1GB.
PI Camera:
Camera act as input sensor which takes continuous input from the physical world. It takes the number of snapshot per
second and transfer image data toward image processing section
Copyright to IJARSET www.ijarset.com 2114
ISSN: 2350-0328
International Journal of Advanced Research in Science,
Engineering and Technology
Vol. 3, Issue 5 , May 2016
Processing Description
OpenCV Package:
This software act as environment to implement the image processing algorithm in very simple manner. It supports
many image formats and also support real-time image processing in this environment. It has many inbuilt function
which helps in reduction in programming difficulties and program length.
Image Processing Algorithm:
This block consists of different type algorithmic function to detect the Grain Size, Shape, Color, Defect in in
continuous frame. Good algorithm gives the effective program runs and reduction in program length
GUI Update window:
After detecting update in the grain estimation after each frame result Raspberry PI update the whole GUI window
with respect to the System estimation.
Interrupts:
After detecting which grade is selected the whole mechanical structure motor is controlled through the GPIO pin.
In which case it has the 40 pin GPIO Connections to control the Real Physical Motor Attached to the sorting system.
IV.CONCLUSION
In this way, we are developing a system model for grain condition monitoring and controlling w based on 3
parameters size, defects, chalkiness by using Raspberry Pi development board and Python platform using OpenCV
image processing package. For better quality analysis of grains more parameters are to be considered. The product
provides a greener proper alternative to small businesses. This small credit card sized product makes it easy to recycle.
The Raspberry Pi is perfect for adaptive technology. The grain quality management system can be used in different
places in export quality checking of grains, Used in automation industries, For food grain storage systems.
V.ACKNOWLEDGEMENT
The author expresses their gratitude to Mr. A.A. Kanse the owner of Bitronix Rice and Pulse Mill, Pune for
the system model as per the requirements desired by our image processing group. We also thankful to Mr. S. I.
Nipanikar, Mrs. V. M. Joshi for their valuable guidance and advice.
REFERENCES
[1] 2015 International Conference on Smart Technologies and Management for Computing Communication, Controls, Energy and Materials
(ICSTM), Evaluation of Chalkiness in Basmati Rice by Virtual Instrumentation by: Jyoti D. Bambole and Prof. K.A. Ghodind
[2] Y. N. Wan, C. M. Lin and J. F. Chiou, “Rice Quality Classification using an automatic grain quality inspection system,” Trans. ASAE, 2002, vol.
45, no. 2
[3] IEEE 2014 “Intelligent system for monitoring and controlling of the Grain condition based on ARM9” Qidi Zhao, Yanju Liu*, Yang Yu, Jianhui
Song, Guang Zhou School of Information Science and Engineering, Shenyang Ligong University, Shenyang
[4] Maier, Channaiah, Martinez-Kawas, et al, “Monitoring carbon dioxide concentration for early detection of spoilage in stored grain”, Department
of Grain Science and Industry, Manhattan, Kansas,2010: 425-332
Copyright to IJARSET www.ijarset.com 2115