Tobacco Farming Mapping To Determine The Number Of Plants Using Contour Detection Method

Indonesia’s climate has suitable for tobacco growth. tobacco plants can live in drylands. Tobacco is planted optimum with a size of 100cm x 70cm. The right size is used to count the amount of tobacco that will be planted according to the area of the land. Technology developed to help the farmer to monitor their crops and yields, by using image processing. Farmers can count easily without having to go to the field to calculate manually. In our research, image processing is used combined with knowledge base data. Images taken using drones, then be processed using image processing using the contour detection method to count the number of a tobacco plant. The results of 80 times system testing, which is using 4 parameters, 20 samples for each parameter. The success rate of the first test was 86.597% with a 13.402% error rate. The second test’s success rate is 87.63% with a 12.306% error rate. of the third test obtained an 87.033% success rate and an error rate of 12.966%. The fourth test results from an 85.431% success rate and 14.56% error rate.


Introduction
As a tropical plant, however, the area of tobacco cultivation is quite wide, they can grow in hot climates such as Indonesia or cold climates. [1]. Tobacco's plant does not require much water, so they can grow in the dry season. Tobacco is planted optimum with a size of 100cm x 70cm. [1] The right size is used to count the amount of tobacco that will be planted according to the area of the land. By using drone technology, calculations can also be made automatically when tobacco is embedded. The image from the drone then is processed by the image processing method using the contour detection method. [2] In our research, image processing is used combined with knowledge base data. Images taken using drones, then be processed using image processing using the contour detection method to count the number of a tobacco plant. By image processing results number of plants planted by farmers on the land can be seen. The input from the system is an RGB image then be converted into an HSV image that becomes the system input [2], [3], [4]. After that, the image is processed using the contour detection method to determine the number of plants. The output of the system is the number of plants that have been detected. [5], [6] * Corresponding author : diana.rahmawati@trunojoyo.ac.id

Method
Precision agriculture in [4] and [5] was carried out by incorporating elements of information technology and mechanization in the plantation sector. Analysis of the relationship between visible and infrared drone sensors with oil palm plants can be done by shooting at oil palm blocks using drones with visible and infrared sensors. For shooting using a drone by creating a flight path using mission planner software with an aircraft height ranging from 300-350 meters above sea level. Furthermore, the image mosaic process is used, in the form of combining several photos so that they become a single unit. The merging of these photos is a rectification of drone photos, composites of original color 321 and infrared 432. To monitor oil palm health, this system uses two drone analyzes, namely visual analysis, and digital NDVI analysis. [4] In [5] the results of the image or video are analyzed and processed using a PC with a computer vision algorithm in the counting process, utilizing computer vision techniques from palm tree data taken and reprocessed with edge detection techniques, so that the drone can indicate which trees are ordinary and which are. palm trees which are then combined with pattern recognition methods. The final process of this research is to put a marking on the drone in the form of a red circle and start counting the number and monitoring the palm oil. [5], [6]

Tobacco
Tobacco is one of the most popular plants in the world. Tobacco is a seasonal agricultural product that is not a food commodity, but a plantation commodity. This plant is consumed not for food but as raw material for cigarettes and cigars. Tobacco can also be chewed (Nginang) the term in Javanese. Tobacco is also useful as a pesticide and medicinal raw material because it is rich in secondary metabolites. Tobacco plants are strongly influenced by cultivation methods, planting locations, seasons/weather, and processing methods. The tobacco agroecosystem affects the quality of tobacco produced. In Indonesia, good tobacco is only produced in certain areas.

Pixel, Resolution, Intensity
Pixel (Picture Elements) is the value of each matrix on the bitmap where the value of the pixel length will affect the color to be displayed. If a bitmap in a digital image displays 256 colors, the pixel value will be limited from 0 to 255. And the quality of the bitmap will appear if it has the highest color from a bitmap that appears. It can be seen from the example in Figure 2 which gives an example of two bitmaps that can have different ways of handling the white to black transition. [4][9][7]

Fig. 2. Bitmap Colour
From the difference in Figure 2, it is explained that if the color of the bitmap above is less than the one below it, therefore from the two Figures 2, it can be seen that the difference in the accuracy of the value and color is very clear. [5][10] [11]

Morphology Operation
Morphology is a method or method in digital image processing by utilizing the shape of an object as a reference for processing. The comparison process between the corresponding pixel in the input digital image with its neighboring pixels can produce the value of each pixel in the digital image. [6] The order of appearance of the pixels can affect the morphological operations, regardless of the numerical value of the pixels so that morphological techniques are often used in binary image processing operations and also grayscale images. [12][13]

Opening Operation
The opening operation is a combined operation between erosion and dilation processes. The first process carried out is the erosion process and then continued with the dilation process by utilizing the same structural elements. The opening operation has the aim of improving the image object and smoothing the object's surface and reducing some pixels in certain areas that are too narrow and small if filled with additional elements. So that the final process of all areas that have a smaller size than the structural elements, will be removed using erosion operations, and then for the smoothing process dilation operations are used. [7]

Closing Operation
The closing operation aims to refine and smooth the contour. Also to remove small holes contained in the image. The closing operation has the following equation:

Phyton
Python programming language is a high-level computer language that uses an interpreter as a translator medium, so all processes are carried out in the interpreter. The python programming language has many supporting libraries so that it can make python a programming language that has remained in demand from the past until now. Python provides strong support for integration with other programming languages and tools. Python comes with extensible standard libraries that can be learned in just a few days. A multipurpose interpretive programming language with a design philosophy that focuses on code readability. Python is claimed to be a language that combines capabilities, capabilities, with a very clear code syntax, and is equipped with a large and comprehensive standard library functionality. [8] 3

Result and Discussion
The implementation of this system discusses the testing of the whole series of the system which aims to test the system. The test results obtained will be analyzed with digital images. The tobacco plant counting system has the following display: (1) shows the total number of detected plants (2) shows the detected parts (3) shows the detected object Hardware design using HP (mobile) and PC (personal computer) cameras. The camera will be connected to the PC by utilizing the Wireless connection. The camera is an input medium from the system that will be processed via a PC to produce output in the form of the number of plants detected by the system. The block diagram can be seen in Figure 9 below:

Hardware Design
Hardware or hardware is a hardware component that looks physical and is the driver of a command that has been programmed in the software. In designing intelligent equipment, we need hardware (hardware) that can process data, calculate, remember and make choices. In the automatic plant detection system, a laptop is needed, which functions like monitoring, as well as a programming system. Cell phone camera as an image capture tool. The ESP 8266-01 module serves as a wireless source, connecting the camera and laptop so that the detection process can run live/streaming. Syma X8Pro drone as a medium for taking aerial images. [14][15] The flow of Figure 11 begins with doing the first step to start by opening an application or software. The second stage is the process of taking pictures using a cellphone camera mounted on a drone. Taking pictures is done with a predetermined distance, starting from the near point to the farthest point. The process of taking pictures is done directly, so it is connected to a PC.
The input data (image) is in the form of RGB data which will be processed later. Then the third stage is the process of sending data directly (streaming) using a wireless connection as a liaison between the drone camera (HP camera) and PC (Personal Computer). The fourth stage is the process of receiving data sent by the drone (HP camera) to the PC, the data sent is in the form of RGB data which will then be converted to HSV. The sending process is connected using a wireless connection that is connected with the same IP. So that pictures taken using a cellphone camera can be displayed on the PC screen. The fifth stage is the color classification process by utilizing color detection to separate the object color (green) from the background color (black). This is so that objects can be detected correctly. So that the detection results allow having a slightly reduced error.
The sixth stage, namely the closing method, aims to increase or enlarge the pixels of the object shape, according to the structuring elements. In addition, to smooth the boundaries of objects without changing the object area significantly. The seventh stage, namely the opening method, aims to reduce or minimize pixels from the shape of the object, according to the structuring elements. Generally used to smooth the boundaries of large objects without changing the object area significantly, the eighth stage is used to detect objects (tobacco plants). And also the calculation process of the number of objects detected by the system. The detection process takes advantage of the different contours between the object and the background. Then the last step is to display the calculation results on the monitor screen.   From several tests that have been carried out, the test results are obtained as follows: when a distance of 4 meters the success rate is 85% with an error value of 15% when a distance of 6 meters the success rate is 85.29% with an error value of 14.7% when the distance is 6 meters the success rate is 85.29% with an error value of 14.7%, 8 meters success rate is 82.97% with an error value of 17.02% when a distance of 13 meters the success rate is 95.12% with an error value of 4.87% when a distance of 18 meters the success rate is 91.30% with the error value is 8.69% when the distance is 22 meters the success rate is 65, 30% with an error value of 34.69%. From the test results, it can be analyzed that the highest success rate is at a distance of 13 meters and the lowest success rate is at a distance of 22 meters. With the test results, many factors affect the value of the detection results. At a distance of 22 meters, the success rate is 65.30%. Judging from the image distance 13 that the color of the plant is getting fainter which affects the RGB rating of the image, so the detection results are less than optimal. While at a distance of 13 meters the success rate is 95.12%. It can be seen from Figure 11 that the color of the plant looks different from the background so that the RGB image matches the RGB input, so the detection results have a small error value.

Testing using the time parameter
The second test is carried out using the time parameter. i.e., in the morning at 05.30 -06.30 WIB.