// C# 7 tuple syntax
        // See dummy reference for documentation
        public (Mat, int) ProcessImage(ref Mat frame)
        {
            // Crop image to square
            croppedImg = IPCore.CropToROI(ref frame);

            // Convert image to grayscale
            imgGrayscale = IPCore.ConvertToGrayscale(ref croppedImg);

            // If checkBoxVideoFeedShowProcessedImage is not checked, return cropped and grayscale image
            if (IPCore.VideoFeedSettings.IsProcessedImageFed == false)
            {
                return(imgGrayscale, 0);
            }

            // Set image brightness if necessary
            if (IPCore.TASettings.Brightness != 0)
            {
                imgGrayscale = IPCore.SetImageBrightness(ref imgGrayscale);
            }

            // Blur grayscale image
            imgBlurred = IPCore.SimpleImageBlur(ref imgGrayscale);

            // Calculate image histogram
            histogram = IPCore.CalculateHistogram(imgBlurred);

            // Get maximum histogram value
            double maxHistValue = IPCore.FindMaxHistogramValue(histogram);

            // Get index of maximum value of histogram
            int maxHistIndex = IPCore.FindMaxHistogramIndex(histogram, maxHistValue);

            // Get value right of histogram, which is smaller or equal that the maximum value divided by a predefined value
            int dividedValIndex = IPCore.FindHistogramDividedIndex(histogram, Enums.HistogramCalculation.Reversed, maxHistValue, maxHistIndex);

            // Get threshold value & apply right offset if necessary
            int thresholdValue = IPCore.GetThresholdValue(dividedValIndex);

            // Apply threshold filter
            imgThreshold = IPCore.ThresholdFilter(ref imgBlurred, thresholdValue, ThresholdTypes.Binary);

            // Invert Image
            invertedThreshold = IPCore.InvertImage(ref imgThreshold);

            // Apply median filter
            imgMedian = IPCore.MedianFilter(ref invertedThreshold);

            // Find all contours from image
            allContours = IPCore.FindAllContours(ref imgMedian);

            // Find largest 2 contors
            largestTwoContours = IPCore.FindLargestTwoContours(ref imgMedian, ref allContours);

            if (largestTwoContours.Count() == 2)
            {
                this.pointsList = new List <OpenCvSharp.Point>();

                foreach (Mat contour in largestTwoContours)
                {
                    pointsList.Add(IPCore.FindContourCenter(ref imgMedian, contour));
                }

                double distance = IPCore.CalculateEuclidianDistance(pointsList);

                return(IPCore.ComposeImageIDC(imgGrayscale, largestTwoContours, pointsList, (int)distance), (int)distance);
            }
            else
            {
                return(imgGrayscale, 0);
            }
        }