CPC G06T 7/0004 (2013.01) [G06T 5/70 (2024.01); G06T 7/11 (2017.01); G06V 20/68 (2022.01); G06T 2207/10024 (2013.01); G06T 2207/30128 (2013.01)] | 12 Claims |
1. A processor implemented method for grain grading analysis, the method comprising:
preprocessing an image, by one or more hardware processors, received for the grain grading analysis for a grain type, to enhance image quality, wherein the image comprises a sample element mixture comprising a plurality of elements and a reference object, and wherein the preprocessing comprises iterating the image through an image enhancement process till the image satisfies a quality criteria;
processing the preprocessed image, by the one or more hardware processors, by performing resizing, denoising, and Gaussian blurring to obtain a processed image;
determining, by the one or more hardware processors, a plurality of morphological features of the plurality of elements in the processed image by:
a) performing background elimination using image segmentation and inpainting operation, followed by contour detection on the processed image to obtain a contour plot of each of the plurality of elements and the reference object in the processed image;
b) determining i) a calibration factor in terms of pixel per metric for a length, a width and a height, and ii) an aspect ratio to predetermined weight mapping tables of a plurality of reference objects, a plurality of grain types and a plurality of varieties of the plurality of grain types; and
c) determining the plurality of morphological features of each of the plurality of elements using the contour plot and the calibration factor, wherein the morphological features comprise a perimeter, a width, a height, and an aspect ratio;
confirming, by the one or more hardware processors, whether the sample mixture is of the grain type by determining whether at least a predefined number of elements among the plurality of elements belong to the grain type, wherein the grain type is identified by binning each of the plurality of elements in accordance with the element aspect ratio into a plurality of bins and checking whether one or more elements associated with a bin, among the plurality of bins, satisfy a kernel aspect ratio range predefined for the grain type;
differentiating, by the one or more hardware processors, the plurality of elements, post confirming the sample element mixture is of the grain type, wherein the differentiation is based on a lower threshold and an upper threshold of an Inter Quartile Range (IQR) of a perimeter metric corresponding to the perimeter of each of the plurality of elements to segregate the plurality of elements as:
a) a first set of elements having lower size impurity in the sample element mixture,
b) a second set of elements having a target grain perimeter range identified for the grain type, and
c) a third set of elements having a higher size impurity; and
performing, by the one or more hardware processors:
a) identification of a variety of the grain type, from among the plurality of varieties by binning the second set of elements into a plurality of bins based on the aspect ratio, wherein the aspect ratio associated with a max bin among the plurality of bins that has maximum number of elements from the second set of elements indicates the variety of the grain type being graded in accordance with a predefined aspect ratio to variety mapping; and
b) calculation of a total adulteration percentage for the variety based on number of elements in the max bin and number of elements in the first set of elements and the second set of elements.
|