The image we have loaded is an RGB image with 8-bits per channel, so we’ll have to decompose the channels, convert the three channels into separate grayscale images, compute the gradients of the three component images, and then merge the gradients together into one image, in which we will do the path searching.