<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:  Define Corner Parameters
Step3:  Detect Corners
Step4:  Mark Corners
Step5:  View Image
<ASSISTANT_TASK:>
Python Code:
# Load image
import cv2
import numpy as np
from matplotlib import pyplot as plt
Explanation: Title: Harris Corner Detector
Slug: harris_corner_detector
Summary: How to detect corners images using OpenCV in Python with the Harris Corner Detector.   
Date: 2017-09-11 12:00
Category: Machine Learning
Tags: Preprocessing Images  
Authors: Chris Albon
The Harris Corner Detector is a commonly used method of detecting the intersection of two edges. It looks for windows (also called neighborhoods or patches) where small movements of the window (imagine shaking the window) creates big changes in the contents of the pixels inside the window.
Preliminaries
End of explanation
# Load image as grayscale
image_bgr = cv2.imread('images/plane_256x256.jpg')
image_gray = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2GRAY)
image_gray = np.float32(image_gray)
Explanation: Load image
End of explanation
# Set corner detector parameters
block_size = 2
aperture = 29
free_parameter = 0.04
Explanation: Define Corner Parameters
End of explanation
# Detect corners
detector_responses = cv2.cornerHarris(image_gray, block_size, aperture, free_parameter)
Explanation: Detect Corners
End of explanation
# Large corner markers
detector_responses = cv2.dilate(detector_responses, None)
# Only keep detector responses greater than threshold, mark as white
threshold = 0.02
image_bgr[detector_responses > threshold * detector_responses.max()] = [255,255,255]
Explanation: Mark Corners
End of explanation
# Convert to grayscale
image_gray = cv2.cvtColor(image_bgr, cv2.COLOR_BGR2GRAY)
# Show image
plt.imshow(image_gray, cmap='gray'), plt.axis("off")
plt.show()
Explanation: View Image
End of explanation
<END_TASK>