# Study on Jabber Be Applied to Video Diagnosis for Plant Diseases and Insect Pests

Wei Zhang, Junfeng Zhang, Feng Yu, Jichun Zhao, Rupeng Luan

► To cite this version:

Wei Zhang, Junfeng Zhang, Feng Yu, Jichun Zhao, Rupeng Luan. Study on Jabber Be Applied to Video Diagnosis for Plant Diseases and Insect Pests. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.615-622, 10.1007/978-3-642-18336-2_75. hal-01562799

HAL Id: hal-01562799

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

Submitted on 17 Jul 2017

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
# Study on Jabber be applied to Video Diagnosis for Plant Diseases and Insect pests

(Zhang Wei, Zhang JunFeng, Yu Feng, Zhao JiChun, Luan RuPeng)
(Agriculture and Forestry Academy of Beijing; Beijing 100097; China)

**Abstract:** Experts diagnose plant diseases and insect pests via long-distance video is a new and effective way for prevention and cure. Jabber based on XMPP. So there are good communication, standardization and expansibility in Jabber. This thesis gave a method which was long-distance video diagnosis based on Jabber. First, VFW was used to capture video of diseases and insect pests. Second, H.264 compressed the video. Third, compressed video was transmitted and controlled by Jabber. Finally the compressed video was decoded and showed in other end. Client used Delphi as developing tool and Sever used Jabber2.0 realized this design.

**Keyword:** video diagnosis; Jabber; H.264; Plant Diseases and Insect pests

## 0 Foreword

Plant diseases and insect pests is one of the pivotal factors which influence yield and quality of crop. Because of limit of knowledge, farmers are difficult to judge exactly the disease and insect pests of plant. But farmers can transmit symptom of disease and insect pests to expert and talk face to face by long-distance video. Experts give the answer and help farmer to prevention. This diagnosing mode can accelerate tradition agriculture to modern agriculture and improve agricultural modern construction. Vision compression technique and transmission technique are the keys of long-distance video. Now there are two organizations who have established vision compression standard. One is International Organization for Standardization (ISO) who established MPEG-1, MPEG-2, MPEG-4 etc. The other is International Telecommunications Union (ITU-T) who established H.261, H.263, H.264 etc. the chief advantage of H.264 is high compression ratio. In the condition of coordinative images, compression ratio of H.264 is about 1.5~2 times of MPEG4. Therefore long-distance vision diagnosis will take advantage of H.264[1,2]. Because TCP/IP can't offer real-time vision service, vision transmission ordinarily adopt RTP/RTCP in internet. But there are disadvantages of RTP/RTCP, such as more bottom technology, complicated programming, penetrating through firewall faintly. Jabber is an open source software which was developed by Jeremie Miller. Jabber bases on XML and uses JabberID which is similar to email. So it has good expansibility, standardization, capability to penetrate through firewall. As well as Jabber provided with character communication, online judgement and white board etc. Furthermore, it was easy to communicate with Instant Messaging software. This thesis has studied long-distance video diagnosis based H.264 and Jabber.

## 1 principle of long-distance video diagnosis in plant diseases and
insect pests based on Jabber

Framework of Jabber differs from the single-framework of ordinary instant messaging software. Jabber is multi-framework which likes email. All instant messages must be transmitted by server. The Jabber PIN is called JID which is similar to email address. For example, in the JabberID li@aaa.com, li was the user account, aaa.com is the server of user account. The process of A: li@aaa.com sends the message to B: liu@bbb.com can be described as follow. The first, user A send the message to server aaa.com. Then server aaa.com sends the message to server bbb.com of user B. The last, server bbb.com transmits the message to user B. Message exchange between server A and server B depend on “Etherx” module. The process as Fig.1.

<figure><img src="image_2.png" /><figcaption>Fig. 1 Message transmission process of Jabber</figcaption></figure>

Jabber bases on XMPP which is one of XML. So it is easy to custom the
application and increase functions. And it is easy to penetrate through firewall. The
essential concepts of XMPP are element, name, attribute, namespace. One Jabber
conversation is composed of two parallel XML. One XML is from client to server.
The other is from server to client. XML steam begins with <stream> tag and end with
</stream> tag. In the stream lifecycle, the initialized entity can send large numbers of
XML which can build and exchange structure information.

The supreme advantage of H.264 is high compression ratio. So it adapt to
internet vision transmission. Now there are three mainstream open source coders of
H.264 which are JM, X264, T264. JM is official test source code. But coding is
terribly complexity and low practicability. X264 was an open source item which was
originated by students from center graduate shool of Ecole Centrale Paris. In the
condition of playing down coding capability not obviously, X264 is much simple than
JM. T264 was similar with X264 which was developed by Chinese vision coding free
organization. So T264 suited Chinese environment. This thesis used T264 to compress
vision.
# 2 Design and realization

## 2.1 Two data transmission modes

Jabber system uses XML transmit Data between entities. XML can transfer abundant information. So character consultation, file transmission, white board, voice communication, vision communication are designed in this system. The information of voice and vision is great which will use up lots of resource. Other information such as character information, control information use up little resource. There are two transmission modes for them.

### (1) Server transmitting mode

Server transmitting mode is used for non voice or vision data such as character information, control information etc. This mode can transfer and save information, estimate users on line or not. The security can be strengthened via adding firewall, data encrypt, identify etc. Server transmitting mode as fig.2.

<figure><img src="image_3.png" /><figcaption>Fig. 2 Server transmitting mode</figcaption></figure>

### (2) Non server transmitting mode

Because voice and vision data was great which will use up lots of resource. If server transmitting mode is used to transmit them, there will be great pressure in server. It will influence the net transmission capability so much as paralysis. So non server transmitting mode is used to transmit voice or vision data. In non Server transmitting mode, control information of voice and vision are transferred by server. Voice and vision data are transmitted by UDP directly. Non server transmitting mode as fig.3.

<figure><img src="image_4.png" /><figcaption>Fig. 3 Non server transmitting mode</figcaption></figure>

## 2.2 Two diagnosis communication flow

There are two communication flows in practical application of long-distance
vision diagnosis. One is one to one diagnosis flow. In this flow expert only communicate with one user and user can only see one expert. The other is one to multi diagnosis flow. Experts can communicate with multi users and user can see multi experts.

One to one diagnosis flow as fig.4.

<figure><img src="image_5.png" /><figcaption>Fig. 4 One to one diagnosis flow</figcaption></figure>

One to multi diagnosis flow as fig.5.

<figure><img src="image_6.png" /><figcaption>Fig. 5 One to multi diagnosis flow</figcaption></figure>

## 2.3 System realization

### 1、Client realization

Client realization uses layers and module theory. There are three layers in client which are network layer, core layer and GUI layer. Net layer is the bottom layer which severs for communication between Jabber client and Jabber server. Net layer depends on UDP protocol. Core layer is the foremost layer which takes charge the Jabber protocol realization. GUI is the figure layer facing to user. Users take GUI layer to communicate. Layers design as fig.6
<figure><img src="image_7.png" /><figcaption>Fig. 6 Three layers design of client</figcaption></figure>

According to layers design, five modules are designed for client. Modules frame figure as fig.7.

<figure><img src="image_8.png" /><figcaption>Fig. 7 Modules frame figure of client</figcaption></figure>

Link disposal module is used to create TCP socket to Jabber server. XML information exchange between client and server will use this socket. XML analysis module takes charge to analyze import XML information. Message disposal takes charge to dispose XML element. Different XML element has different disposal program. For example, `<message/>`, `<presence/>`, `<iq/>` respectively have corresponding disposal program. GUI module presides over user communication. Event disposal module transfers events to XML elements. These XML elements send to server via link disposal module, such adding friendship, sending instant messaging, update user current state etc.

## 2、server realization

Server developed with Java Language. Server is the core of control and transmission. Jabber common modules were used in the process of developing server. These Jabber common modules include conversation management, client-server communication, server-server communication, DNS parsing, user authentication, user enroll, database query, off-line users storage, filtration enactment, group chat, system log etc.
# 3 Experiment

In the process of development, two experiments have been executed. One is the communication experiment. Its aim is to test the communication function of character, voice and vision. The other experiment is loading experiment. Its aim is to test the loading capability.

Fig. 8 is the result of communication experiment.

<figure><img src="image_9.png" /><figcaption>Fig. 8 Communication experiment</figcaption></figure>

Fig. 9, Fig. 10 is the result of loading experiment. In the loading experiment, there are 41 landing users and 7 online visions.

<figure><img src="image_10.png" /><figcaption>Fig. 9 Impression of loading Capability experiment</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>Fig. 10 Net capability of loading capability experiment</figcaption></figure>
The results of experiment indicate that the theory of this thesis can transmit character, voice and vision availably. Furthermore the system has good loading capability.

## 4 Conclusion

According to the characteristics of transmission and diagnosis of vision, this thesis uses combination of Jabber and H.264 to realize long diagnosis of plant diseases and insect pests. The experiment results have showed that the communication capability and loading capability were good. Corresponding software were given.

Jabber is an open source software. Excellent instant message software can be developed based on Jabber. Moreover Jabber uses XMMP protocol which can communicate with existing instant message software. Getting along with development of 3G, integration of 3G vision diagnosis and Internet vision diagnosis is the centre of next study.

## Reference

[1] Li Haopeng, Sheng Sheng Yizhi. Video Transmission Technology Based on H. 264[J]. Computer & Digital engineering. 2006, 34(2): 44-46

[2] JianNing Zhang, YuWen He. Performance and complexity joint optimization for H.264 video coding [J]. Proceedings of the 2003 International Symposium on Circuits and Systems, 2003, 13(7): 20-23

[3] Miao kai. XMPP security system analysis[J]. Communication technique, 2003, 5(2): 101-105

[4] http://baike.baidu.com/view/188363.htm

[5] http://www.jabber.org

[6] XMPP Standards Foundation. Jabber Enhancement Proposals: File Transfer, JEP – 0096. October 2006

[7] Stephan Wenger. H.264 / AVC over IP [J]. IEEE Transactions on Circuits and Systems for Video Technology, 2003, 13(7): 645-656

[8] Kim, Choi. Real-Time Video Coding[J]. IEEE Transactions on Consumer Eletronics, 1999, 32(4): 417-426

[9] Ma Xiaohu. Multimedia data compress standard and realization[M]. Beijing: Tsinghua University Press, 1996: 126-130

[10] G.J. Sullivan. Rate-Distortion Optimization for Video Compression[J]. IEEE Signal Processing Magazine. 1998, 15(6): 74-90

Author introduction: Zhang Wei (1978 - ), Hu Nan Province, assistant researcher, zhangw@agri.ac.cn