# Improving Response Time for Crowd Management in Hajj
## 3 Methodology  
Some FANET applications depend on the process of capturing an image at the camera node (through a camera mounted on UAV) and its transmission to the base station (sink node). The information may be passed in sequential order from the camera node to the sink node through intermediate nodes. Typically, packets are not prioritized based on their type, and hence, the critical information may reach the sink node with a delay. In this paper, we propose a methodology to transmit critical image information in FANET with priority. Figure 2 shows the methodology used in this paper. In FANET, the images are captured by UAVs and need to be transmitted. The captured image is passed to the Encoder for encoding the image. The first step is to convert the image into grayscale to obtain 8 bits per pixel. We used the bit-plane encoding [22] to encode the image into two layers: high-priority and low-priority. The bit-plane slicing is a technique used in image processing to slice the images into different planes. The layer formed by these planes contains only binary information. The high-priority layers contain the bit-planes of the bit location 8 to 5 of each pixel, whereas the low-priority layer contains bit planes of bit locations of 4 to 1 of that pixel. One pixel contributes to half a byte of each pixel of the resultant layers. Figure 3 shows the encoding mechanism of two consecutive pixels. The four most significant bits (MSBs) of Pixel-1 are stored as MSBs of the first pixel of the high-priority layer, and the four MSBs of Pixel-2 are stored as the four least significant bits (LSBs) of the first pixel of the high-priority layer. Similarly, the four LSBs of Pixel-1 become the MSBs of the first pixel of the low-priority layer, followed by four LSBs of Pixel-2. The process continues for the whole image, and at the end of the encoding mechanism, PRoFFAN converts one grayscale image into two layers. Figure 2: PRoFFAN’s Steps to Transmit Information. All the packets are arranged as low-priority and high-priority based on MSBs and LSBs. All the high-priority packets contain the MSBs of the image's two pixels, while the low-priority packets contain the LSBs of two pixels of the image. Typically, to send an image over a network, the packets are sent in a sequence without priority. In PROFFAN, after encoding, the layers are prioritized before sending them. The prioritization module enqueues all the high-priority layers first. Hence, the transmission of all packets of the high-priority layer occurs first, before the low-priority layer. The bit-plane encoding mechanism used does not cause much degradation in the image quality, as the high-priority layer contains the MSBs of pixels representing most information of the pixel as it has high intensity compared to LSBs. The primary purpose of using PRoFFAN is to transmit critical information with priority to handle emergencies efficiently. Hence, the image is received at the sink node with the high-priority layers first. The image received at the sink node is low in quality as compared to the original image. Based on the pixel values in the high-priority layers, the application can easily extract low-quality image information. However, the sink node does not yet receive all the pixels. The significant difference lies in the decision-making time. If the image is sent without PRoFFAN, the application cannot decide until it receives the full image. While using the PRoFFAN, where all the high-priority layers arrive first, the application can quickly obtain enough information for decision-making, with a significant time decrease. PRoFFAN uses the algorithm outlined in the flow chart of Figure 4 once the bit-planes are ready to be transmitted. The packet generation stage consists of enclosing the maximum number of bytes from a bit-plane into a packet. Depending on the bit-plane, a priority is assigned to each packet.