text: /*Done on 2nd Jan 2021 and 3rd Jan 2021*/
  #include <opencv2/imgcodecs.hpp>
  #include <opencv2/imgproc.hpp>
  #include <opencv2/highgui.hpp>
  using namespace cv;
  #include <iostream>
  using namespace std;
  
  
  int main()
  {
  	string path = "Resources/shapes.png";;
  	cv::Mat image = cv::imread(path), hsvImg, threshImg, maskImg;
  
  	int huemin = 0, satmin = 92, valmin = 153;
  	int huemax = 255, satmax = 255, valmax = 255;
  
  	// Convert to HSV scale image..
  	cv::cvtColor(image, hsvImg, COLOR_BGR2HSV);
  
  	// Create a window to place the created trackbars in that window..
  	namedWindow("Trackbars", (640, 240));
  	// Create trackbars for HUE, SAT, VAL -- min and max for each.
  	cv::createTrackbar("HUE min", "Trackbars", &huemin, 180);
  	cv::createTrackbar("HUE max", "Trackbars", &huemax, 255);
  	cv::createTrackbar("SAT min", "Trackbars", &satmin, 255);
  	cv::createTrackbar("SAT max", "Trackbars", &satmax, 255);
  	cv::createTrackbar("VAL min", "Trackbars", &valmin, 255);
  	cv::createTrackbar("VAL max", "Trackbars", &valmax, 255);
  
  	while (true)
  	{
  		Scalar lower_bound(huemin, satmin, valmin);
  		Scalar upper_bound(huemax, satmax, valmax);
  		//cout << "(" << huemin << ", " << satmin << ", " << valmin << ")   (" << huemax << ", " << satmax << ", " << valmax << ")" << endl;
  		// Filter the required color range..
  		cv::inRange(hsvImg, lower_bound, upper_bound, threshImg);
  		// Now mask the original image -- i.e., Showing only the required colored object and masking rest other..
  		cvtColor(threshImg, threshImg, COLOR_GRAY2BGR);	// Why this? because, to perform bitwise_and both must be of same dimensions. threshImg is 2 dimensions(B & W) and image is of 3 dimensions (BGR)
  		bitwise_and(image, threshImg, maskImg);
  
  		/* ---------------- Display Results ----------------*/
  		cv::imshow("Original Image", image);
  		cv::imshow("HSV Image", hsvImg);
  		cv::imshow("Threshold Image", threshImg);
  		cv::imshow("Masked Image", maskImg);
  		if (cv::waitKey(1) == 27)
  			break;
  	}
  	return 0;
  }
  