{"title":"基于彩色滤光片和直方图的水果识别系统","authors":"B. Sugandi, Rahmi Mahdaliza","doi":"10.33096/ilkom.v13i2.822.140-147","DOIUrl":null,"url":null,"abstract":"Nowadays, many children and adults do not know the type or name of fruits, especially if the fruit is a rare one. In this paper, a system was developed that can recognize fruit names in real time using a camera as a visual sensor. The camera captured the image and processed using image processing. This paper proposed a method using HSL color filters, RGB histograms and shapes of fruit objects to detect and recognize fruits. The proposed method was divided into two processes, namely the training and testing processes. The training process was carried out to obtain a database of each fruit. The first process of training was object detection using an HSL color filter. The calculation of the RGB histogram was conducted on the HSL color filtered object. After that, the object's roundness was measured. Meanwhile, the testing process was done by looking for the similarity of the histogram data of the test object with the reference object by using the histogram distance equation. The similarity of the object was determined by the distance value of the histogram of the tested fruit with the referenced fruit. Similar objects would have histogram distances less than the threshold values. Tests were implemented in several types of fruit. The test results showed the system could recognize fruit names accurately. E-ISSN 2548-7779 ILKOM Jurnal Ilmiah Vol. 13, No. 2, August 2021, pp. 140-147 141 Sugandi & Mahdaliza (Fruit recognition system using color filters and histograms) presented in section 4. Conclusions and some suggestions for future improvement of the system were presented in section 5. Method In this article, an algorithm was developed to perform automatic and real time recognition of fruit names. The fruit image was detected using an HSL color filter. The detected fruit was calculated based on its RGB histogram and shape (roundness). The matching process was done by comparing the test image with the reference image. The complete steps of the algorithm procedure used in this article were described in Figure 1. A. Hue, Saturation and Luminance (HSL) Color Filters The HSL color filter was a color filter used to distinguish one part of an object's color from another. HSL color filters are widely used to distinguish objects, especially if the background conditions are changing due to the influence of light. Compared to the original Red, Green and Blue (RGB) colors, HSL colors are easier to use to distinguish one object from another [13] – [16]. The conversion of the original RGB color to HSL was formulated in equation (1) r = R 255 ; g = G 255 ; b = B 255 d = max( r, g, b) − min( r, g, b) L = max(R, G, B) +min(R, G, B) 2 (1)","PeriodicalId":33690,"journal":{"name":"Ilkom Jurnal Ilmiah","volume":" ","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2021-08-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Fruit recognition system using color filters and histograms\",\"authors\":\"B. Sugandi, Rahmi Mahdaliza\",\"doi\":\"10.33096/ilkom.v13i2.822.140-147\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Nowadays, many children and adults do not know the type or name of fruits, especially if the fruit is a rare one. In this paper, a system was developed that can recognize fruit names in real time using a camera as a visual sensor. The camera captured the image and processed using image processing. This paper proposed a method using HSL color filters, RGB histograms and shapes of fruit objects to detect and recognize fruits. The proposed method was divided into two processes, namely the training and testing processes. The training process was carried out to obtain a database of each fruit. The first process of training was object detection using an HSL color filter. The calculation of the RGB histogram was conducted on the HSL color filtered object. After that, the object's roundness was measured. Meanwhile, the testing process was done by looking for the similarity of the histogram data of the test object with the reference object by using the histogram distance equation. The similarity of the object was determined by the distance value of the histogram of the tested fruit with the referenced fruit. Similar objects would have histogram distances less than the threshold values. Tests were implemented in several types of fruit. The test results showed the system could recognize fruit names accurately. E-ISSN 2548-7779 ILKOM Jurnal Ilmiah Vol. 13, No. 2, August 2021, pp. 140-147 141 Sugandi & Mahdaliza (Fruit recognition system using color filters and histograms) presented in section 4. Conclusions and some suggestions for future improvement of the system were presented in section 5. Method In this article, an algorithm was developed to perform automatic and real time recognition of fruit names. The fruit image was detected using an HSL color filter. The detected fruit was calculated based on its RGB histogram and shape (roundness). The matching process was done by comparing the test image with the reference image. The complete steps of the algorithm procedure used in this article were described in Figure 1. A. Hue, Saturation and Luminance (HSL) Color Filters The HSL color filter was a color filter used to distinguish one part of an object's color from another. HSL color filters are widely used to distinguish objects, especially if the background conditions are changing due to the influence of light. Compared to the original Red, Green and Blue (RGB) colors, HSL colors are easier to use to distinguish one object from another [13] – [16]. The conversion of the original RGB color to HSL was formulated in equation (1) r = R 255 ; g = G 255 ; b = B 255 d = max( r, g, b) − min( r, g, b) L = max(R, G, B) +min(R, G, B) 2 (1)\",\"PeriodicalId\":33690,\"journal\":{\"name\":\"Ilkom Jurnal Ilmiah\",\"volume\":\" \",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2021-08-08\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Ilkom Jurnal Ilmiah\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.33096/ilkom.v13i2.822.140-147\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Ilkom Jurnal Ilmiah","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.33096/ilkom.v13i2.822.140-147","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Fruit recognition system using color filters and histograms
Nowadays, many children and adults do not know the type or name of fruits, especially if the fruit is a rare one. In this paper, a system was developed that can recognize fruit names in real time using a camera as a visual sensor. The camera captured the image and processed using image processing. This paper proposed a method using HSL color filters, RGB histograms and shapes of fruit objects to detect and recognize fruits. The proposed method was divided into two processes, namely the training and testing processes. The training process was carried out to obtain a database of each fruit. The first process of training was object detection using an HSL color filter. The calculation of the RGB histogram was conducted on the HSL color filtered object. After that, the object's roundness was measured. Meanwhile, the testing process was done by looking for the similarity of the histogram data of the test object with the reference object by using the histogram distance equation. The similarity of the object was determined by the distance value of the histogram of the tested fruit with the referenced fruit. Similar objects would have histogram distances less than the threshold values. Tests were implemented in several types of fruit. The test results showed the system could recognize fruit names accurately. E-ISSN 2548-7779 ILKOM Jurnal Ilmiah Vol. 13, No. 2, August 2021, pp. 140-147 141 Sugandi & Mahdaliza (Fruit recognition system using color filters and histograms) presented in section 4. Conclusions and some suggestions for future improvement of the system were presented in section 5. Method In this article, an algorithm was developed to perform automatic and real time recognition of fruit names. The fruit image was detected using an HSL color filter. The detected fruit was calculated based on its RGB histogram and shape (roundness). The matching process was done by comparing the test image with the reference image. The complete steps of the algorithm procedure used in this article were described in Figure 1. A. Hue, Saturation and Luminance (HSL) Color Filters The HSL color filter was a color filter used to distinguish one part of an object's color from another. HSL color filters are widely used to distinguish objects, especially if the background conditions are changing due to the influence of light. Compared to the original Red, Green and Blue (RGB) colors, HSL colors are easier to use to distinguish one object from another [13] – [16]. The conversion of the original RGB color to HSL was formulated in equation (1) r = R 255 ; g = G 255 ; b = B 255 d = max( r, g, b) − min( r, g, b) L = max(R, G, B) +min(R, G, B) 2 (1)