An Improvement Object Detection Method Findcontour with Fuzzy Logic for Detect Balinese Script Object

An Improvement Object Detection Method Findcontour with Fuzzy Logic for Detect Balinese Script Object . Aptisi Transactions on Technopreneurship (ATT), 4(3), 257–262. Abstract The function of OpenCV can be used as a method for detecting Balinese script objects . Experiments to detect Balinese script using this function are able to detect all objects that are on palm leaf media. Objects that have been detected are literal objects and non-literal objects. This study aims to improve the detection method with the findcontour function by adding a fuzzy algorithm, to separate Balinese script objects from non-Balinese characters. The data in this study were in the form of Balinese script written on palm leaves. The Balinese manuscripts used as data in the research are new manuscripts that were deliberately written for research purposes. Fuzzy logic in this study is used to determine objects that have been detected, including script objects or not. The results are visible from the detected objects, fuzzy logic is able to eliminate 400 - 5000 objects that are not needed. Meanwhile, in terms of time, the filtering process with fuzzy logic has an impact on the ROI process being faster with an average time of less than 1 second. An Improvement The final step of the Balinese script object detection process is the object filtering process using fuzzy logic. All objects that have been detected are then separated into Balinese script objects and non-Balinese characters (these objects are objects that are not used in Balinese script writing). The fuzzy filtering process uses two main parameters, the parameter area of the object and the parameter width of the object. The two parameters are then given a range of values. The range of area membership function values is not wide, medium and wide. Each membership function has a range of values, which is expressed as an area that is not wide in the range 0 – 300, the membership function is in the range 200-500, and wide is in the range of values above 450. The membership function area is shown in the membership function area image.


Introduction
Findcontour as a function developed by OpenCV is a function that can be used to detect an object. This function can be developed into a method for detecting Balinese script objects. This object is an object that is written on palm leaf media or called the Balinese lontar script. The object detection method using the findcontour function is able to detect all objects on the palm leaf. Those objects are Balinese script objects and dirt objects. The object of the Balinese script is the writing of the Balinese script that is carved on palm leaves, while the object of dirt can be a stain or part of the background image of the lontar.
The functional capabilities developed by OpenCV have good quality and function, this library is commonly used to detect objects such as in research [1], perform recognition as in the example in research [2], and is often used to develop IoT applications [3] [4]. This study focuses on detecting Balinese script objects using two functions from OpenCV. These functions are the findcontour function and the Region of Interest function. Fincontour is used to detect and mark objects.
After the detected object is marked by this function, then the ROI function is called to separate the objects that have been marked with the background.
In general, the findcontour function has solved the problem of object detection on palm leaves. However, a new problem arises, because this function is not able to distinguish between character objects and non-literal objects. Meanwhile, the main objective of this research is to detect Balinese script objects. Fuzzy logic can be used to improve object detection results. This logic was chosen because it has been tested and can be used to improve the main method, as in study A, the fuzzy method is able to improve the results of the main method.
This study uses data in the form of photos of palm leaves that have been engraved with Balinese characters. The success of this method is seen from the success and accuracy in detecting Balinese script. The expected result of this research is to minimize the occurrence of object detection errors and optimize the detection accuracy of Balinese script objects.

Data
The data sources used in this study were Balinese script written on a palm leaf. The data is regenerated for the purpose of research needs. Manuscripts are copied from image media to a papyrus media. The process of writing Balinese script on palm leaves is carried out between 2021 and 2022. The manuscript that has been copied into palm leaf media is then photographed, the size of the photo is adjusted for the data input needs of the object detection application developed in this study.

Fuzzy Algorithm Fuzzy
Logic is used to assist the detection of Balinese script objects by the fincontour function. This function is able to detect objects engraved on palm leaves, but cannot distinguish Balinese script objects and non-Balinese characters well [5]. Several studies have shown that fuzzy improves accuracy [6], other studies explain that fuzzy models can improve the accuracy and efficiency of diagnosis [7]. Meanwhile, research [8] explains that fuzzy has high accuracy and has an effective performance for classification algorithms. Based on the advantages of fuzzy logic, this logic is often used to help the main method so as to get more optimal results. This general logic is included to assist the main methods in the classification process [9], detection process [10], and making predictions [11]. Fuzzy logic is used to distinguish objects detected by the findcontour() function. All objects that have been successfully detected have the parameters of area, width and height. This result parameter will be used as a parameter in the process of classifying literal objects or non-literal objects.

The Findcontour
Library openCV function can be used for various purposes, one of which is to detect objects. Several forms of implementing this library for detection [12] [13] [14], with the result that the opencv library is very helpful in the object detection process. The function that can be used to detect objects is the findcontour(). This function forms a connected curve from one point to another, which is connected along the edge.
The findcontour function is also used in the movement tracking process [15] [16], the movement tracking process becomes more predictable, reliable, precise, and accurate. In addition to this process, the findcontour function is also widely used to carry out the recognition process [17]. The findcontour() function is used to detect objects that appear on palm leaves. Before carrying out the detection process, the image source is first transformed into grayscale with a predetermined threshold.  Figure 1 Detection of Balinese script objects using fuzzy logic and the findcontour() function. The stages to detect objects are image processing, object detection with the findcontour function, and the last step is the process of filtering objects that have been detected with fuzzy logic. The first step is image processing by doing a threshold on the input image, image enhancement is also carried out in this process to improve image quality. The next stage is object detection, this step detects all objects on palm leaves such as Balinese script objects and non-Balinese script objects (objects of this type are dirty objects sourced from palm leaves or the process of writing manuscripts). The results of the object detection process are shown in the image below. The final step of the Balinese script object detection process is the object filtering process using fuzzy logic. All objects that have been detected are then separated into Balinese script objects and non-Balinese characters (these objects are objects that are not used in Balinese script writing). The fuzzy filtering process uses two main parameters, the parameter area of the object and the parameter width of the object. The two parameters are then given a range of values. The range of area membership function values is not wide, medium and wide. Each membership function has a range of values, which is expressed as an area that is not wide in the range 0 -300, the membership function is in the range 200-500, and wide is in the range of values above 450. The membership function area is shown in the membership function area image.
(a) Membership function Area (a) Membership function width Figure 3.

(a) and (b) Membership function object detection balinese script
The defuzzification process uses the Mamdani model by applying the centroid method. The difference is clearly visible from the results that arise from the object detection process. Figure 1 shows the results of the object detection process using only the findcontour function. The test was carried out using ten different lontar manuscript images. Six lontars are lontars that are written using a new lontar media. The writing is done using a pencil and a knife to carve. The other four lontars use old lontars which are directly carved with a knife without writing a pencil before the process of engraving the characters on palm leaves. The results of the process can be seen in the test table below. The results of the test can be seen that Image-1 to Image-6 produces a large number of objects, while Image-7 to Image-10 produces a large number of objects. fewer objects. Based on the comparison of these results, the writing process has a significant influence on the results of object detection. From the detection time, it can be seen that the time for the filtering process using fuzzy is in the range of values from 0.8 to 1.62 seconds, this time is strongly influenced by the object detection process using the findcontour function. Different results are seen in the ROI process, the time used for the ROI process on objects that have been processed by filtering with fuzzy logic is much faster than the findcontour object detection process.

Conclusion
The object filtering process using fuzzy logic has a significant impact on the detection process for Balinese script objects. Based on the results of the research conducted, the addition of fuzzy logic in the object detection process has an effect on more specific results, by eliminating many objects that are not needed. The filtering process with fuzzy logic does not only clarify the results of the object detection process, but this process can also save time in the process of separating the detected object from the background. From the research that has been done to accurately detect Balinese script objects, it is important to pay attention to the input data, most of the detected non-literal objects come from script writing techniques on palm leaf media. The technique of engraving directly on palm leaves, without being preceded by writing using a pencil, has better results in the process of detecting findcontour objects.