how to detect corner in a digital image using MATLAB?
In the case of video, the best approach to use is the ShiTomasi Corner Detector. (detectMinEigenFeatures). Now, if you want to detect corners that contains some invariant featrues, you should use SURF, BRISK, ORG, AKAZE, FREAK, etc...

Example:

im = rgb2gray(imread('image.jpg'));
[r c] = corner_ST(im,20);