<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Title
Step1:  Load image
Step2:  Detect Edges
Step3:  View Edges
<ASSISTANT_TASK:>
Python Code:
# Load image
import cv2
import numpy as np
from matplotlib import pyplot as plt
Explanation: Title: Detect Edges
Slug: detect_edges
Summary: How to detect edges images using OpenCV in Python.   
Date: 2017-09-11 12:00
Category: Machine Learning
Tags: Preprocessing Images  
Authors: Chris Albon
Preliminaries
End of explanation
# Load image as greyscale
image_gray = cv2.imread('images/plane_256x256.jpg', cv2.IMREAD_GRAYSCALE)
Explanation: Load image
End of explanation
# Calculate median intensity
median_intensity = np.median(image_gray)
# Set thresholds to be one standard deviation above and below median intensity
lower_threshold = int(max(0, (1.0 - 0.33) * median_intensity))
upper_threshold = int(min(255, (1.0 + 0.33) * median_intensity))
# Apply canny edge detector
image_canny = cv2.Canny(image_gray, lower_threshold, upper_threshold)
Explanation: Detect Edges
End of explanation
# Show image
plt.imshow(image_canny, cmap='gray'), plt.axis("off")
plt.show()
Explanation: View Edges
End of explanation
<END_TASK>