Detection and Classification of Land Crude Oil Spills Using Color Segmentation and Texture Analysis

Crude oil spills have negative consequences on the economy, environment, health and society in which they occur, and the severity of the consequences depends on how quickly these spills are detected once they begin. Several methods have been employed for spill detection, including real time remote surveillance by flying aircrafts with surveillance teams. Other methods employ various sensors, including visible sensors. This paper presents an algorithm to automatically detect the presence of crude oil spills in images acquired using visible light sensors. Images of crude oil spills used in the development of the algorithm were obtained from the Shell Petroleum Development Company (SPDC) Nigeria website The major steps of the detection algorithm are image preprocessing, crude oil color segmentation, sky elimination segmentation, Region of Interest (ROI) extraction, ROI texture feature extraction, and ROI texture feature analysis and classification. The algorithm was developed using 25 sample images containing crude oil spills and demonstrated a sensitivity of 92% and an FPI of 1.43. The algorithm was further tested on a set of 56 case images and demonstrated a sensitivity of 82% and an FPI of 0.66. This algorithm can be incorporated into spill detection systems that utilize visible sensors for early detection of crude oil spills.


Introduction
Crude oil spills have severe negative effects on the environment, health, society and economy of the nation in which they occur, and this has been documented extensively in scientific literature [1][2][3][4][5][6][7][8][9][10].In the United States, 217 spill incidents were reported and 43,662 barrels (6,942,258 L) spilled in 2007 [11].In Canada, 133 spill incidents were reported to the Transportation Safety Board of Canada for federally regulated pipelines in 2014 [12].The Niger Delta region of Nigeria is considered to be one of the most severely petroleum-damaged ecosystems in the world [8].The Department of Petroleum Resources of Nigeria reported a total of 871 spill incidents and 15,552.18bbl (2,472,796.6 L) of oil released into the environment in 2012 [13].
When a spill occurs in water or offshore, contact and ingestion of spilled oil leads to contaminants in tissues, DNA damage, impacts to immune functioning, cardiac dysfunction, mass mortality of eggs and larvae, and the loss of buoyancy and insulation for birds [14][15][16][17][18][19][20][21].When the spill occurs on land, it prevents soil aeration, affects soil temperature, structure, fertility, pH, and results in the destruction soil micro-organisms and agricultural crops [22,23].Other effects include contamination of ground water, loss of biodiversity in breeding grounds, vegetation hazards, loss of portable and industrial water resources, reduction in fishing and farming activity, poverty and rural underdevelopment [24].
Direct or indirect contact with crude oil can result in short-term symptoms such as headaches, fatigue and lethargy, eye, nose and throat irritation, loss of concentration and co-ordination, dizziness, nervousness, insomnia, nausea, vomiting, visual disorders, drowsiness, depression, heightened anxiety, skin rashes and sores, respiratory disorders like shortness of breath, and exacerbation of asthma [25,26].Long-term effects on humans include DNA degradation, cancers, birth and reproductive defects, irreversible neurological and endocrine damage, and impaired cellular immunity [1,19,21,27,28].
Loss of crude oil due to spills results in a decrease in a nation's revenue.In 2014, 1,008,805 bbl (160,400,000 L) of crude oil were lost from Nigeria's pipelines, resulting in a loss of N14,846,710,000 [29].Crude oil spills also demand exorbitant financial resources to remediate or clean up the damaged environment.For example, the 1989 Exxon Valdez spill cost Exxon $4.8 billion for remediation, compensatory payments, settlements and fines [30].
Several methods have been employed for spill detection, including real-time remote surveillance by flying aircrafts with surveillance teams.Other methods employ various sensors such as visible sensors, infrared sensors, ultraviolet sensors, radar sensors, and laser fluorosensors [31,32].Most of these methods generate some type of image that is used in detecting and assessing the size of the spill.The image analysis performed on the acquired images usually involves segmentation, horizon detection, and classification.Segmentation is performed to identify and extract the object of interest in the image [33,34].In particular, color segmentation has proven to be extremely effective in distinguishing objects [35].A color image provides three times more data than a grayscale image, since it can be represented by the three monochrome components defined by RGB, HSV, XYZ or CIELUV color spaces.RGB is widely used for its simplicity [35].Some common methods of color segmentation include histogram thresholding and edge detection [36,37].Effective horizon detection is required in order to identify sea-sky, soil-sky and forest-sky boundaries [38] and the algorithms that have been developed to do this are based on experiments carried out by authors in the published literature [38], and classification is performed after objects have been successfully identified in the image and it is crucial in determining the effectiveness of the algorithm [39].
There are several methods that have been employed in detecting oil spills in images, and they include the automatic statistical approach [40], neural network classification [41], wind history information [42], spill detection near offshore platforms [43], and probabilistic approach [44].Feature extraction and spatial analysis also play a very important role in detection of oil spills in images [45,46].
The main systems to monitor sea-based oil pollution are the use of airplanes and satellites equipped with Synthetic Aperture Radar (SAR).SAR is an active microwave sensor, which captures two-dimensional images, and as such the spill detection algorithms developed so far are mainly focused on SAR images [39].This paper presents an algorithm to detect the presence of crude oil spills automatically in images acquired using visible light sensors.To our knowledge, this represents one of the first spill detection algorithms developed specifically for images acquired with visible light sensors.Images of crude oil spills used in the development of the algorithm were obtained from the Shell Petroleum Development Company (SPDC) website [47].The spill detection algorithm used in this paper is discussed in detail in the Materials and Methods section.The results obtained from the implementation of the algorithm on crude oil spill images derived from the SPDC website are presented in the Results section.Challenges encountered and possible options to improve the efficiency of the algorithm are expounded on in the Discussion and Conclusion section.

Materials
All crude oil spill images used in the development and testing of the algorithm proposed in this paper were obtained from the SPDC Nigeria website [47].A total of 25 images were selected and used in the development of the spill detection algorithm.These images were classified as sample images.For each sample image, color and texture information of selected regions containing crude oil spills were extracted.The texture information utilized in characterizing crude oil spills were homogeneity, entropy and the power spectrum density of the selected region.The color and texture information obtained from the sample images were used to obtain optimal thresholding values for automated extraction of crude oil spills present in any given image.The algorithm was developed and tested using MATLABTM (The MathworksTM, Natick, MA, USA).
After the successful development of the spill detection algorithm, the algorithm was tested further on case images also drawn from the SPDC website.A total of 56 case images were utilized in testing the efficiency of the crude oil spill detection algorithm developed with the aid of the 25 sample images.The 56 case images contained crude oil spill with varying volumes, making it possible to test the ability of the algorithm to detect minute spills as well as large-volume spills.Figure 1a,b show sample images from the sample and case images respectively.extraction of crude oil spills present in any given image.The algorithm was developed and tested using MATLABTM (The MathworksTM, Natick, MA, USA).
After the successful development of the spill detection algorithm, the algorithm was tested further on case images also drawn from the SPDC website.A total of 56 case images were utilized in testing the efficiency of the crude oil spill detection algorithm developed with the aid of the 25 sample images.The 56 case images contained crude oil spill with varying volumes, making it possible to test the ability of the algorithm to detect minute spills as well as large-volume spills.Figure 1a

Methods
The crude oil spill detection algorithm developed using the sample images is depicted in Figure 2 The algorithm to detect and extract crude oil spills from images was developed using the 25 sample images, using a step-wise procedure.For instance, the image preprocessing code to ensure the removal of the labels from the image was developed and tested on the 25 sample images.If the code failed to successfully remove the labels in any of the 25 images, the authors conducted further revisions and modifications to the code until the final image preprocessing code was able to successfully remove the labels in all of the 25 images.Once this was done, the final image preprocessing code was integrated into the spill detection algorithm.The same process was repeated for the remaining five major steps shown in Figure 2.

Methods
The crude oil spill detection algorithm developed using the sample images is depicted in The algorithm to detect and extract crude oil spills from images was developed using the 25 sample images, using a step-wise procedure.For instance, the image preprocessing code to ensure the removal of the labels from the image was developed and tested on the 25 sample images.If the code failed to successfully remove the labels in any of the 25 images, the authors conducted further revisions and modifications to the code until the final image preprocessing code was able to successfully remove the labels in all of the 25 images.Once this was done, the final image preprocessing code was integrated into the spill detection algorithm.The same process was repeated for the remaining five major steps shown in Figure 2.After the successful development of the spill detection algorithm, the algorithm was tested further on case images also drawn from the SPDC website.A total of 56 case images were utilized in testing the efficiency of the crude oil spill detection algorithm developed with the aid of the 25 sample images.The 56 case images contained crude oil spill with varying volumes, making it possible to test the ability of the algorithm to detect minute spills as well as large-volume spills.Figure 1a,b show sample images from the sample and case images respectively.

Methods
The crude oil spill detection algorithm developed using the sample images is depicted in Figure 2. It involves six major steps.These are image preprocessing, crude oil color segmentation, sky elimination segmentation, Region of Interest (ROI) extraction, ROI texture feature extraction, and ROI texture feature analysis and classification.
The algorithm to detect and extract crude oil spills from images was developed using the 25 sample images, using a step-wise procedure.For instance, the image preprocessing code to ensure the removal of the labels from the image was developed and tested on the 25 sample images.If the code failed to successfully remove the labels in any of the 25 images, the authors conducted further revisions and modifications to the code until the final image preprocessing code was able to successfully remove the labels in all of the 25 images.Once this was done, the final image preprocessing code was integrated into the spill detection algorithm.The same process was repeated for the remaining five major steps shown in Figure 2.This step-wise procedure was necessary in order to ensure the final spill detection algorithm was optimized to ensure the highest possible sensitivity along with the minimum number of False Positives per Image (FPI).Once this was accomplished, the final spill detection algorithm was implemented on the 56 case images.These images were chosen at random from [35] to ensure an unbiased evaluation of the developed spill detection algorithm.The final algorithm can also be further tested on other image sets.The authors use the term "sample" to explain that those images were used to experimentally develop the spill detection algorithm and to refine and improve it until it demonstrated maximum sensitivity along with minimum FPI.Once that was accomplished the final algorithm was then tested on another set of images referred to as case images to verify and validate the algorithm's efficiency.

Image Preprocessing
Some of the images obtained from the SPDC website contained labels at the bottom which affected the algorithm's ability to accurately detect crude oil spills in the images.Figure 3a shows a case image with its label.The label typically contained Global Positioning System (GPS) location of the spill, as well as the date and time the image was acquired.To prevent these label pixels from interfering with the identification of the spill, they were removed during the preprocessing stage of the algorithm (see Figure 3b).
For the images obtained from [35], the labels were typically at the bottom of the images (see Figure 3a) and the size of the labels were dependent on the image height, h.For an input Image, InitialImage, the bottom rows containing the label pixels were removed using the following procedure shown Number 1 in the Appendix A.
As stated, the size of the label was dependent on the image height and this was taken into account in the algorithm.After label removal, the output image, PreprocessedImage was then passed on to the second stage of the spill detection algorithm.Other datasets may require no label removal if they have no labels, or the position of their labels may be in a different location in the image, at the top of the image, and the algorithm may need to be adjusted if that is the case.However, the presence of label in the images affects the sensitivity of spill detection algorithms so this is a very important step that should not be overlooked.

Color Segmentation
Most crude oil spill images contain at least three major regions when classified by color: sky, vegetation and land.In some of the images used in this paper, only one or two of these regions were present.The colors for each of these regions are distinct.The color of the sky ranged from white to blue, the vegetation was primarily green, and the color of the ground was brown.Each color has a distinctive range in the RGB color spectrum and this information was exploited in the development of the color segmentation portion of the spill detection algorithm.Color analysis performed on regions containing crude oil spills in the sample images was used in determining the range of colors exhibited by crude oil

Color Segmentation
Most crude oil spill images contain at least three major regions when classified by color: sky, vegetation and land.In some of the images used in this paper, only one or two of these regions were present.The colors for each of these regions are distinct.The color of the sky ranged from white to blue, the vegetation was primarily green, and the color of the ground was brown.Each color has a distinctive range in the RGB color spectrum and this information was exploited in the development of the color segmentation portion of the spill detection algorithm.Color analysis performed on regions containing crude oil spills in the sample images was used in determining the range of colors exhibited by crude oil spills.This experimentally determined color of crude oil spills was found to be predominantly in the brown region.Therefore, color thresholding was performed on the preprocessed image to extract regions that possessed the same color attributes as the crude oil spills in the sample images.Figure 3c shows a color-segmented image of one of the case images used in this study.Note that the green vegetation has been eliminated from the color-segmented image.This portion of the algorithm extracts out of the vegetation in the image, leaving behind the sky and land pixels.
For an Input Image, PreprocessedImage, the vegetation in the image was removed using the following procedure shown in Number 2 of the Appendix A. The values for V T1A , V T1B , V T2A , V T2B , V T3A , and V T3B were determined experimentally during the development of the algorithm using the sample cases.Afterwards, the optimal value for each of those parameters was utilized in the final algorithm and also for testing the algorithm on the sample cases.If a pixel, p(i,j), had its, R, G, and B, values within the minimum and maximum threshold identifying vegetation, then it was a pixel containing vegetation and that pixel was eliminated by assigning it the RGB value for black (0,0,0).The output image VSegmentedImage, was then passed on to the next stage of the algorithm.

Sky Segmentation and Elimination
Sections of a crude oil spill image in which the sky is present are section in which there is no crude oil spill and therefore should not be considered as ROIs for further evaluation.In order to prevent the algorithm from flagging sky regions as ROIs, this section of the algorithm is dedicated to the detection and removal of these regions.By taking advantage of the fact that the sky is typically predominantly white or some shade of blue, the sky region, if present in an image, can be detected and removed.Figure 3d shows a crude oil spill in which the sky segmentation and removal section of the detection algorithm has been implemented.Because there are many different shades of blue, each with its own unique value in the RGB color spectrum, complete removal of the sky region in every image was not possible, as the spectrum of the blue color overlapped with other colors.In most cases, even a partial removal of the sky region was sufficient to prevent the algorithm from flagging it as a potential ROI.
For an Input Image, VSegmentedImage, the sky in the image is removed using the following procedure shown in Number 3 of the Appendix A. The values for S T1A , S T1B , S T2A , S T2B , S T3A , and S T3B were determined experimentally during the development of the algorithm using the sample cases.Afterwards, the optimal value for each of those parameters was utilized in the final algorithm and also for testing the algorithm on the sample cases.If a pixel, p(i,j), had its, R, G, and B, values within the minimum and maximum threshold identifying sky, then it is a pixel containing the sky and that pixel was eliminated by assigning it the RGB value for black (0,0,0).The output image SkySegmentedImage, was then passed on to the next stage of the algorithm.

ROI Extraction
Identification of ROIs was performed on the grayscale image of the color segmented and sky-eliminated image.ROIs were determined by grouping interconnected pixels based on their grayscale values and proximity to one another.An experimentally determined threshold was utilized to determine if an ROI was to undergo further evaluation.If the area of an identified ROI was below a predetermined threshold, it was discarded.After successfully identifying ROIs with areas above this threshold, the ROI with the maximum area was then selected as the region on which further analysis was to be performed.Figure 3e shows the ROI selected in a case image for further processing.It is the ROI with the maximum area in the color-segmented and sky-eliminated image shown in Figure 3d.
For an Input Image, SkySegmentedImage, ROI was extracted using the following procedure shown in Number 4 of the Appendix A. The values for area threshold, A T, was chosen experimentally during the development of the algorithm using the sample cases.Afterwards, the optimal value for each of those parameters was utilized in the final algorithm and also for testing the algorithm on the sample cases.The output image, ROI, was passed on to the next stage of the algorithm.

ROI Texture Feature Extraction
Certain texture features were computed and measured for each ROI identified by the algorithm.The selected features were homogeneity, entropy, and power spectrum density.Homogeneity is a measure of how close in the grayscale values of a pixel is when compared with its neighboring pixels.Using a window size of 3 × 3 pixels, the homogeneity for each pixel in the ROI image is computed.If the difference between the average grayscale value of the nine pixels in the window and the grayscale value of the center pixel is within a small range, then the central pixel is classified as a homogeneous pixel.If that difference is outside the range, then that pixel is determined to be non-homogeneous.Using this method, every pixel in the ROI image was classified as either homogeneous or non-homogeneous.The range for determining the homogeneity of a pixel was chosen experimentally.After homogeneity extraction, neighboring homogeneous pixels were grouped into ROIs and ROIs with areas above a certain threshold were selected for feature analysis.Figure 3f shows the homogeneity profile of the selected ROI region in Figure 3e.It was observed that majority of crude oil spills possessed homogeneous regions.
For an input image, ROI, the following procedure shown in Number 5 of the Appendix A was performed to extract homogeneous regions.The values for Homogeneity Threshold H R , and Area Threshold, A T , were determined experimentally during the development of the algorithm using the sample cases.Afterwards, the optimal value for each of those parameters was utilized in the final algorithm and also for testing the algorithm on the sample cases.The output image, FinalHImage, was passed on to the next stage of the algorithm.
Entropy is a measure of the amount of information that is needed for image compression.It measures the loss of information or message in a transmitted signal and also measured the image information [37].The entropy was computed for the identified ROI using the entropyfilt function with a 3 × 3 pixel window size.After computation, pixels with an entropy value within a predetermined range were selected for further analysis.The acceptable entropy range used in selecting pixels for further analysis was determined experimentally with the sample images.Figure 3g shows the extracted entropy profile of the selected ROI region in Figure 3e.
For an input image, ROI, the following procedure shown in Number 5 of the Appendix A was performed to extract the entropy feature.The values for Entropy Threshold E T1 , and E T2 , were determined experimentally during the development of the algorithm using the sample cases, and they were defined as a percentage of the maximum entropy value in order to facilitate their application to other data sets of images.Afterwards, the optimal value for each of those parameters was utilized in the final algorithm and also for testing the algorithm on the sample cases.The output image, EImage2, was passed on to the next stage of the algorithm.
The power spectrum density (PSD) shows the strength of the variations (energy) as a function of frequency.It provides a representation of the amplitude of a surface's roughness as a function of the spatial frequency of the roughness.After computation, pixels with a PSD value within a predetermined range were selected for further analysis.The acceptable range used in selecting pixels for further analysis was determined experimentally with the sample images.Figure 3h shows the extracted PSD profile of the selected ROI region in Figure 3e.
For an input image, ROI, the following procedure as shown in Number 5 of the Appendix A was performed to extract the PSD feature.The values for PSD Threshold PSD T1 , and PSD T2 , were determined experimentally during the development of the algorithm using the sample cases, and they were defined as a percentage of the maximum PSD value in order to facilitate their application to other data sets of images.Afterwards, the optimal value for each of those parameters was utilized in the final algorithm and also for testing the algorithm on the sample cases.The output image, PSDImage2, was passed on to the next stage of the algorithm.

ROI Texture Feature Analysis and Classification
The homogeneity, entropy and PSD ROIs for the ROI extracted from the original image were integrated into a final image containing regions flagged as crude oil spills.First, the homogeneity ROI (see Figure 3f) and entropy ROI (see Figure 3g) were combined by checking to see if a pixel was either homogeneous or if its entropy value fell within the specified acceptable range.If either of these conditions held true for a pixel, then it was selected for further processing, forming a new ROI with analyzed homogeneity and entropy features, as shown in Figure 3i.
The mean grayscale intensity value of the homogeneity and entropy ROI was used in thresholding the PSD ROI.The thresholded PSD ROI was then combined with the homogeneity and entropy ROI.If a pixel had a grayscale intensity value greater than zero in either the homogeneity and entropy ROI or the thresholded PSD ROI, it was classified as a pixel containing crude oil spill.Otherwise, it was classified as a non-crude oil spill pixel.In some images, the homogeneity and entropy ROI image contained multiple ROIs.When this happened, the algorithm thresholded the PSD ROI image using the mean grayscale intensity value for each ROI within the homogeneity and entropy image, then matched each ROI in the thresholded PSD ROI image with its corresponding ROI in the homogeneity and entropy image, before proceeding to integrate the data in the two images as described above.After integration, neighboring pixels are combined to form regions containing crude oil spills.Figure 3j shows the final detected crude oil spill from the original case image in Figure 3a.
For input images, FinalHImage, EImage2, and PSDImage2, the following procedure as shown in Number 6 of the Appendix A was performed to classify the ROI.The output image, OilSpill, is the final image containing the detected crude oil spill from the original image.

Results
The spill detection algorithm described above was developed using 25 sample images containing different volumes of crude oil spills.The results from testing the algorithm on these sample images are presented in Table 1.The algorithm successfully detected the crude oil spill in 23 of the 25 images, resulting in a sensitivity of 92%.The average False Positive per Image (FPI) was 1.43.The final spill detection algorithm was tested on 56 case images.The results are presented in Table 2.The algorithm successfully detected the crude oil spill in 46 out of 56 images, resulting in a sensitivity of 82%.The average False Positive per Image (FPI) was 0.66.

Discussion
The spill detection algorithm developed in this paper demonstrated a sensitivity of 92% when tested on the set of sample images, and a sensitivity of 82% when tested on a set of sample cases.The algorithm also demonstrated high specificity for crude oil spills, with 1.43 and 0.66 FPI for the sample and sample cases respectively.This means that the algorithm is able to identify with a high degree of accuracy whether a spill is present in a given ROI.There were several challenges, however, that affected the algorithm's ability to achieve 100% sensitivity.
The overlap of RGB range for various colors affected the efficiency of the algorithm during the color segmentation stage.In particular, the RGB range of values for the different shades of brown overlapped those for the color green.This made it difficult for the algorithm to effectively eliminate green vegetation during color segmentation.It was observed that the darker the shade of green, the more the algorithm was unable to eliminate the background vegetation during ROI identification and extraction.Figure 4a shows the sample image OS25, an image in which the algorithm failed to identify the crude oil spill.Figure 4b shows the color segmentation result for OS25.Most of the dark green trees and vegetation in the image are still present in the color-segmented image, making it difficult for the algorithm to select the initial ROI that would contain the crude oil spill.
trees and vegetation in the image are still present in the color-segmented image, making it difficult for the algorithm to select the initial ROI that would contain the crude oil spill.
Another factor that affected the efficiency of the spill detection algorithm was the color of the crude oil spill in the sample and case images.It was determined from the sample images that the color of the crude oil was predominantly brown.A predefined range of RGB values was used to segment out regions that could possibly contain crude oil.However, there were some images in which the color of the crude oil spill was not within the specified RGB range for brown used in the algorithm.Figure 5a shows a case image, OS46, in which the color of the crude oil spill is a mixture of orange and brown.The corresponding color segmented image is shown in Figure 5b, showing that only a small portion of the spill with dark brown color is segmented out as a possible ROI.This is the primary reason why the algorithm was unable to detect the crude oil spill in OS46.Similarly, the color of the crude oil spill in case image OS66 is outside the predefined RGB color range for crude oil, closer to black than brown (see Figure 5c), and is therefore not segmented out in the corresponding color segmentation image shown in Figure 5d.In fact, the crude oil spill is the only region segmented out in Figure 5d.Another factor that affected the efficiency of the spill detection algorithm was the color of the crude oil spill in the sample and case images.It was determined from the sample images that the color of the crude oil was predominantly brown.A predefined range of RGB values was used to segment out regions that could possibly contain crude oil.However, there were some images in which the color of the crude oil spill was not within the specified RGB range for brown used in the algorithm.Figure 5a shows a case image, OS46, in which the color of the crude oil spill is a mixture of orange and brown.The corresponding color segmented image is shown in Figure 5b, showing that only a small portion of the spill with dark brown color is segmented out as a possible ROI.This is the primary reason why the algorithm was unable to detect the crude oil spill in OS46.Similarly, the color of the crude oil spill in case image OS66 is outside the predefined RGB color range for crude oil, closer to black than brown (see Figure 5c), and is therefore not segmented out in the corresponding color segmentation image shown in Figure 5d.In fact, the crude oil spill is the only region segmented out in Figure 5d.green vegetation during color segmentation.It was observed that the darker the shade of green, the more the algorithm was unable to eliminate the background vegetation during ROI identification and extraction.Figure 4a shows the sample image OS25, an image in which the algorithm failed to identify the crude oil spill.Figure 4b shows the color segmentation result for OS25.Most of the dark green trees and vegetation in the image are still present in the color-segmented image, making it difficult for the algorithm to select the initial ROI that would contain the crude oil spill.Another factor that affected the efficiency of the spill detection algorithm was the color of the crude oil spill in the sample and case images.It was determined from the sample images that the color of the crude oil was predominantly brown.A predefined range of RGB values was used to segment out regions that could possibly contain crude oil.However, there were some images in which the color of the crude oil spill was not within the specified RGB range for brown used in the algorithm.Figure 5a shows a case image, OS46, in which the color of the crude oil spill is a mixture of orange and brown.The corresponding color segmented image is shown in Figure 5b, showing that only a small portion of the spill with dark brown color is segmented out as a possible ROI.This is the primary reason why the algorithm was unable to detect the crude oil spill in OS46.Similarly, the color of the crude oil spill in case image OS66 is outside the predefined RGB color range for crude oil, closer to black than brown (see Figure 5c), and is therefore not segmented out in the corresponding color segmentation image shown in Figure 5d.In fact, the crude oil spill is the only region segmented out in Figure 5d.The sky detection and removal stage of the algorithm also encountered challenges in some spill images.Since the RGB range for various shades of blue overlapped with the range for other colors, only a restricted portion of the full RGB range for blue was selected for the detection of the sky region in a crude oil spill image (if present).This was in addition to the RGB range for the various shades of white.
Figure 6a shows a case image, OS63, and the result of the implementation of the algorithm's sky detection and removal stage is shown in Figure 6b.For this particular case image, the algorithm successfully removed the entire sky region.However for the case image OS51, shown in Figure 6c, the algorithm only succeeded in removing a portion of the sky region (see Figure 6d).This led the algorithm to select the unsegmented sky region as the primary ROI for further analysis (see Figure 6e) and is the reason why the crude oil spill went undetected in this case image.Had a wider RGB range for blue been selected, it is possible that the sky detection and removal for OS51 would have been more successful and would have resulted in the accurate selection of the spill as the primary ROI as opposed to the unsegmented sky region selected in Figure 6e.The sky detection and removal stage of the algorithm also encountered challenges in some spill images.Since the RGB range for various shades of blue overlapped with the range for other colors, only a restricted portion of the full RGB range for blue was selected for the detection of the sky region in a crude oil spill image (if present).This was in addition to the RGB range for the various shades of white.
Figure 6a shows a case image, OS63, and the result of the implementation of the algorithm's sky detection and removal stage is shown in Figure 6b.For this particular case image, the algorithm successfully removed the entire sky region.However for the case image OS51, shown in Figure 6c, the algorithm only succeeded in removing a portion of the sky region (see Figure 6d).This led the algorithm to select the unsegmented sky region as the primary ROI for further analysis (see Figure 6e) and is the reason why the crude oil spill went undetected in this case image.Had a wider RGB range for blue been selected, it is possible that the sky detection and removal for OS51 would have been more successful and would have resulted in the accurate selection of the spill as the primary ROI as opposed to the unsegmented sky region selected in Figure 6e.The sky detection and removal stage of the algorithm also encountered challenges in some spill images.Since the RGB range for various shades of blue overlapped with the range for other colors, only a restricted portion of the full RGB range for blue was selected for the detection of the sky region in a crude oil spill image (if present).This was in addition to the RGB range for the various shades of white.
Figure 6a shows a case image, OS63, and the result of the implementation of the algorithm's sky detection and removal stage is shown in Figure 6b.For this particular case image, the algorithm successfully removed the entire sky region.However for the case image OS51, shown in Figure 6c, the algorithm only succeeded in removing a portion of the sky region (see Figure 6d).This led the algorithm to select the unsegmented sky region as the primary ROI for further analysis (see Figure 6e) and is the reason why the crude oil spill went undetected in this case image.Had a wider RGB range for blue been selected, it is possible that the sky detection and removal for OS51 would have been more successful and would have resulted in the accurate selection of the spill as the primary ROI as opposed to the unsegmented sky region selected in Figure 6e.Even when the algorithm successfully identified the crude oil spill as its primary ROI for further analysis, the presence of weeds and other small vegetation among the spill affected the algorithm's ability to classify that ROI as a crude oil spill.Figure 7a is sample image OS22 containing vegetation within the crude oil spill.Figure 7b shows the primary ROI selected after preprocessing and sky and color segmentation of OS22.The presence of vegetation affected the total area of the crude oil spill selected in the primary ROI.The total area of the final region identified as a crude oil spill in Figure 7c is far less than the area containing the spill in the original case image in Figure 7a.So although the algorithm was able to correctly identify the crude oil spill in the image, the area of the detected crude oil spill was severely impacted by the presence of vegetation.Figure 7d is sample image OS25, for which the algorithm failed to detect the crude oil spill.Note that the algorithm accurately selected the region containing the crude oil spill as its primary ROI for further analysis (see Figure 7e).However, the presence of the weeds among the spill lowered the homogeneity of the correctly identified primary ROI (see Figure 7f), so none of the homogeneous regions identified in the homogeneity analysis were above the set area threshold.As a result, no ROI was identified after the homogeneity analysis was completed (see Figure 7g), and therefore the spill in this image went undetected.Another factor that affected the algorithm's ability to detect crude oil spills in the images was the presence of reflections on the surface of the crude oil surface.When sunlight, vegetation and other objects cast their shadows on the surface of the spill, it alters the natural color of the spill, causing it to fall out of the defined RGB color range for crude oil spills and rendering the algorithm unable to identify such shadowed regions as crude oil spills.Figure 8a is the sample image OS8, which clearly shows a crude oil spill containing not only weeds, but also reflections of the surrounding vegetation, as well as reflections from the sunlight above.The detected crude oil spill from the OS8 is shown in Figure 9b.The algorithm was unable to detect the regions of the crude oil spill with vegetation reflections and weeds.This considerably reduced the area of the crude oil spill detected by the algorithm.Another factor that affected the algorithm's ability to detect crude oil spills in the images was the presence of reflections on the surface of the crude oil surface.When sunlight, vegetation and other objects cast their shadows on the surface of the spill, it alters the natural color of the spill, causing it to fall out of the defined RGB color range for crude oil spills and rendering the algorithm unable to identify such shadowed regions as crude oil spills.Figure 8a is the sample image OS8, which clearly shows a crude oil spill containing not only weeds, but also reflections of the surrounding vegetation, as well as reflections from the sunlight above.The detected crude oil spill from the OS8 is shown in Figure 9b.The algorithm was unable to detect the regions of the crude oil spill with vegetation reflections and weeds.This considerably reduced the area of the crude oil spill detected by the algorithm.Another crucial factor that affected the algorithm's ability to detect crude oil spills was the range of acceptable values chosen for determining the homogeneity of a pixel.Figure 9a is case image OS28. Figure 9b shows the primary ROI selected in OS28 for further analysis.Figure 9c shows the pixels whose grayscale intensity values fall within −5 and +5 of the average grayscale intensity values of their neighboring pixels in a 3 × 3 block.Figure 9d shows the homogeneity ROI extracted from Figure 9c. Figure 9e shows the pixels whose grayscale intensity values fall within −2 and +2 of the average grayscale intensity values of their neighboring pixels in a 3 × 3 block.Figure 9f shows the homogeneity ROI extracted from Figure 9e.The larger homogeneity range selected in Figure 9c enabled the algorithm to detect a portion of the crude oil spill and flag it as being homogeneous in Figure 9d.However, the smaller homogeneity range selected in Figure 9d for the analysis in Figure 9e identified very few pixels meeting that criteria, and as such, the algorithm could not identify any ROI that was homogeneous, as shown in Figure 9f.If the selected homogeneity range is too large, then the algorithm will flag non-crude oil spill regions as spill regions and this will increase the false positives flagged by the algorithm.The range selected for the homogeneity analysis is very important because if the algorithm does not identify a homogeneous ROI, then it will not flag any region in the image as a crude oil spill, regardless of the result of the entropy analysis and the PSD analysis.Another crucial factor that affected the algorithm's ability to detect crude oil spills was the range of acceptable values chosen for determining the homogeneity of a pixel.Figure 9a is case image OS28. Figure 9b shows the primary ROI selected in OS28 for further analysis.Figure 9c shows the pixels whose grayscale intensity values fall within −5 and +5 of the average grayscale intensity values of their neighboring pixels in a 3 × 3 block.Figure 9d shows the homogeneity ROI extracted from Figure 9c. Figure 9e shows the pixels whose grayscale intensity values fall within −2 and +2 of the average grayscale intensity values of their neighboring pixels in a 3 × 3 block.Figure 9f shows the homogeneity ROI extracted from Figure 9e.The larger homogeneity range selected in Figure 9c enabled the algorithm to detect a portion of the crude oil spill and flag it as being homogeneous in Figure 9d.However, the smaller homogeneity range selected in Figure 9d for the analysis in Figure 9e identified very few pixels meeting that criteria, and as such, the algorithm could not identify any ROI that was homogeneous, as shown in Figure 9f.If the selected homogeneity range is too large, then the algorithm will flag non-crude oil spill regions as spill regions and this will increase the false positives flagged by the algorithm.The range selected for the homogeneity analysis is very important because if the algorithm does not identify a homogeneous ROI, then it will not flag any region in the image as a crude oil spill, regardless of the result of the entropy analysis and the PSD analysis.There is a possibility that the presence of water puddles may affect the efficiency of the algorithm to a certain extent.However, the authors anticipate that the color of the water puddles will mostly lie outside the identified RGB range for crude oil and will therefore be eliminated during the Color Segmentation stage as well as the ROI extraction stage.Reflections on the surface of the water may also affect the algorithm's performance in the same way the algorithm was affected by reflections on the surface of crude oil spills.Further tests will be conducted on images containing water to investigate the algorithm's performance in eliminating water puddles and validating its specificity for crude oil spills.The spill detection algorithm developed in this article is intended to be employed by robotic oil spill surveillance systems that employ other methods to detect crude oil spills [48,49].These systems primarily detect crude oil spills by means of gas sensors.However, after successful detection, they obtain and transmit spill images to relevant authorities using an on-board camera.The algorithm developed in this article can be integrated into this system as an additional step in spill verification and quantification.
Although the factors that affected the efficiency of the spill detection algorithm have been discussed in detail, the present algorithm also demonstrated good results for both the sample images and the case images.The specificity of the algorithm was extremely low, meaning that the algorithm displays a very high ability to discriminate between crude oil spills and non-crude oil spills once it has flagged the primary ROI for further analysis.It should be noted that the algorithm presently identifies only one primary ROI for analyzing the presence or absence of crude oil spill.If the algorithm is adjusted to analyze more than one primary ROI, then its sensitivity will improve considerably.This algorithm has demonstrated the ability to effectively detect the presence of crude oil spills in images, and can easily be incorporated into oil spill detection systems using visible sensors for quick and easy detection of crude oil spills.There is a possibility that the presence of water puddles may affect the efficiency of the algorithm to a certain extent.However, the authors anticipate that the color of the water puddles will mostly lie outside the identified RGB range for crude oil and will therefore be eliminated during the Color Segmentation stage as well as the ROI extraction stage.Reflections on the surface of the water may also affect the algorithm's performance in the same way the algorithm was affected by reflections on the surface of crude oil spills.Further tests will be conducted on images containing water to investigate the algorithm's performance in eliminating water puddles and validating its specificity for crude oil spills.The spill detection algorithm developed in this article is intended to be employed by robotic oil spill surveillance systems that employ other methods to detect crude oil spills [48,49].These systems primarily detect crude oil spills by means of gas sensors.However, after successful detection, they obtain and transmit spill images to relevant authorities using an on-board camera.The algorithm developed in this article can be integrated into this system as an additional step in spill verification and quantification.
Although the factors that affected the efficiency of the spill detection algorithm have been discussed in detail, the present algorithm also demonstrated good results for both the sample images and the case images.The specificity of the algorithm was extremely low, meaning that the algorithm displays a very high ability to discriminate between crude oil spills and non-crude oil spills once it has flagged the primary ROI for further analysis.It should be noted that the algorithm presently identifies only one primary ROI for analyzing the presence or absence of crude oil spill.If the algorithm is adjusted to analyze more than one primary ROI, then its sensitivity will improve considerably.This algorithm has demonstrated the ability to effectively detect the presence of crude oil spills in images, and can easily be incorporated into oil spill detection systems using visible sensors for quick and easy detection of crude oil spills.

Conclusions
Crude oil spills have negative consequences on the economy, environment, health and society in which they occur, and the severity of the consequences depends on how quickly these spills are detected once they begin.An algorithm for detecting and identifying crude oil spill in images captured with visible sensors has been developed and presented in this paper.The algorithm was developed using 25 sample images containing crude oil spills and demonstrated a sensitivity of 92% and an FPI of 1.43.The algorithm was further tested on a set of 56 case images and demonstrated a sensitivity of 82% and an FPI of 0.66.This algorithm can be incorporated into spill detection systems that utilize visible sensors for early detection of crude oil spills.Deep based learning oil spill detection can be explored as future work.

Figure 1 .
Figure 1.Land Crude Oil Spill Images.(a) Sample image from sample images; (b) Sample Images from Case Images.
. It involves six major steps.These are image preprocessing, crude oil color segmentation, sky elimination segmentation, Region of Interest (ROI) extraction, ROI texture feature extraction, and ROI texture feature analysis and classification.

Figure 1 .
Figure 1.Land Crude Oil Spill Images.(a) Sample image from sample images; (b) Sample Images from Case Images.

Figure 2 .
It involves six major steps.These are image preprocessing, crude oil color segmentation, sky elimination segmentation, Region of Interest (ROI) extraction, ROI texture feature extraction, and ROI texture feature analysis and classification.
oil spills present in any given image.The algorithm was developed and tested using MATLABTM (The MathworksTM, Natick, MA, USA).

Figure 1 .
Figure 1.Land Crude Oil Spill Images.(a) Sample image from sample images; (b) Sample Images from Case Images.

Figure 4 .
Figure 4. Effect of RGB color range overlap on color segmentation stage in spill detection algorithm.(a) Sample image OS25 with negative spill detection result; (b) Color Segmentation result for OS25 showing algorithm's failure to eliminate dark green vegetation.

Figure 4 .
Figure 4. Effect of RGB color range overlap on color segmentation stage in spill detection algorithm.(a) Sample image OS25 with negative spill detection result; (b) Color Segmentation result for OS25 showing algorithm's failure to eliminate dark green vegetation.

Figure 4 .Figure 5 .
Figure 4. Effect of RGB color range overlap on color segmentation stage in spill detection algorithm.(a) Sample image OS25 with negative spill detection result; (b) Color Segmentation result for OS25 showing algorithm's failure to eliminate dark green vegetation.

Figure 6 .
Figure 6.Sky Detection and Removal Stage.(a) Case Image OS63; (b) Effective Sky Detection and Removal for OS63; (c) Case Image OS51; (d) Ineffective Sky Detection and Removal for OS51; (e) Selection of Sky Region as primary ROI for OS51.

Figure 6 .
Figure 6.Sky Detection and Removal Stage.(a) Case Image OS63; (b) Effective Sky Detection and Removal for OS63; (c) Case Image OS51; (d) Ineffective Sky Detection and Removal for OS51; (e) Selection of Sky Region as primary ROI for OS51.

Figure 6 .
Figure 6.Sky Detection and Removal Stage.(a) Case Image OS63; (b) Effective Sky Detection and Removal for OS63; (c) Case Image OS51; (d) Ineffective Sky Detection and Removal for OS51; (e) Selection of Sky Region as primary ROI for OS51.

Figure 7 .
Figure 7. Effect of Weeds on Crude Oil Spill Detection.(a) Sample Image OS22; (b) primary ROI for OS22 after preprocessing, and sky and color segmentation removal; (c) Identified Crude Oil Spill from OS22; (d) Sample Image OS25; (e) Primary ROI for OS25 after preprocessing, and sky and color segmentation removal; (f) Homogeneity Analysis Result for OS25; (g) Identified Homogeneity ROI for OS25.

Figure 7 .
Figure 7. Effect of Weeds on Crude Oil Spill Detection.(a) Sample Image OS22; (b) primary ROI for OS22 after preprocessing, and sky and color segmentation removal; (c) Identified Crude Oil Spill from OS22; (d) Sample Image OS25; (e) Primary ROI for OS25 after preprocessing, and sky and color segmentation removal; (f) Homogeneity Analysis Result for OS25; (g) Identified Homogeneity ROI for OS25.

Figure 9 .
Figure 9. (a) Case Image OS28; (b) Primary ROI in OS28 identified for further analysis; (c) Pixels meeting homogeneity range of Mean −5 to Mean +5; (d) Final Homogeneity ROI derived from (c); (e) Pixels meeting homogeneity range of Mean −2 to Mean +2; (f) Final Homogeneity ROI derived from

Table 1 .
Spill Detection Algorithm Results on Sample Images.

Table 2 .
Spill Detection Algorithm Results on Case Images.