Agricultural Field Environment High-Quality Image
Remote Acquisition

Fu Junqian, Xiao Deqin, Deng Xiaohui

► To cite this version:

Fu Junqian, Xiao Deqin, Deng Xiaohui. Agricultural Field Environment High-Quality Image Remote Acquisition. 7th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2013, Beijing, China. pp.50-60, 10.1007/978-3-642-54341-8_6 . hal-01220814

HAL Id: hal-01220814

https://inria.hal.science/hal-01220814

Submitted on 27 Oct 2015

**HAL** is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Agricultural Field Environment High-quality Image
Remote Acquisition

Fu Junqian<sup>a</sup>, Xiao Deqin<sup>a,*</sup>, Deng Xiaohui<sup>a</sup>

a College of Informatics, South China Agricultural University, Guangzhou 510642,China

* Corresponding Author Email: deqinx@scau.edu.cn

**Abstract.** In order to realize the acquisition of high-resolution and high-precision image in agricultural field environment, the agricultural field environment high-quality image remote acquisition system was designed, based on Canon DSLR camera. This paper made detailed design about core algorithm, including remote acquisition system architecture, camera access, image transmission and command response. The scheme used Fit-PC to control Canon 550D DSLR camera for image acquisition and WIFI wireless transmission module to transmit collected images to the remote server. Meanwhile, the server could also remotely operate camera to collect images in different ways through wireless transmission command, according to different needs. The experimental results showed that the system had three main advantages as high resolution, precision and image transmission rate in collecting images. The resolution of images collected in each node was up to 5184×3456, and the effective breadth of Canon camera image was 17 times as the Logitech camera. In addition, at a distance of 16 meters, image captured by Logitech camera could not see the target while the same one captured by Canon camera could still clearly display. Moreover, the average speed of wireless images transmission to the server was 0.97MB/S. Therefore, this system could meet the requirements of high-quality image acquisition and transmission in agricultural field environment.

**Keywords:** agricultural field environment, image acquisition, wireless transmission

# 1 Introduction

In recent years, with the rapid development of computer technology, computer image processing technology has matured and has been widely used in agricultural field, its main application focused on crop seed resources detection, grading of agricultural products, agricultural machine vision, growth monitoring of agricultural products, precision irrigation, and assessment of agricultural machinery. Image information of farmland crops was important agricultural basic information, playing a key role in the early warning and monitoring field of crop growth status, environment and field insect pests in large area [1].

During these years, many scholars have studied on agriculture image acquisition. Fan Fengyi, etc, designed the agricultural remote monitoring system based on ARM and CMOS camera [2], using the wired way to transmit images. Xiong Yingjun, etc,
combined ZigBee and GPRS, designed the system of acquisition and wireless transmission for farmland image [3]. Meanwhile the highest theoretical speed of GPRS network built by China Mobile was 171.2kb/s, but in fact current users' access speed was about 20kbps-40kbps, due to the transmission speed of actual data affected by network encoding and terminal support [4]. Therefore, it needed about 30 seconds to transmit a resolution of 640 × 480 BMP formatted image, and several minutes were needed for high-quality images. Zheng Yehan, etc, designed the wireless image acquisition system based on ARM and wireless LAN [5]. However, it would never meet the requirements of agricultural image analysis as 640 × 480 resolution collected by all these image acquisition systems. For example, the characterization of crop diseases and insect pests is usually not obvious in the low-resolution images, so it needs to magnify them by large multiples to identify. In a word, high-quality images are urgent needed in agricultural field.

This paper designed and realized an agricultural field environment high-quality image acquisition scheme based on Canon SLR camera. The scheme based on the Fit-PC-Windows-XP platform, using Canon EOS 550D DSLR (Digital Single Lens Reflex) cameras to get the high-quality images. Moreover, it used Fit-PC by controlling Canon camera to collect images and WIFI wireless transmission module to realize transmitting high-quality images transmission to the remote server.

## 2 The Architecture of Agriculture Field Environment High-quality Image Remote Acquisition System

Fig.1 showed the sketch map of the system architecture of the scheme. Each node consisted of a Canon EOS550D DSLR camera, a Fit-PC and a WIFI module. Canon DSLR camera and Fit-PC physically connected through USB connection line. The image acquisition system running on the node host established an application-level link with Canon DSLR camera through Canon EDSDK API [6], and it used WIFI module to connect to the Internet network in order to transmit the collected images and accepted remote control commands. The server consisted of a PC server and a WIFI module. Through WIFI module, software running on PC connected to the Internet network, aiming to receive images from nodes and sent remote control commands to control nodes.

<figure><img src="image_2.png" /><figcaption>Fig. 1. System Architecture</figcaption></figure>
In order to implement functions of timing automatic shooting, remote control manual shooting and automatic transmission in agricultural field environmental high-quality image acquisition this paper designed camera access module, shooting control module, command response module and image transmission module. The camera access module implemented application-level link to the camera, so that users could remotely control the camera through the system. The shooting control module included remote control manual shooting sub-module and timing shooting sub-module, respectively implementing remote control manual shooting function and timing automatic shooting function. The command response module implemented that sending remote control commands from server to the nodes, receiving commands from server and executing them. Remote control commands were consist of the shooting command, the timing command and the canceled shooting command. The image transmission module included camera to Fit-PC images transmission sub-module and nodes to server images transmission sub-module, respectively implementing images local backup and remote image transmission. Fig.2 showed the cooperation relationship between the system modules.

<figure><img src="image_3.png" /><figcaption>Fig. 2. System overall collaboration diagram</figcaption></figure>

# 3 The Core Algorithm Design of Agriculture Field High-quality Image Acquisition System

This section described the functions of camera access module, capture module, image transmission module and command response module and the concrete realization of these modules.

## 3.1 Camera Access Module

This module implemented the access to a camera. It must first realize accessing to a camera to implement controlling the camera. The system first get the camera list that listed all the cameras physically connected to the Fit-PC through the USB interface. Then the system needs to get a camera object corresponding to the index number in the camera list. After successfully getting a camera object, the system should attempt
to establish a session with the camera. If succeed, then it had realized an application-
level link with Canon DSLR camera. When the system exited, it must close the
session with the camera and release the camera object [7]. Fig.3 showed the process
of accessing the camera.

<figure><img src="image_4.png" /><figcaption>Fig. 3. The process of accessing the camera</figcaption></figure>

**3.2 Shooting Module**

This module controlled cameras to capture images. There were two ways to realize
the shooting function, according to the needs in agricultural field environment high-
quality image acquisition system. One was remote control manual shooting, another
was timing automatic shooting.

(1) Remote control manual shooting

When the user pressed the "shooting" button in the interface, the server would send a message including shooting command to nodes. The node specified by the user controlled its camera to capture the high-quality image after receiving the message. Then the image would be transmitted to Fit-PC. Then the Fit-PC would send the image to the remote server.

(2) Timing automatic shooting

"Start timing" button and "end timing" button were in the interface, when user
inputted interval and pressed "start timing" button, the server would send a message
including timing command and time interval to nodes. After receiving the command,
the node specified by the user would control the camera capture high-quality images
automatically according to the time interval. When the user pressed the "end timing"
button, the server would send a message including canceled timing command to nodes.
The node specified by the user no longer periodically controlled its camera to capture
images. The server first checked whether the time interval set by the user was greater
than the system's maximum allowed value, or was less than the response time of the
system. If there were the above-described two situations, the system would prompt
the user that time interval was unreasonable and required the user to reset the time
interval. The system would not start the timing automatic shooting function before the
time interval was set correctly. If the time interval were suitable, the system would
enter timing automatic shooting mode. The user could change the time interval all the time. Fig.4 showed the process of the shooting module.

<figure><img src="image_5.png" /><figcaption>Fig. 4. The process of the shooting module</figcaption></figure>

## 3.3 Image Transmission Module

This module implemented the transmission of images. In this paper, we divided image transmission into image transmission between camera and Fit-PC, image transmission between nodes and server. Both methods are explained below.

(1) Image transmission between the camera and Fit-PC

When the camera finished capturing high-quality images, the system needed to transmit the images to the Fit-PC. Image transmission between camera and Fit-PC was mainly relied on the callback function. The system registered the callback function after its initialization. Every time the camera captured an image, the callback function would be involved and send a transmit request to the system. When the system received the transmit request, it would check the local directory whether there was a subfolder named by the date when the system captured the image, this subfolder would be filled with images whose captured date was the same to the subfolder's name. Then the system would add an index after the date when the image was captured to identify the image's index in the subfolder. When everything was ready, the system downloaded images from the camera and saved them into Fit-PC's local hard disk. When the transmission was completed, the system would inform the camera that the image transmission was successful so that the camera could continue to carry out other operations. If failed, it would return other error codes prompting the corresponding error [8].

(2) Image transmission between the nodes and the server

Every time the image transmission between the camera and Fit-PC finished, Fit-PC need to transmit the image to the remote server by using WIFI module. The remote server collected images from all nodes and recorded their information into database for the subsequent data analysis. The system would first get information of the image, such as file name, file size. At the same time, the system would create a listening port
waiting for the server's connection. The server connected to this port and then the system sent image data to server through this port. The system would send a transmit-message to the remote server about the node ID, the information of the image and the information of listening port through the connection which had already established when the system start. The remote server created a new file prepared for receiving the data of the image according to the information received from the node and tried to connect to the listening port. The format of this message was as table1. The system started reading data from the image and sent it if succeed. Remote server received these data and wrote them to the file. When data transmission finish, the system closed the connection and closed the listening port, the server closed the connection port and inserted the information of the image in the database. Fig.5 showed the process of image transmission module.

<figure><img src="image_6.png" /><figcaption>Fig. 5. The process of image transmission module</figcaption></figure>

<table><caption>Table 1. The format of transmit-message messages</caption><thead><tr><td></td><td>Length(byte)</td></tr></thead><tbody><tr><td>Node ID</td><td>8</td></tr><tr><td>Image name</td><td>24</td></tr><tr><td>File size</td><td>4</td></tr><tr><td>Listening port</td><td>4</td></tr><tr><td>In total</td><td>40</td></tr></tbody></table>

## 3.4 Command Response Module

This module implemented that sending remote control commands from server to the nodes, receiving commands from server and executing them. After nodes' startup, they would try to establish connections with the server and the remote server would save all these connections. When users pressed buttons in the interface which corresponding to the functions they want the specified node achieved, it would trigger
the corresponding button events. Then the server would broadcast a command-message to nodes included the node ID declared which node should respond this message, controlling commands which included shooting command, timing command and canceled timing command, and additional information (example: time interval). The format of the message was as table2. When nodes received the command-message, they firstly checked whether their node IDs were match to the message's. If matched, the node would response differently based on the contents of the command. If not matched, other nodes would do nothing. Fig.6 showed the process of the command response module.

<figure><img src="image_7.png" /><figcaption>Fig. 6. The process of the command response module</figcaption></figure>

<table><caption>**Table 2.** The format of command-message messages</caption><thead><tr><td></td><td>Length(byte)</td></tr></thead><tbody><tr><td>Node ID</td><td>8</td></tr><tr><td>Command</td><td>8</td></tr><tr><td>Optional part</td><td>variable</td></tr><tr><td>In total</td><td>&lt;=40</td></tr></tbody></table>

## 4 System Testing and Running

Users could be smoothly to capture images by remotely controlling nodes and transmit them to the server on display by using the above agricultural field environment high-quality image acquisition system. Fig.7 showed its timing automatic shooting interface. This paper also carried out comparative analysis for shooting accuracy, shooting distance and transmission performance of this scheme.
<figure><img src="image_8.png" /><figcaption>Fig. 7. System interface diagram</figcaption></figure>

**4.1 Shooting Accuracy Analysis**

This section used Logitech pro9000 camera and Canon EOS 550D camera to capture images and then compared them. Firstly, we captured images for different targets at the same distance by using these two cameras and compared them, and then we captured images for the same target at different distance and compared them.

**4.1.1 Different Targets at the Same Distance**

This test used the above cameras to capture images for vegetable leaves, corn leaves, and tomato fruit and magnified them to compare. All images were captured from the target at a distance of 0.5m. Each image was five times magnified. These images were showed as Fig.8. The left side images were captured by Logitech pro9000 camera and the right side images were captured by Canon EOS 550D camera. In the first group of images contrast, the image captured by Logitech camera showed the vegetable leaves' macula lutea hazily while the image captured by Canon camera showed the leaves' macula lutea clearly. In the second group of images contrast, the image captured by Logitech camera could only showed lesions on the corn leaves hazily while the image captured by Canon camera could show a clear reduction of lesions on the corn leaves. In the third group of images contrast, people could not surely determine whether the tomato exist insect pests through the image captured by Logitech camera but they could surely confirm the tomato existed insect pests through the image captured by Canon camera. From the effect of contrast, the scheme could better satisfy the demand of agricultural the image analysis.

<figure><img src="image_9.png" /><figcaption>(a) Vegetable leaves</figcaption></figure>
<figure><img src="image_10.png" /><figcaption>Fig. 8. The comparison of images for different targets at the same distance</figcaption></figure>

4.1.2 Same Target in Different Distance

This test used Logitech pro9000 camera and Canon EOS 550D camera to capture images for the same target tomato at deferent distance respectively. Firstly, this test used the cameras to capture images at a distance of 0.5m to the target, then 1m, 2m, 4m, 8m, 16m. Then we used red rectangle to identify the target. Figure9 (a) showed images captured by Logitech pro9000 camera zooming to the original images of 17% and Figure9 (b) showed images captured by Canon camera zooming to the original images of 1%. However, they had the same display size in Fig.9. Therefore, the effective range of Canon camera image was 17 times as the Logitech camera.

<figure><img src="image_11.png" /><figcaption>Fig. 9. (a) Images captured by Logitech pro9000 camera (b) Images captured by Canon EOS 550D camera</figcaption></figure>

Furthermore, Fig.10 showed the situation that each image in Figure9 amplified five
times in target area. As we can see, at a distance of 0.5m, image captured by each
camera could clearly show the target. However, at a distance of 1m, image captured
by Logitech camera began to appear some noise to influence us to observe the target
clearly. The farther the distance, the more noise generated, and we would be more and
more difficult to observe the target. On the other hand, images captured by Canon
camera could still clearly show the target at a distance of 1m, 2m and 4m, even 8m.
Finally, at the distance of 16m, image captured by Logitech camera could not see the
target while the one captured by Canon camera could still show the target clearly.

<figure><img src="image_12.png" /><figcaption>**Fig. 10.** (a) Magnified images captured by Logitech pro9000 camera (b) Magnified images captured by Canon EOS 550D cameras</figcaption></figure>

## 4.2 Transmission Performance Analysis

Agricultural field environment high-quality image acquisition system transmitted
images by using WIFI module on nodes. Data send by WIFI module passed through
the router, eventually received by the server. The effective radius of a single high-
power router was about 1.5km. With cascades of routers, it could improve the
transmission range so that we could achieve long distance agricultural image
acquisition.

This test captured images periodically through remote controlling camera and
transmitted them to the remote server. The time interval was 10 seconds and this test
totally captured 150 images. All images were successfully transmitted and the image
transmission speed was from 0.72MB/S to 1.18MB / S, and the average speed of the
transmission was 0.97MB / S. Fig.11 showed the result of this test.

<figure><img src="image_13.png" /><figcaption>**Fig. 11.** Transmission performance analysis test result diagram</figcaption></figure>
## 5 Conclusions

In this paper, aiming at the demand of current agricultural field environments on high-quality image acquisition, we designed and implemented an agricultural field environment high-quality image remote acquisition system based on Canon DSLR camera. And it used the system to conduct a series of experiments to test the feasibility of the system, and carried out comparative analysis for shooting accuracy, shooting distance and transmission performance. The scheme could achieve real-time high-quality image acquisition of agricultural field environment, to a certain extent, meeting the demand of agricultural high-definition image analysis. It was worth to mention that this scheme based on Fit-PC was a relatively high cost at the present stage. Therefore, the next step we should take was to migrate this system to a low-cost embedded platform in order to carry out large-scale applications

## Acknowledgment

The authors would thank the project of the National Key Technology R&D Program (Project Name: Key Technologies for Agricultural Field Information Comprehensive Sensing and Rural Extension, Contact Number: 2011BAD21B01); the Natural Science Foundation of China (Contact Number: U0931001).

## References

1. Wang Jie, Guan Tao, Farmland image acquisition system based on GPRS and ARM [J], Journal of Agricultural Mechanization Research, 2012, 10:195-198.

2. Xiong Yingjun, Shen Mingxia, Sun Yuwen, et al. Design on system of acquisition and wireless transmission for farm land image [J], Transactions of the Chinese Society of Agricultural Engineering, 2011, 42(3):184-187.

3. Fan Fengyi, He Dongjian, Agricultural remote monitoring system based on embedded linux[J], Computer Engineering, 2011, 37(1):249-253.

4. Wu Song, The rate of transmission of the GPRS data system, China Data communications, 2002, 11:20-23.

5. Zheng Yehan, Tian Xuhong, Design and implementation of wireless image capturing system [J], Computer Engineering and Design, 2011, 32(1): 110-113

6. Canon, Canon EOS Digital SDK EDSDK2.10 API Programming Reference.2.10 [M], Canon,:1-144,2011.

7. John Mitchell, Live View Sample in CSharp [EB/OL], http://tech.groups.yahoo.com/group/CanonSDK/ message/1176, 2008.

8. MicroSoft, Still Image Connectivity for Windows [EB/OL], http://msdn.microsoft.com/en-us/windows/hardware/gg463507.aspx, 2001.