Determining the number of pixels between Edges?

I have an application which utilizes the Canny Edge Detector algorithm.
I want to determine the distance, or number of pixels between two edges at a specific area across the image in multiple locations.
The yellow box indicates the area of interest and the red line is the distance between the edges.

What would be a good approach to solving this issue?
See example image:
EdgeMeasure.png

Hi, please use our canny edge detection method… then to measure the pixel distance you can just write a loop that iterates over the raw pixels in the region of interest. Use get_pixel() to read a pixel value.