SlideShare a Scribd company logo
1 of 9
Download to read offline
Requirement:
The objective is to detect cloud.from the rest of the region in visible band.
The output that we get from the CMV4000 camera is in the form of Bayer’s pattern
Figure 1 Bayer Pattern (a)
Why to interpolate?
The raw output of Bayer-filter cameras is referred to as a Bayer pattern image. Since each pixel is filtered
to record only one of three colors, the data from each pixel cannot fully specify each of the red, green,
and blue values on its own. To obtain a full-color image, various demosaicing algorithms can be used
to interpolate a set of complete red, green, and blue values for each pixel. These algorithms make use of
the surrounding pixels of the corresponding colors to estimate the values for a particular pixel.
De-bayering Algorithm
Bilinear interpolation
For a pixel, we consider its 8 direct neighbors and then we determine the 2 missing colors
of this pixel by averaging the colors of the neighboring pixels.
Figure 2 Bayer Pattern (b)
Pixel R33 (Red pixel):
Red = R33
Green = (G23 + G34 + G32 + G43) / 4
Blue = (B22 + B24 + B42 + B44) / 4
Pixel B44 (Blue pixel):
Blue = B44
Green = (R33 + R35 + R53 + R55) / 4
Red = (R33 + R35 + R53 + R55) / 4
Pixel G43 (Green in blue row):
Green = G43
Red = (R33 + R53) / 2
Blue = (B42 + B44) / 2
Pixel G34 (Green in a red row ):
Green = G34
Red = (R33 + R35) / 2
Blue = (B24 + B44) / 2
Why Bilinear interpolation?
Due to its high PSNR ratio
 

pixeli
ii
th
eactualValuValuedemosafced
N
RMSE
RMSE
PSNR
2
10
)(
1
255
log20
Limitations
It will be difficult and time consuming to implement it on the hardware.
Conversion to 8-bit
Now, the 10-bit data is converted to 8-bit data, and the least significant bits are discarded.
Why 8-bit data?
Because we have to deal with intensities in the range of 0-255.
For that we use the intensity difference.
First of all we detect the cloud by converting the RGB image into HIS
Why HSI?
- Because as we can see that it detects the cloud, snow perfectly in RED color, and it
differentiates from the green colored vegetation and water as a combination of blue and green.
- Thin clouds and fog are also detected in combination of RED color.
So we come to a conclusion that after converting the cloud from RGB to HIS we can use RED
component to detect clouds.
Figure 3 Clouds detected in red color and combination of red.
Figure 4 Clouds, fog, snow detected in red color and combination of red.
Clouds, fog, snow detected in red color and combination of red.
Thresholding
Now we apply thresholding to differentiate clouds from other regions [2].
Why thresholding?
Because we do not want to detect the edges, we want to detect the whole area pixel by pixel and that is
possible through thresholding.
Threshold Details
Standard Deviation
N
xx 

2
)(

Where,
 =the standard deviation
x =each value in the population(total values)
x =the mean of the values
N =the number of values(the population)
For calculating mean,
x =
i
y
ni
i
i

0
Where,
x =mean
y(pixel intensity)[0,255]
n=number of pixels
Median For calculating median
T=
2
maxmin
Where,
T=threshold
min=minimum intensity of pixel
max=maximum intensity of pixel
Limitations:
 The major problem with thresholding is that we consider only the intensity, not any
Relationships between the pixels. There is no guarantee that the pixels identified by
thresholding process are contiguous.
 The problem is also reflected in result. This algorithm cannot detect ultra thin clouds and light
fog. If the threshold value is decreased so other object like sand and soil is detected because the
intensity of thin clouds, fog and sand is nearly same.
Results:
Threshold
Standard
Deviation
Median
Table 1 Visual comparison of different threshold
Histogram Equalization
Reasons:
 It gives contrast between different objects like clouds, water, snow, vegetation, soil, sand etc.
 The intensity of cloud and snow is high compare to vegetation, water, soil and sand. After
applying histogram equalization it gives contrast between above objects. Clouds and snow has
high contrast, So it is easy to detect the clouds after applying threshold.
 In other words, we can say that Histogram equalization works as filter.
Calculations:
Consider a discrete grey scale image {x} and let ni be the number of occurrences of gray level i. The
probability of an occurrence of a pixel of level i in the image is
Li
n
n
ixpiP i
x  0,)()(
L being the total number of gray levels in the image (typically 256), n being the total number of pixels in
the image, and )(ipx being in fact the image's histogram for pixel value i, normalized to [0,1].
Let us also define the cumulative distribution function corresponding to px as
)()(
0
jpicdf
i
j
xx 

Which is also the image's accumulated normalized histogram.
We would like to create a transformation of the form y = T(x) to produce a new image {y}, with a flat
histogram. Such an image would have a linearized CDF across the value range, i.e.
iKicdfy )(
For some constant K. The properties of the CDF allow us to perform such a transform (see Inverse
distribution function); it is defined as
)()( kcdfkTy x
Where k is in the range [0,L). Notice that T maps the levels into the range [0,1], since we used a
normalized histogram of {x}. In order to map the values back into their original range, the following
simple transformation needs to be applied on the result:
}min{})min{}(max{*' xxxyy 
In below example L belongs to [0,255].
Because grey scale image has 8 –bit depth









 )1(*
)*(
)(
)(
min
min
L
cdfNM
cdfvcdf
roundvh
Where cdfmin is the minimum non-zero value of the cumulative distribution function (in this case 1), M ×
N gives the image's number of pixels.
M=width and N=height
Limitations:
 Histogram equalization can produce undesirable effects when it is applied on low color depth.
 It works based on global threshold value.
 The problem is also reflected in the result. In some images the intensity of shadow of object, the
thin clouds and sand will map into the one class when applying equalization operation. So it is
difficult to distinguish thin cloud in image.
Results:
Algorithm
Histogram
Equalization
Table 2 Visual result of histogram equalization
Otsu Clustering:
Reasons:
Due to unsatisfactory results from the above two approaches we decided to go for segmentation through
Otsu’s method.
Working
We use Otsu’s method to segment the input photograph into candidate cloud regions and non-
cloud regions, which can receive a coarse cloud detection result.
Otsu’s method assumes that the photograph to be thresholded contains two classes of pixels or a
bimodal histogram (for example, foreground and background) and then calculates the optimal
threshold separating those two classes so that their interclass variance is maximum.
Algorithm:
Algorithm Steps:
1. Compute histogram and probabilities of each intensity level
2. Set up initial )0(i and )0(i
Where,
)0(i
: Initial probability
)0(i
: Initial mean
3. Step through all possible thresholds t=1….. maximum intensity
1. Update i and i
2. Compute )(2
tb
where
)(2
tb
: intra class variance
4. Desired threshold corresponds to the maximum )(2
tb
5. You can compute two maxima (and two corresponding thresholds). )(2
1 tb is the greater max
and )(2
2 tb is the greater or equal maximum
Where,
)(2
1 tb
: Class 1 variance
)(2
2 tb
: Class 2 variance
6. Desired threshold = 2
21 ThresholdThreshold 
Results:
Algorithm
OTSU
clustering
Table 3 Visual result of Otsu clustering
Limitations:
 The method does not work well with variable illumination.
 Above drawbacks also reflect in results, algorithm does not detect thin clouds and light fog.
References:
1. Shrivastava, P. "Cloud Detection with MATLAB." Journal of Engineering Science and
Technology Review 6, no. 1 (2013): 68-71.
2. Jedlovec, Gary J., and Kevin Laws. "Operational cloud detection in GOES imagery." In 11th
conference on Satellite Meteorology and Oceanography, vol. 357. Madison: Univ of WI,
Madison, 2001.

More Related Content

What's hot

Double Patterning
Double PatterningDouble Patterning
Double PatterningDanny Luk
 
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSINGLAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSINGPriyanka Rathore
 
Icdecs 2011
Icdecs 2011Icdecs 2011
Icdecs 2011garudht
 
Intensity Transformation
Intensity TransformationIntensity Transformation
Intensity TransformationAmnaakhaan
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture FetchMark Kilgard
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
imageCorrectionLinearDiffusion
imageCorrectionLinearDiffusionimageCorrectionLinearDiffusion
imageCorrectionLinearDiffusionKellen Betts
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniquesSaideep
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portionMoe Moe Myint
 
Planetary Science Assignment Help
Planetary Science Assignment HelpPlanetary Science Assignment Help
Planetary Science Assignment HelpEdu Assignment Help
 
Spatial enhancement
Spatial enhancement Spatial enhancement
Spatial enhancement abinarkt
 
Efficient Technique for Image Stenography Based on coordinates of pixels
Efficient Technique for Image Stenography Based on coordinates of pixelsEfficient Technique for Image Stenography Based on coordinates of pixels
Efficient Technique for Image Stenography Based on coordinates of pixelsIOSR Journals
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...Hemantha Kulathilake
 

What's hot (19)

Double Patterning
Double PatterningDouble Patterning
Double Patterning
 
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSINGLAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
LAPLACE TRANSFORM SUITABILITY FOR IMAGE PROCESSING
 
Icdecs 2011
Icdecs 2011Icdecs 2011
Icdecs 2011
 
Intensity Transformation
Intensity TransformationIntensity Transformation
Intensity Transformation
 
Anatomy of a Texture Fetch
Anatomy of a Texture FetchAnatomy of a Texture Fetch
Anatomy of a Texture Fetch
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
imageCorrectionLinearDiffusion
imageCorrectionLinearDiffusionimageCorrectionLinearDiffusion
imageCorrectionLinearDiffusion
 
Image enhancement techniques
Image enhancement techniquesImage enhancement techniques
Image enhancement techniques
 
Rough K Means - Numerical Example
Rough K Means - Numerical ExampleRough K Means - Numerical Example
Rough K Means - Numerical Example
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
Spatial domain and filtering
Spatial domain and filteringSpatial domain and filtering
Spatial domain and filtering
 
OpenGL Texture Mapping
OpenGL Texture MappingOpenGL Texture Mapping
OpenGL Texture Mapping
 
Planetary Science Assignment Help
Planetary Science Assignment HelpPlanetary Science Assignment Help
Planetary Science Assignment Help
 
Spatial enhancement
Spatial enhancement Spatial enhancement
Spatial enhancement
 
SPATIAL FILTER
SPATIAL FILTERSPATIAL FILTER
SPATIAL FILTER
 
Efficient Technique for Image Stenography Based on coordinates of pixels
Efficient Technique for Image Stenography Based on coordinates of pixelsEfficient Technique for Image Stenography Based on coordinates of pixels
Efficient Technique for Image Stenography Based on coordinates of pixels
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
COM2304: Intensity Transformation and Spatial Filtering – I (Intensity Transf...
 

Viewers also liked

Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...
Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...
Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...Nordnet Suomi
 
γιατρός με το στανιό
γιατρός με το στανιόγιατρός με το στανιό
γιατρός με το στανιόaglaia vouza
 
RESUME - KRISHNA DAS (OPS )
RESUME - KRISHNA DAS (OPS )RESUME - KRISHNA DAS (OPS )
RESUME - KRISHNA DAS (OPS )KRISHNA DAS
 
Pixel arte y naturaleza
Pixel arte y naturalezaPixel arte y naturaleza
Pixel arte y naturalezagomezana1
 
Anatomy of a UI Control - Extension Library Case Study
Anatomy of a UI Control - Extension Library Case StudyAnatomy of a UI Control - Extension Library Case Study
Anatomy of a UI Control - Extension Library Case Studygregorbyte
 
Slide Modulo2_IT METHODOS AULA
Slide Modulo2_IT METHODOS AULASlide Modulo2_IT METHODOS AULA
Slide Modulo2_IT METHODOS AULAMario Marzolo
 
Advanced rich push notifications
Advanced rich push notificationsAdvanced rich push notifications
Advanced rich push notificationsErdem Yılmaz
 
Introduction to Grammar and Verbless Clauses
Introduction to Grammar and Verbless ClausesIntroduction to Grammar and Verbless Clauses
Introduction to Grammar and Verbless ClausesBrian Tucker
 
Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017
Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017
Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017Progressive Governors Forum (PGF)
 

Viewers also liked (15)

Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...
Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...
Nordnetin Taaleritehdas-aamiaistilaisuus 9.9.2014: analyytikko Sauli Vilén, I...
 
Presentation by charles soludo at 4th PGLS, Aug. 2016
Presentation by charles soludo at 4th PGLS, Aug. 2016Presentation by charles soludo at 4th PGLS, Aug. 2016
Presentation by charles soludo at 4th PGLS, Aug. 2016
 
Condolence for late mrs. hannah idowu dideolu
Condolence for late mrs. hannah idowu dideoluCondolence for late mrs. hannah idowu dideolu
Condolence for late mrs. hannah idowu dideolu
 
γιατρός με το στανιό
γιατρός με το στανιόγιατρός με το στανιό
γιατρός με το στανιό
 
Lucerovalverderuiz
LucerovalverderuizLucerovalverderuiz
Lucerovalverderuiz
 
RESUME - KRISHNA DAS (OPS )
RESUME - KRISHNA DAS (OPS )RESUME - KRISHNA DAS (OPS )
RESUME - KRISHNA DAS (OPS )
 
Pixel arte y naturaleza
Pixel arte y naturalezaPixel arte y naturaleza
Pixel arte y naturaleza
 
Anatomy of a UI Control - Extension Library Case Study
Anatomy of a UI Control - Extension Library Case StudyAnatomy of a UI Control - Extension Library Case Study
Anatomy of a UI Control - Extension Library Case Study
 
Slide Modulo2_IT METHODOS AULA
Slide Modulo2_IT METHODOS AULASlide Modulo2_IT METHODOS AULA
Slide Modulo2_IT METHODOS AULA
 
Advanced rich push notifications
Advanced rich push notificationsAdvanced rich push notifications
Advanced rich push notifications
 
Introduction to Grammar and Verbless Clauses
Introduction to Grammar and Verbless ClausesIntroduction to Grammar and Verbless Clauses
Introduction to Grammar and Verbless Clauses
 
Powerpoints
PowerpointsPowerpoints
Powerpoints
 
Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017
Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017
Welcome address by he nasir el rufai at pgf capacity devt session in kaduna 2017
 
Rúbrica reto 2
Rúbrica reto 2Rúbrica reto 2
Rúbrica reto 2
 
Sokoto State Interim Report Recommendations on Education
Sokoto State Interim Report Recommendations on EducationSokoto State Interim Report Recommendations on Education
Sokoto State Interim Report Recommendations on Education
 

Similar to Algorithm

Image processing
Image processingImage processing
Image processingmaheshpene
 
Compression using JPEG
Compression using JPEGCompression using JPEG
Compression using JPEGSabih Hasan
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoringguest7782414
 
OTSU Thresholding Method for Flower Image Segmentation
OTSU Thresholding Method for Flower Image SegmentationOTSU Thresholding Method for Flower Image Segmentation
OTSU Thresholding Method for Flower Image Segmentationijceronline
 
Image Segmentation.ppt
Image Segmentation.pptImage Segmentation.ppt
Image Segmentation.pptakshaya870130
 
ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).pptNoorUlHaq47
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.pptAVUDAI1
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.pptDEEPUKUMARR
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...mmjalbiaty
 
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligencechAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligenceshesnasuneer
 
computervision1.pptx its about computer vision
computervision1.pptx its about computer visioncomputervision1.pptx its about computer vision
computervision1.pptx its about computer visionshesnasuneer
 
Basics of CT- Lecture 9.ppt
Basics of CT- Lecture 9.pptBasics of CT- Lecture 9.ppt
Basics of CT- Lecture 9.pptMagde Gad
 
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION cscpconf
 

Similar to Algorithm (20)

3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
Image processing
Image processingImage processing
Image processing
 
Report
ReportReport
Report
 
Compression using JPEG
Compression using JPEGCompression using JPEG
Compression using JPEG
 
Automatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather MonitoringAutomatic Classification Satellite images for weather Monitoring
Automatic Classification Satellite images for weather Monitoring
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
OTSU Thresholding Method for Flower Image Segmentation
OTSU Thresholding Method for Flower Image SegmentationOTSU Thresholding Method for Flower Image Segmentation
OTSU Thresholding Method for Flower Image Segmentation
 
DIP Lecture 7-9.pdf
DIP Lecture 7-9.pdfDIP Lecture 7-9.pdf
DIP Lecture 7-9.pdf
 
Image Segmentation.ppt
Image Segmentation.pptImage Segmentation.ppt
Image Segmentation.ppt
 
ImageSegmentation (1).ppt
ImageSegmentation (1).pptImageSegmentation (1).ppt
ImageSegmentation (1).ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
ImageSegmentation.ppt
ImageSegmentation.pptImageSegmentation.ppt
ImageSegmentation.ppt
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
www.ijerd.com
www.ijerd.comwww.ijerd.com
www.ijerd.com
 
Histogram processing
Histogram processingHistogram processing
Histogram processing
 
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
Image Interpolation Techniques with Optical and Digital Zoom Concepts -semina...
 
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligencechAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
 
computervision1.pptx its about computer vision
computervision1.pptx its about computer visioncomputervision1.pptx its about computer vision
computervision1.pptx its about computer vision
 
Basics of CT- Lecture 9.ppt
Basics of CT- Lecture 9.pptBasics of CT- Lecture 9.ppt
Basics of CT- Lecture 9.ppt
 
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
PERFORMANCE EVALUATION OF DIFFERENT TECHNIQUES FOR TEXTURE CLASSIFICATION
 

Algorithm

  • 1. Requirement: The objective is to detect cloud.from the rest of the region in visible band. The output that we get from the CMV4000 camera is in the form of Bayer’s pattern Figure 1 Bayer Pattern (a) Why to interpolate? The raw output of Bayer-filter cameras is referred to as a Bayer pattern image. Since each pixel is filtered to record only one of three colors, the data from each pixel cannot fully specify each of the red, green, and blue values on its own. To obtain a full-color image, various demosaicing algorithms can be used to interpolate a set of complete red, green, and blue values for each pixel. These algorithms make use of the surrounding pixels of the corresponding colors to estimate the values for a particular pixel. De-bayering Algorithm Bilinear interpolation For a pixel, we consider its 8 direct neighbors and then we determine the 2 missing colors of this pixel by averaging the colors of the neighboring pixels. Figure 2 Bayer Pattern (b)
  • 2. Pixel R33 (Red pixel): Red = R33 Green = (G23 + G34 + G32 + G43) / 4 Blue = (B22 + B24 + B42 + B44) / 4 Pixel B44 (Blue pixel): Blue = B44 Green = (R33 + R35 + R53 + R55) / 4 Red = (R33 + R35 + R53 + R55) / 4 Pixel G43 (Green in blue row): Green = G43 Red = (R33 + R53) / 2 Blue = (B42 + B44) / 2 Pixel G34 (Green in a red row ): Green = G34 Red = (R33 + R35) / 2 Blue = (B24 + B44) / 2 Why Bilinear interpolation? Due to its high PSNR ratio    pixeli ii th eactualValuValuedemosafced N RMSE RMSE PSNR 2 10 )( 1 255 log20 Limitations It will be difficult and time consuming to implement it on the hardware. Conversion to 8-bit Now, the 10-bit data is converted to 8-bit data, and the least significant bits are discarded.
  • 3. Why 8-bit data? Because we have to deal with intensities in the range of 0-255. For that we use the intensity difference. First of all we detect the cloud by converting the RGB image into HIS Why HSI? - Because as we can see that it detects the cloud, snow perfectly in RED color, and it differentiates from the green colored vegetation and water as a combination of blue and green. - Thin clouds and fog are also detected in combination of RED color. So we come to a conclusion that after converting the cloud from RGB to HIS we can use RED component to detect clouds. Figure 3 Clouds detected in red color and combination of red. Figure 4 Clouds, fog, snow detected in red color and combination of red. Clouds, fog, snow detected in red color and combination of red.
  • 4. Thresholding Now we apply thresholding to differentiate clouds from other regions [2]. Why thresholding? Because we do not want to detect the edges, we want to detect the whole area pixel by pixel and that is possible through thresholding. Threshold Details Standard Deviation N xx   2 )(  Where,  =the standard deviation x =each value in the population(total values) x =the mean of the values N =the number of values(the population) For calculating mean, x = i y ni i i  0 Where, x =mean y(pixel intensity)[0,255] n=number of pixels Median For calculating median T= 2 maxmin Where, T=threshold min=minimum intensity of pixel max=maximum intensity of pixel Limitations:  The major problem with thresholding is that we consider only the intensity, not any Relationships between the pixels. There is no guarantee that the pixels identified by thresholding process are contiguous.
  • 5.  The problem is also reflected in result. This algorithm cannot detect ultra thin clouds and light fog. If the threshold value is decreased so other object like sand and soil is detected because the intensity of thin clouds, fog and sand is nearly same. Results: Threshold Standard Deviation Median Table 1 Visual comparison of different threshold
  • 6. Histogram Equalization Reasons:  It gives contrast between different objects like clouds, water, snow, vegetation, soil, sand etc.  The intensity of cloud and snow is high compare to vegetation, water, soil and sand. After applying histogram equalization it gives contrast between above objects. Clouds and snow has high contrast, So it is easy to detect the clouds after applying threshold.  In other words, we can say that Histogram equalization works as filter. Calculations: Consider a discrete grey scale image {x} and let ni be the number of occurrences of gray level i. The probability of an occurrence of a pixel of level i in the image is Li n n ixpiP i x  0,)()( L being the total number of gray levels in the image (typically 256), n being the total number of pixels in the image, and )(ipx being in fact the image's histogram for pixel value i, normalized to [0,1]. Let us also define the cumulative distribution function corresponding to px as )()( 0 jpicdf i j xx   Which is also the image's accumulated normalized histogram. We would like to create a transformation of the form y = T(x) to produce a new image {y}, with a flat histogram. Such an image would have a linearized CDF across the value range, i.e. iKicdfy )( For some constant K. The properties of the CDF allow us to perform such a transform (see Inverse distribution function); it is defined as )()( kcdfkTy x Where k is in the range [0,L). Notice that T maps the levels into the range [0,1], since we used a normalized histogram of {x}. In order to map the values back into their original range, the following simple transformation needs to be applied on the result: }min{})min{}(max{*' xxxyy  In below example L belongs to [0,255].
  • 7. Because grey scale image has 8 –bit depth           )1(* )*( )( )( min min L cdfNM cdfvcdf roundvh Where cdfmin is the minimum non-zero value of the cumulative distribution function (in this case 1), M × N gives the image's number of pixels. M=width and N=height Limitations:  Histogram equalization can produce undesirable effects when it is applied on low color depth.  It works based on global threshold value.  The problem is also reflected in the result. In some images the intensity of shadow of object, the thin clouds and sand will map into the one class when applying equalization operation. So it is difficult to distinguish thin cloud in image. Results: Algorithm Histogram Equalization Table 2 Visual result of histogram equalization
  • 8. Otsu Clustering: Reasons: Due to unsatisfactory results from the above two approaches we decided to go for segmentation through Otsu’s method. Working We use Otsu’s method to segment the input photograph into candidate cloud regions and non- cloud regions, which can receive a coarse cloud detection result. Otsu’s method assumes that the photograph to be thresholded contains two classes of pixels or a bimodal histogram (for example, foreground and background) and then calculates the optimal threshold separating those two classes so that their interclass variance is maximum. Algorithm: Algorithm Steps: 1. Compute histogram and probabilities of each intensity level 2. Set up initial )0(i and )0(i Where, )0(i : Initial probability )0(i : Initial mean 3. Step through all possible thresholds t=1….. maximum intensity 1. Update i and i 2. Compute )(2 tb where )(2 tb : intra class variance 4. Desired threshold corresponds to the maximum )(2 tb 5. You can compute two maxima (and two corresponding thresholds). )(2 1 tb is the greater max and )(2 2 tb is the greater or equal maximum Where, )(2 1 tb : Class 1 variance
  • 9. )(2 2 tb : Class 2 variance 6. Desired threshold = 2 21 ThresholdThreshold  Results: Algorithm OTSU clustering Table 3 Visual result of Otsu clustering Limitations:  The method does not work well with variable illumination.  Above drawbacks also reflect in results, algorithm does not detect thin clouds and light fog. References: 1. Shrivastava, P. "Cloud Detection with MATLAB." Journal of Engineering Science and Technology Review 6, no. 1 (2013): 68-71. 2. Jedlovec, Gary J., and Kevin Laws. "Operational cloud detection in GOES imagery." In 11th conference on Satellite Meteorology and Oceanography, vol. 357. Madison: Univ of WI, Madison, 2001.