/// <summary>
        /// Reason : To get distinct colors from list with their dencity
        /// </summary>
        /// <param name="colorList"></param>
        /// <param name="Red"></param>
        /// <param name="Blue"></param>
        /// <param name="Green"></param>
        /// <param name="Yellow"></param>
        /// <param name="Pink"></param>
        /// <param name="SkyBlue"></param>
        /// <param name="Orange"></param>
        /// <param name="Purple"></param>
        /// <param name="White"></param>
        /// <param name="Black"></param>
        /// <returns></returns>
        private List<ColorModel> GetUniqueColorList(List<string> colorList, int Red, int Blue, int Green, int Yellow, int Pink, int SkyBlue, int Orange, int Purple, int White, int Black,int Grey,int Brown)
        {
            try
            {
                if (!(colorList.Count() > 0))
                    return null;

                var colorKeyValuelist = new List<KeyValuePair<string, int>>();
                List<ColorModel> cmList = new List<ColorModel>();

                foreach (var x in colorList)
                {
                    switch (x.Replace(" ", ""))
                    {
                        case "Red":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Red", Red));
                            break;
                        case "Blue":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Blue", Blue));
                            break;
                        case "Green":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Green", Green));
                            break;
                        case "Yellow":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Yellow", Yellow));
                            break;
                        case "Pink":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Pink", Pink));
                            break;
                        case "SkyBlue":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Sky Blue", SkyBlue));
                            break;
                        case "Orange":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Orange", Orange));
                            break;
                        case "Purple":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Purple", Purple));
                            break;
                        case "White":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("White", White));
                            break;
                        case "Black":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Black", Black));
                            break;
                        case "Grey":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Grey", Grey));
                            break;
                        case "Brown":
                            colorKeyValuelist.Add(new KeyValuePair<string, int>("Brown", Brown));
                            break;
                        default:
                            break;
                    }
                }

                var totalColors = (from t in colorKeyValuelist select t.Value).Sum();
                foreach (var colorObj in colorKeyValuelist)
                {
                    ColorModel cmObj = new ColorModel();
                    var colorValue = (from t in colorKeyValuelist where t.Key == colorObj.Key select t.Value).FirstOrDefault();
                    var percentage = Math.Round((Convert.ToDecimal(colorValue) / Convert.ToDecimal(totalColors)) * 100);
                    if (!(percentage > 0))
                    {
                        continue;
                    }

                    switch (colorObj.Key)
                    {
                        case "Red":
                            cmObj.color = "Red";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Blue":
                            cmObj.color = "Blue";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Green":
                            cmObj.color = "Green";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Yellow":
                            cmObj.color = "Yellow";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Pink":
                            cmObj.color = "Pink";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "SkyBlue":
                            cmObj.color = "Sky Blue";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Orange":
                            cmObj.color = "Orange";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Purple":
                            cmObj.color = "Purple";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "White":
                            cmObj.color = "White";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Black":
                            cmObj.color = "Black";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;

                        case "Grey":
                            cmObj.color = "Grey";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        case "Brown":
                            cmObj.color = "Brown";
                            cmObj.pecentage = Convert.ToInt32(percentage);
                            cmList.Add(cmObj);
                            break;
                        default:
                            break;
                    }
                }

                return cmList;
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        ///Reason : To get frame details from video 
        /// </summary>
        /// <param name="extractedImageFolderPath"></param>
        /// <param name="contentMessage"></param>
        /// <param name="colorMessage"></param>
        private List<ColorModel> GetFrameDetailsOfVideo(string extractedImageFolderPath, string frameName, ref string contentMessage )
        {
            try
            {
                List<VideoDetails> videoDetailsList = new List<VideoDetails>();
                List<ColorModel> colorList = new List<ColorModel>();
                List<ColorModel> avgVideoColorList = new List<ColorModel>();

                int i = 1;
                string blankFrame = "";
                string colorNames = "";

                var fileEntries = GetFilesFrom(extractedImageFolderPath, imageFilters, false, frameName);
                foreach (string fileName in fileEntries)
                {
                    VideoDetails videoDetailsObj = new VideoDetails();
                    videoDetailsObj.FileName = fileName;
                    videoDetailsObj.Content = new ImageVideoProcessing.ImageGrabber().ExtractTextFromImage(fileName);
                    videoDetailsObj.ColorDetails = colorNames;
                    colorList.AddRange(new ImageVideoProcessing.ImageGrabber().GetImageColors(fileName));

                    if (videoDetailsObj.Content.Trim() != "")
                        contentMessage += "Frame " + i + ": \r\n" + videoDetailsObj.Content + "\r\n";
                    else
                        blankFrame += "\r\n Frame " + i;

                    i += 1;
                }

                contentMessage += !string.IsNullOrEmpty(blankFrame) ?
                    "\r\n\r\nFollowing frames are not having any content:" + blankFrame : "";
                var avgColorList = colorList.GroupBy(g => g.color, r => r.pecentage).Select(g => new
                {
                    color = g.Key,
                    colorPercentage = g.Average()
                });

                foreach (var clr in avgColorList)
                {
                    ColorModel colrMod = new ColorModel();
                    colrMod.color = clr.color;
                    colrMod.pecentage = Convert.ToInt32(Math.Round(clr.colorPercentage));
                    avgVideoColorList.Add(colrMod);
                }

                return avgVideoColorList;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                GC.Collect();
            }
        }
        /// <summary>
        /// Reason : To get distinct colors from list with their dencity
        /// </summary>
        /// <param name="colorList"></param>
        /// <param name="Red"></param>
        /// <param name="Blue"></param>
        /// <param name="Green"></param>
        /// <param name="Yellow"></param>
        /// <param name="Pink"></param>
        /// <param name="SkyBlue"></param>
        /// <param name="Orange"></param>
        /// <param name="Purple"></param>
        /// <param name="White"></param>
        /// <param name="Black"></param>
        /// <returns></returns>
        private List <ColorModel> GetUniqueColorList(List <string> colorList, int Red, int Blue, int Green, int Yellow, int Pink, int SkyBlue, int Orange, int Purple, int White, int Black, int Grey, int Brown)
        {
            try
            {
                if (!(colorList.Count() > 0))
                {
                    return(null);
                }

                var colorKeyValuelist    = new List <KeyValuePair <string, int> >();
                List <ColorModel> cmList = new List <ColorModel>();

                foreach (var x in colorList)
                {
                    switch (x.Replace(" ", ""))
                    {
                    case "Red":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Red", Red));
                        break;

                    case "Blue":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Blue", Blue));
                        break;

                    case "Green":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Green", Green));
                        break;

                    case "Yellow":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Yellow", Yellow));
                        break;

                    case "Pink":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Pink", Pink));
                        break;

                    case "SkyBlue":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Sky Blue", SkyBlue));
                        break;

                    case "Orange":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Orange", Orange));
                        break;

                    case "Purple":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Purple", Purple));
                        break;

                    case "White":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("White", White));
                        break;

                    case "Black":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Black", Black));
                        break;

                    case "Grey":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Grey", Grey));
                        break;

                    case "Brown":
                        colorKeyValuelist.Add(new KeyValuePair <string, int>("Brown", Brown));
                        break;

                    default:
                        break;
                    }
                }

                var totalColors = (from t in colorKeyValuelist select t.Value).Sum();
                foreach (var colorObj in colorKeyValuelist)
                {
                    ColorModel cmObj      = new ColorModel();
                    var        colorValue = (from t in colorKeyValuelist where t.Key == colorObj.Key select t.Value).FirstOrDefault();
                    var        percentage = Math.Round((Convert.ToDecimal(colorValue) / Convert.ToDecimal(totalColors)) * 100);
                    if (!(percentage > 0))
                    {
                        continue;
                    }

                    switch (colorObj.Key)
                    {
                    case "Red":
                        cmObj.color     = "Red";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Blue":
                        cmObj.color     = "Blue";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Green":
                        cmObj.color     = "Green";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Yellow":
                        cmObj.color     = "Yellow";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Pink":
                        cmObj.color     = "Pink";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "SkyBlue":
                        cmObj.color     = "Sky Blue";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Orange":
                        cmObj.color     = "Orange";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Purple":
                        cmObj.color     = "Purple";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "White":
                        cmObj.color     = "White";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Black":
                        cmObj.color     = "Black";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Grey":
                        cmObj.color     = "Grey";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    case "Brown":
                        cmObj.color     = "Brown";
                        cmObj.pecentage = Convert.ToInt32(percentage);
                        cmList.Add(cmObj);
                        break;

                    default:
                        break;
                    }
                }

                return(cmList);
            }
            catch (Exception)
            {
                throw;
            }
        }