Development of an Improved Algorithm for Image Processing : A Proposed Algorithm for Optimal Reduction of Shadow from the Image

Shadow detection is the most important aspect in the field of image processing. It has become essential to develop such algorithms that are capable of processing the images with the maximum efficiency. Therefore, the research has aimed to propose an algorithm that effectively processes the image on the basis of shadow reduction. An algorithm has been proposed, which was based on RGB (red, green, and blue) and HIS (hue, saturation and intensity) model. Steps for Shadow detection have been defined. Median filter and colour saturation have been widely used to process the outcomes. Algorithm has proved efficient for the detection of shadow from the images. It was found efficient when compared with two previously developed algorithms. 87% efficiency has been observed, implementing the proposed algorithm as compared to the algorithms implemented previously by other researchers. The study proved to make a supportive effort in the development of optimized algorithm. It has been suggested that the market requires such practices that can be used to improve the working conditions of the image processing paradigm. Keywords—Image; processing; shadow; algorithm; detection filter; luminance; morphological processing


I. INTRODUCTION
Digital signal processing is a field, which comprises of data image processing as it has many benefits over analogy image processing.It allows broad range of algorithms to be implemented to the input information and can prevent problems; such as, the noise creation and signal distortion during processing [1].A digital image is made up of a predetermined number of elements; including, picture element, image element, and pixels [2].The elements of the digital image are usually termed as pixel.Digital image processing embraces an extensive and diverse field of applications.Under the strict decorum of the digital image processing and the computer aided peripherals, the image transformation and development have made it into the physical domains to smoothen the procedural flows of the paradigm [3]- [4].
Image processing operations can be categorized into three broad divisions, which include image compression, image enhancement and restoration, and measurement extraction [1].The digital image processing comprises of several steps of image representation as shown in Fig. 1 and 2. Such structure is used and applied by many authors and referred clearly in [1]- [3].The characterization of the quantity that is represented by each picture element is the major concern of the image representation.Luminance of the objects in a scene can be represented by an image along with the temperature profile of the region, absorption characteristics of the body tissue, and gravitational field in the area.Generally, two dimensional functions bearing information can be deliberated as an image.An essential and significant consideration in image representation is the intelligibility and fidelity criteria for measuring the image quality or the processing technique performance.Stipulations of such measures need spatial frequencies, models of perception, colours, and so on.The images need to be quantized and sampled for the digital image processing.The sample rates are big enough to preserve the essential data in an image.Bandwidth of an image is able to determine it efficiently.
The goal of the image enhancement is to highlight different image features for image display and ensuing analysis.Contrast and edge enhancement, noise filtering, pseudo colouring, magnifying, and sharpening are the examples of image enhancement.It does not increase the fundamental information display, but it simply focuses on some specified image categorization.Enhancement algorithms are usually dependent and interactive.It may include noise filtrations, de-blurring of images degraded by environment or its sensor's limitations, and corrections of non-linearity because of sensors [4].www.ijacsa.thesai.org The data related with the visual information is sometimes heavy that it needs huge storage capabilities.Image data compression techniques are associated with the reduction of bits needed to transmit or store images without any substantial loss of data [5].Data compression is important in medical images, business, and educational documents due to their wide applications.During image acquisition of digitization and transmission, the main source of noise in digital images arises.Due to several factors; including the quality of the sensing elements and environmental conditions, the performance of the imaging sensors is affected.
In the evident knowledge provided by the physics law, shadow may tend to exhibit multiple properties subjected to the angle and the intensity of the light that is striking the surface.Shadows are the physical attributes that are owned by the object.However, the shadows tend to create some serious problems in computational domains.Some of the serious problems may be created in the field of computer vision applications; like object detection, object counting, and segmentation [6].The computers have been programmed to visualize the world in the form of bits.In the case of colour images, it may differ subjected to the type of platform that is being used to render the image.A study by [7] presented a framework to automatically detect and remove shadows in natural scenes from a single image.A lot of efforts are made in designing invariant hand-crafted and shadow variant features.In comparison, the proposed framework automatically learnt the most associated features in an appropriate supervised condition, utilizing multiple convolutional deep neural networks (ConvNets).The features were learned at the super-pixel level along the dominant boundaries in the image.The proposed framework persistently performed better than the state-of-the-art on all main shadow databases, gathered under different conditions.Shadow removal has been noted as the prominent tasks in the field of the computer visions.However, it is thought of as critical tasks to carry out due to the excessive processing of the images.Although, multiple efforts have been previously made to remove the shadow from the image; yet, there is an ample room for improvisation of the practices.The production of shadow free images has been the primary interest of the experts; thus, adaptive efforts have been induced in the field to eradicate the constraining problems and help in the production of shadow free images.
The study primarily focused on the removal or the reduction of the shadow; therefore, it was decided to keenly focus on the shadow compensation.With having regular assumption of the fact that, the shadow will be previously identified, the development of the algorithm has been made to just accept the image, previously identified with the shadow.The shadow compensation approach has been developed on a simple model, where the lighting was comprised of the environment lights as well as the direct light.

II. METHODOLOGY
A shadow removal algorithm has been proposed and the development of the algorithm was primarily based on the usage of RGB (red, green, blue) model.The algorithm was operated based on CMYK (cyan, magenta, yellow, and kleen) model.The developed algorithm first transformed the image into HSI (hue, saturation and intensity) colour model of the RGB domain.The image can be further transformed into its subsequent counter parts.Trailing transformation was based on HSV (hue, saturation and value) model, luma, blue difference chroma, red difference chroma (YCbCr), HCV (hue chroma and value) or YIQ (luminance, hue and saturation) colour models.
As per the flow of algorithm, the image has been supplied as the input and then further be applied with median filter to remove the existence of noisy components.Later, the below mentioned equations have been used to transform the image from the RGB model to its subsequent HSI colour mode [8], [9].
Step 1: The below mentioned (1), ( 2) and ( 3) were used to transform the image from the RGB model to its subsequent HSI colour mode [8], [9].The derived parameters have been set to be as the significant attributes of the algorithm.

V2=Higher intensity
Ie and He= bound ranges of the colour schemes [0, 255].
Step 2: Equation 4 holds the value of R1 as the intensity of red component in the image.On the other hand, H and I are representing the values respectively.Furthermore, to vary the pixel range of the provided image, one can simply use the ratios as the exponential ratios of the power empirical values that are supposed to be ranging from 0.5 to 0.7.On further manipulation of the values, the numbers has been provided in the form of ratios as: (4) Step 3: Equation 5 and 6 are the representation of the values that have been obtained from the mathematical evaluation of the empirical values of the aspect ratios.Both of the values are the derived by the multiplicative exponent (^) of R1.
(5) (6) The derived algorithm has been based on the extensive application of the median filter to remove the maximum noise from the image.Therefore, the algorithm has been divided into two significant halves that can ease the operations to be www.ijacsa.thesai.orgunderstood by the readers.Flow charts can be interpreted as the core basics of the image transformation.The transformation is on the basis of the shadow removal.Thus, a generic pseudo code is mentioned below: 1) The image shall be acquired with keeping in mind that the image has shaded part in it.
2) Later the image shall be passed on through a median filter to smoothen the image.
3) Following it shall be the RGB to HSI conversion on the basis of the model mentioned above.
4) The ratio map shall narrate the number of shaded and non-shaded pixel.
5) The image then shall be morphologically dilated and then be converted to binary format.
6) The numbers shall be on the basis of the 0-255 colours present in the digital scheme.It shall then be converted to a matrix and then can be further accessed individually.
7) The ratio of the images values shall tell that, the image has some shadow in it.
8) It shall bring an end to the shadow detection part. 1) The separated image can be checked for the intensity of the shaded pixels.
2) If the intensity is greater than the threshold value; there shall be no change in the image; thus, the shadow has been compensated.
3) The threshold shall be calculated using the Otsu's threshold estimation method.
4) The Otsu's threshold estimation method computes the threshold value by dividing the image in two classes.The two classes are then computed on the basis of the minimum and the maximum value of the pixels.Therefore, it calculates the optimal threshold value by combining the spread pixels into their inter class variance in the maximum value.
5) Else, the image will be tracked for the intensity and then further be reduced for the threshold value.Finally, the image shall be cut free from the shadow.
The other algorithm (alternate algorithm) involved the enhancement steps, which can be defined as a Median technique.A new method of enhancement can be efficiently organized for the shadow detection and filling process.It can be analyzed in the following sequence: Step 1: Performing the enhancement technique after shadow detection.
Step 2: The locations x and y intensity was established for shadow detection in a vector.
Step 3: Iteration technique was applied for each of the segments, which contain shadow.It may include forward, backward, and central techniques to explore the best values of filling every intensity at x and y intensity levels.This process was repeated until no difference between the values of intensities between iteration (n) and iteration (n+1) or (the absolute of difference) is observed.It may be less than or equal to some value equal to 0.001.Integer values were presented, when such values were obtained.
Step 4: Once the shadow area was filled and finished, the techniques of enhancement and noise removal were applied at the area of shadow detection.This notion is similar to that of the re-touching process, which can be done manually by the developers of image photographer.

III. ANALYSIS OF PROPOSED ALGORITHM
In order to compensate the shadow, it was necessary to get hold of the pixel wise product of I by performing the scaling of image b such that: (9) Where,

Ic= shadow of the compensated image bI= scale at which shadow is compensated
The value of b will be achieved on the basis of pixels present in the study.The study has implemented the algorithm on MATLAB 2010 to provide authentic proofs of the optimization of the newly derived algorithm.It was aimed to compare the current algorithm with two of the pre-existing www.ijacsa.thesai.orgmodels for verifying the effectiveness of new model.The previously developed algorithms, as proposed in [10], [11], have made the primary counter parts to test the algorithm.Three accuracy measures were used as the primary source in the objective evaluation.The first type of accuracy measure is the producer's accuracy that contains two parameters PS and PN.Thus, they are defined as: Producer's accuracy:

PS (PN) = number of correctly detected true shadow non pixels
The second type of the accuracy measure is the users' accuracy that is represented in the form of AS and AN that are further interpreted as: Users Accuracy: (10) ( 11) AS (AN) = ratio of the number of pixels of true pixels identified

AN= non-shadow pixels
The combined sum of accuracies related to users and the producers can be used to derive the third type of accuracy measure; that is generally named as overall accuracy and further denoted by τ.Further mathematical evaluation of the overall accuracy is represented as: (12) The above mentioned equation calculates the overall results on the basis of overall values that have been achieved from the evaluation of system.Since, all of the parameters have to be considered in the best of output state; thus, the results shall be totally in the correspondence of stated variables.In the above mentioned equation, TP + TN denotes to the number of correctly detected true pixels of true shadowed and the non-shadowed area.On the other hand, TP + TN + FP + FN are equal to the number of total pixels in the image.The images will be screened for the reduction of shadows in the test subject.Further, the results have been carried out on the basis of comparison between the available algorithms.The algorithms have been developed on MATLAB, and further execution has been made accordingly.

IV. RESULTS AND DISCUSSION
In order to prove that the algorithm is capable of removing the shadow, the image has been tested from the processed image.The results have been displayed below in Fig. 4(a)-4(d): Authors [10], [11] have made the primary counter parts to test the algorithm that were applied to obtain the verification of the outcomes.Fig. 5(a)-5(d) are representing the actual results that were produced by running them on each algorithm.The models thus confirmed that the newly derived algorithm has been highly effective in detecting the shadow that is mentioned in the picture.I has justified the results that have been previously explained in Fig. 3 and 4. The table has also narrated that the development of new algorithm has been one of the best alternatives that can be used to carry out the routine shadow detection task.Its operational effectiveness is prominently higher than the ones that have been previously developed.Therefore, the proposed algorithm can be extensively used in the domain to maximize the output that may be gained by the application of the method.
The study by [12] described a method for the removal of shadows in RGB images.The shadows considered were along with hard borders.The model proposed in the analysis begins with the colour segmentation of image, and it was confirmed by the inspection of its neighbouring segment.Authors in [13] used a method to remove the shadows by minimizing the borders in an edge representation of image.It was then reintegrated by using the method proposed in [14].It has been implemented for all the colour channels, and leaves a shadow free colour image.Contrasting different techniques, the method proposed requires neither a calibrated camera nor multiple images.Significant improvements have been observed by the analysis.The study has analysed similar outcome as the present study did.The used algorithms have efficiently detected the shadows as shown in Fig. 6.
Custom capture can be used by the shadow removal techniques operating on RGB images.For instance, user interaction, narrow-band camera, specialized algorithms using gradient and texture based similarity, and Euclidean and chromaticity similarity, but depth cues are not used [15].Surface normal can be determined and occluding association can be contingent, both of which are vital to robust the shadow removal from the images [16].An interactive technique was proposed by [17], which allows the users to highlight shadowed and un-shadowed samples with same textures and later uses an energy minimization technique to solve original shadows.Authors in [18] and [19] proposed a user interaction approach for the shadow removal process.The high complexity of shadows is represented as a result of comparison with interactive techniques [20].
Authors in [12], [13] have also developed the algorithm to detect and reduce the shadow on the digital image.The present study has applied the proposed algorithm on the field image similar to that of [12] and [13] (Fig. 6).Fig. 6(a) is the original image on which the shadow detection algorithm was applied; Fig. 6(b) shows the shadow detected from the applied algorithm; Fig. 6(c) shows the shadow detected is then removed by applying proposed algorithm; and Fig. 6(d) shows the final image after applying the proposed shadow removal algorithm by [12] and [13].
The proposed algorithms have better been found with the estimation of colours related with replaced flag pole shadow as compared by the other methods proposed in the study (Fig. 7).Misclassification of dark objects or less illuminated as shadow regions usually cause complexes in achieving the aim of high accuracy for shadow detection algorithm.It has been evaluated that the proposed approach has successfully managed with misclassification issues of dark objects.Through the comparison of outcomes with other studies, the present study proves best performance concerning the accuracy of shadow detection.Fig. 9 has shown that the shadow detection and removal of the image having dark background; such as reddish and brownish could not provide clear results as provided by the findings, obtained in Fig. 8. Further, Fig. 8 shows that the image with background "green" colour has resulted better than the image having background with much "red" colour.

V. CONCLUSION
This paper focuses on the problem of the removal and the reduction of the shadow from the image.This problem is interesting and important.The paper uses HIS colour model, median filter, morphological dilation, and Otsu's thresholding methods to tackle the shadow removal and reduction problem.Though the problem is important, the work in this paper has the following issues: The methods face significant simplicity to generalize and comparison with state-of-the-art excellent methods which use the practical shadow detection and removal.Both methodology and performance comparisons are encouraged user to depend on for more development.
The outcomes of the proposed algorithm have represented some promising results in terms of shadow detection accuracy.The outcomes are compared with the other model proposed and provided effective results in comparison as described in the different examples.The study suggested significant need in the development of such algorithms that can play their role in the betterment of image processing domain.The presence of shadow can cause shape distortion and object merging that may be unsuccessful in detecting the object misclassification or procedures.In the near future, the algorithm can be further extended to be improvised for the recognition of images.Moreover, added features like the induction of tough weather conditions can also be one of the suitable points to act on.The boundary of shadow can be fixed to a limited width and can be made sure that the algorithm is capable of sharpening the image to its max extent.Thus, induction of such features can be the advancements that can be made in this algorithm.The study has contributed to investigate the progress of an enhanced algorithm for image processing via optimal reduction of shadow.The utilization of algorithm significantly revealed the importance in the operation.
TP= true positive of the number of true shadow pixels FN= false negative of the number of shadows highlighted FP= false positives TN= negative number of the non-shadow pixels

Fig. 8 .
Fig. 8. Shadow detection and removal verification.Shadow detection and removal from the original image is shown in Fig. 8.The proposed algorithm has been applied on the original image to detect the shadow and then remove it.Fig. 8(a) showed original image and Fig. 8(b) showed the results of the proposed algorithm.Moreover, for further clarification, Fig. 8(c) showed final outcomes of proposed algorithm applied on the original image.The results of the present algorithm can be compared to the previously evaluated results by different scientists.The proposed algorithm has showed effective results, which can be compared to several other algorithms applied by different scientists.

TABLE I .
ACCURACY OF SHADOW DETECTION FOR THE IMAGE