Sometimes there is a need to access pixel intensity value at a particular location when we are working with images. This is very useful when we want to change the brightness or contrast of a group of pixels or we want to perform some other pixel-level operations. For an 8-bit grayscale image, this intensity value at a point will be in a range of 0 to 255, while for a color image there will be three different intensity values for the blue, green, and red channels with all having values between 0 to 255.
OpenCV provides a cv::Mat::at<> method for accessing intensity values at a particular location for any channel images. It needs one argument, which is the location of the point at which the intensity is to be accessed. The point is passed using the Point class with row and column values as arguments. For a grayscale image...