Paper Title (use style: paper title) - ER Publications



SAMOE: Simple and Accurate Method for Object Extraction

Arun Kumar R, Vijay S Rajpurohit

CSE Department, Gogte Institute of Technology

Affiliated to Visvesvaraya Technological University

Belgaum, India

kumararun37@ , vijaysr2k@

Abstract— Object Recognition and Extraction from an image treasures a crucial role in every image processing application. Whenever an image is captured for processing, there will be many unwanted objects along with the object of interest. Therefore it is a principal task to eliminate such objects so that we can obtain only the object of interest. In the present work a method for Object Extraction has been proposed. The method is simple because it is based on the technique of Color Separation in HSV plain. The implementation is carried out using Open Source Computer Vision (OpenCV) version 2.4.6. The method is applied for the domain of Precision Agriculture, particularly as a major preprocessing step in the post-harvest processing of fruits. Experiments are conducted for the images of variety of fruits captured under different lighting conditions. The results obtained are accurate and illustrates that the proposed methodology can be easily extended to other domains and application areas of Digital Image Processing.

Keywords— Image Morphology, Thresholding, Color Separation, Object Extraction.

Introduction (Heading 1)

Digital Image Processing (DIP) is a form of signal processing for which the input is an image, such as a photograph or video frame; the output of image processing may be either an image or, a set of characteristics or parameters related to the image. Digital image processing is the use of computer algorithms to perform image processing on digital images [5]. As subcategory or field of digital signal processing, digital image processing has many advantages over analog image processing. It allows a much wider range of algorithms to be applied to the input data and can avoid problems such as the build-up of noise and signal distortion during processing. The general approach of image processing is shown in the Figure 1.

[pic]

Fig 1: General approach for image processing

Applications of DIP techniques have proved to be an efficient strategy in visual inspection. Optical techniques in studying characteristics of objects find a crucial role in various visual analysis tasks.

There are various problems that the agricultural industry experience. These include high losses in post-harvest, subjectivity, tediousness, inconsistency, labor requirements, availability etc. The greatest challenge before the industry is to ensure product quality. Studies have shown such problems can be overcome by incorporating image processing techniques in the process. The benefit of using ‘computerized process’ is its high level of precision. There are many agricultural processes in which decisions are made based on the appearance of the product. Numerous computerized tools, based on image-processing, have been developed to help farmers to monitor the proper growth of their crops.

Continued researches in image processing and pattern recognition fields are providing effective tools and techniques to build intelligent, reliable, flexible and effective systems that are capable of grading and sorting almost every agricultural produce.

Allied Applications of Computer vision in Fruits generally include sorting, grading, defect detection, finding the ripeness and alike. Automated characterization of fruits finds its place in large number of domains. To mention, some of them are Food processing industries, Pickle manufacturing units, Drug manufacturing units, Wine manufacturing units, Supermarkets/Food markets, Pharmaceutical industries, Cosmetic Industries etc.

The visual inspection, because of its practicability and simplicity, is the most frequent option in practice [5]. Therefore, intensive research is being conducted to automate visual inspection process using DIP. In all of such applications, it is natural that the image being captured consists of number of objects or the background along with the object of interest. Hence it required to extract only the object of interest and then perform further analysis. Therefore the first and foremost task in any image processing application is to extract the object of interest.

Hence the present paper discusses a novel approach for object extraction based on color separation method. This research article has been organized as follows: in section 2 a flow diagram of the proposed work has been outlined. Section 3 outlines the different hardware and software materials required. Section 4 elaborates on each of the processing step along with the results obtained in each step. Finally we conclude our paper.

RELATED WORK

Over the many years many techniques have been applied for object extraction. One of the techniques is to separate the channels in the image and applying a threshold. Usually it is task of separating Red, Green and Blue channels. This method has been adopted for tomatoes by Rokunuzzaman, M., & Jayasuriya, H. P. W. [6], Arefi et al. [8]. Edge-detection based techniques are also applied by many researchers like Lak, M. B et al., applied for apples [7], by Nur Badariah et al [16] applied for bananas. Thresholding method has been applied for cashew kernels by Narendra V G et. al [10], by Yousef Al Ohali applied for dates [17], by Xu Liming et al applied for strawberries [18]. Thresholding and morphological filling method employed by Devrim for Jonagold apples [9]. Segmentation based techniques applied for apples by Devrim Unaya et al [11], by Anderson Rochaa et al [12] for various fruits and vegetable classification. Background subtraction method applied for oil palm fruits by Z. May et al.[13], by M. Omid et al [14] for rainsins. Fuzzy C means clustering based method employed for bananas by Meysam Siyah Mansoory et al [15].

Methodology

The proposed methodology aims in developing a novel approach for object extraction. Figure 2 show the different stages involved in the proposed scheme for object extraction. The methodology is followed in following 8 steps: (1) Image acquisition (2) Resizing (3) Morphological opening. (4) Smoothing (5) Convert to HSV space (6) Thresholding (7) Morphological Dilation (8) Contour Drawing. Initially Images are captured using a digital camera. The captured images are then resized. In order to get rid of the noise, a morphological opening operation has been applied. Image is then smoothened using a Gaussian filter. At this stage, we have the image removed with noise. This image is then converted to HSV space. For the purpose of color based segmentation, HSV space is chosen. Because, HSV space can best handle the non-uniform lighting condition and is more intuitive to human vision [8]. Then a threshold operation is applied. Morphological dilation is then applied in order to melt together multiple components. Finally holes in the image are filled by finding and drawing contours.

Figure 2: Work flow for object extraction

Results and Discussions

1 Image Acquisition

In any image processing applications, the work always starts with image acquisition. After the image has been obtained, various methods of processing can be applied to the image to perform many different vision tasks required today. However, if the image has not been acquired satisfactorily then the intended tasks may not be achievable, even with the aid of some form of image enhancement.

2 Resize

The captured images are resized to a fixed resolution so as to utilize the storage capacity or to reduce the computational burden in the later processing. Table 1 shows the resizing parameters used in the present work. Figure 3 shows the Original image after resizing.

Parameters for Image Capturing

|PARAMETER |VALUE |

|SCALE OF RESIZE: |0.25 OF THE ORIGINAL |

|ALGORITHM USED: |BILINEAR INTERPOLATION |

[pic]

Figure 3: Original Image

4 Morphological opening

OpenCV provides a fast, convenient interface for doing morphological transformations on an image. The morphological transformations find applications in a wide variety of contexts such as removing noise, isolating individual elements, and joining disparate elements in an image.

In the present work, the original image being captured had bright spots because of the incident light. In order to eliminate such bright spots, we have to eliminate lone outliers that are higher than their neighbors. This can be achieved by applying a morphological opening operation on the resized image. The specifics of opening operation are shown in table II.

Parameters for Morphological Opening

|PARAMETER |VALUE |

|SIZE OF THE RECTANGLE HOLDING THE |COLUMNS:5, ROWS: 5 |

|STRUCTURING ELEMENT | |

|Anchor point |anchor_x=2, anchor_y=2 |

|Shape of the structuring element |Rectangular |

|Number of iterations |1 |

5 Image Smoothing

Smoothing, also called blurring, is a simple and frequently used image processing operation. There are many reasons for smoothing, but it is usually done to reduce noise or camera artifacts. In the present work Gaussian smoothing has been employed with width and height of the filter window being 3 and 3.

Gaussian filter is probably the most useful though not the fastest. Gaussian filtering is done by convolving each point in the input array with a Gaussian kernel and then summing to produce the output array. The OpenCV implementation of Gaussian smoothing also provides a higher performance optimization for several common kernels. 3-by-3, 5-by-5 and 7-by-7 with the “standard” sigma (i.e., 0.0) give better performance than other kernels.

6 Color Conversion

The color space of the image till the previous step is Red, Green and Blue (RGB) space. But the RGB color model is not well suited for describing colors in terms that are practical for human interpretation. This can be overcome by changing the color space. Hue Saturation and Value (HSV) color space has been chosen in the present work as it is an ideal tool for developing image processing algorithms based on color descriptions that are natural and intuitive. Hue is a color attribute that describes a pure color, Saturation gives a measure of the degree to which a pure color is diluted by white light, and Value decouples the intensity component from the color-carrying information (hue and saturation) in a color image [2]. Figure 4 shows the image after converting to HSV color space.

[pic]

Figure 4: HSV Color Converted Image

7 Image Thresholding

This step is perhaps the most important one as it contributes much in extracting the object. In the present application the requirement is to extract the red colored object. Therefore it is required to check if the pixels in an image fall within a particular specified range. That is, it is required to check whether every pixel lies within the range of lower bound and upper bound. These bounds for red color in OpenCV are shown in table III.

Parameters for Thresholding

|LOWER BOUND: |H=160 |

| |S=100 |

| |V=40 |

|Upper Bound: |H=180 |

| |S=256 |

| |V=256 |

The resultant image after thresholding will be an 8-bit image or binary image in which the pixels which lie within the range are colored white and others colored black. Figure 5 shows the result after thresholding.

[pic]

Figure 5: Thresholded image

8 Morphological Dilation

After thresholding, the image will be left with a large region broken apart into multiple components as a result of noise or shadow or such other effects. Hence it would be better if we can make all such components to melt together into one, which is effectively achieved by a morphological dilation operation.

In the present work the dilation operation has been applied with number of iterations being 3. Figure 6 shows the image after dilation.

[pic]

Figure 6: Image after dilation

9 Filling Holes

The next task is to fill the holes in the binary image. For this purpose, the well-known technique is to find contours and draw those contours with white color. The parameters for finding and drawing contours are given in tables IV and V.

Parameters for Finding Contours

|RETRIEVAL MODE : |CV_RETR_LIST |

| |Contours are found and connected to one |

| |another |

|Chain Approximation |CV_CHAIN_APPROX_SIMPLE |

|Method: |Compresses horizontal, vertical and diagonal |

| |segments, leaving only their ending points. |

Parameters for Finding Contours

|EXTERNAL COLOR : |WHITE |

|HOLE COLOR : |WHITE |

|MAX_LEVEL : |0 |

|THICKNESS : |1 |

Figure 7 shows the binary image after filling holes.

[pic]

Figure 7: Image after filling holes

10 Object Extraction

This is the final step of extracting the object of interest from the original image. The hole filled image from previous step serves as a mask image using which we can process each pixel of the original image as follows: if the pixel is white in the mask image, then only the corresponding pixel from the original image has to be copied into the destination image and finally display the destination image. Figure 8 shows the final output of the application where in the object of interest has been extracted.

[pic]

Figure 8: Object of interest being extracted

The different test samples considered are provided in the Annexure 1.

CONCLUSION

In the present paper a novel approach for Object Extraction has been proposed. The approach makes use of a Color Separation method. This approach finds a crucial role in every image processing application. In the present work Precision Agriculture has been considered as the application domain, in particular the post-harvest processing of fruits. The fruit images are captured using a digital camera. Images are then applied with various image preprocessing techniques. The proposed method is implemented in Open Source Computer Vision (OpenCV) version 2.4.6. The results are most satisfactory for all the fruit images under consideration. The success story is evident from the images 3 through 8 for apple as a sample image under consideration. The same method can be extended for other application domains such as medical imaging, industrial inspection, remote sensing etc.

References

[1] Nur Badariah Ahmad Mustafa, Syed Khaleel Ahmed, Zaipatimah Ali, Wong Bing Yit, Aidil Azwin Zainul Abidin, Zainul Abidin Md Sharrif, “Agricultural Produce Sorting and Grading using Support Vector Machines and Fuzzy Logic”, 2009 IEEE International Conference on Signal and Image Processing Applications.

[2] Rafael C.Gonzalez, Richard E.Woods, Steven L.Eddins, Digital Image Processing, Pearson Education, 3rd Edition, 2009

[3] C.C. Yang1, S.O. Prasher, J.-A. Landry, J. Perret1 And H.S. Ramaswamy , “Recognition Of Weeds With Image Processing And Their Use With Fuzzy Logic For Precision Farming”, Canadian Agricultural Engineering Vol. 42, No. 4

[4] Gary Bradski and Adrian Kaehler, Learning OpenCV, O’Reilly Media, 1st Edition, 2008.

[5] Yousef Al Ohali, “Computer Vision Based Date Fruit Grading System: Design And Implementation”, Journal of King Saud University – Computer and Information Sciences (2011) 23, 29–36

[6] Rokunuzzaman, M., & Jayasuriya, H. P. W. (2013). Development of a low cost machine vision system for sorting of tomatoes. Agricultural Engineering International: CIGR Journal, 15(1).

[7] Lak, M. B., Minaei, S., Amiriparian, J., & Beheshti, B. (2010). Apple fruits recognition under natural luminance using machine vision. Advance Journal of Food Science and Technology.

[8] Arefi, A., Motlagh, A. M., Mollazade, K., & Teimourlou, R. F. (2011). Recognition and localization of ripen tomato based on machine vision. Australian Journal of Crop Science, 5(10), 1144.

[9] Devrim, “A Quality Grading Approach For 'Jonagold' Apples”, Proceedings Of Sps (Ieee Benelux Signal Processing Symposium), 2004

[10] Narendra v.g. and hareesh k.s., “Cashew Kernels Classification Using Colour Features”, International Journal Of Machine Intelligence, ISSN: 0975–2927 & E-ISSN: 0975–9166, Volume 3, Issue 2,pp-52-57, 2011

[11] Devrim Unaya, BernardGosselinb, Olivier Kleynenc, VincentLeemansc, Marie-FranceDestainc, OlivierDebeir, “Automatic grading of Bi-colored apples by multispectral machine vision”, Computers and Electronics in Agriculture, (2010), doi:10.1016/pag.2010.11.006

[12] Anderson Rochaa, Daniel C. Hauaggeb, Jacques Wainera, Siome Goldenstein, “Automatic fruit and vegetable classification from images”, Computers and Electronics in Agriculture 70 (2010) 96–104

[13] Z. May, M. H. Amaran, “Automated Ripeness Assessment of Oil Palm Fruit Using RGB and Fuzzy Logic Technique”, Mathematical Methods and Techniques in Engineering and Environmental Science, ISBN: 978-1-61804-046-6

[14] M. Omid, M. Abbasgolipour, A. Keyhani and S.S. Mohtasebi, “Implementation of an Efficient Image Processing Algorithm for Grading Raisins”, International Journal of Signal and Image Processing (Vol.1-2010/Iss.1)

[15] Meysam Siyah Mansoory, Hamidreza Fardad, Reza Enteshari, Yaser Siah Mansouri, “Isolating Healthy Bananas from Unhealthy Ones Based on Feature Extraction and Clustering Method Using Neural Network”, Modern Applied Science Vol. 4, No. 11; November 2010

[16] Nur Badariah Ahmad Mustafa, Nurashikin Ahmad Fuad, Syed Khaleel Ahmed, Aidil Azwin Zainul Abidin, Zaipatimah Ali, Wong Bing Yit, and Zainul Abidin Md Sharrif, “Image Processing of an Agriculture Produce: Determination of Size and Ripeness of a Banana”, IEEE , 978-1-4244-2328-6/08/$25.00 © 2008

[17] Yousef Al Ohali, “Computer Vision Based Date Fruit Grading System: Design And Implementation”, Journal of King Saud University – Computer and Information Sciences (2011) 23, 29–36

[18] Xu Liming, Zhao Yanchao, “Automated Strawberry Grading System Based On Image Processing”, Computers and Electronics in Agriculture 71S (2010) S32–S39

ANNEXURE 1: Different Test Samples

|Fruit |Original Image |Object extracted imgage |

|Banana | |[pic] |

|Chikoo |[pic] |[pic] |

|Chilly |[pic] |[pic] |

|Orange |[pic] |[pic] |

|Pear |[pic] |[pic] |

|Sweet lime |[pic] |[pic] |

-----------------------

Image Acquisition

Finding and drawing contours is done to fill holes

Resize

Morphological Opening

Smoothing

Convert to HSV color space[pic]

Thresholding

Morphological Dilation

Contour Drawing

Object Extraction

Dilation will melt together multiple components

Smoothing is done with a Gaussian filter

Opening is done to get rid of noise

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download