Find the edge of the screen and crop

Hello,I have this photo:

And I need to find a white marking in the corner, and crop photos. Is possible use this :

    I1 = imread('IMG_20160126_202236.jpg');
    I = rgb2gray(I1);
    C = corner(I,'Harris',50);

For find corner and I do not know how to cut it :(

Please can you help me to automatize this proces. Thank you

Answers (1)

If you're going to be needing to find monitors in all kinds of environments with weird angles and lighting and colors, then you might need to use something from the Computer Vision System Toolbox. I don't think the corner detector will work. Perhaps Dima (the developer of it) will answer.
Another option, if you don't have the CVST, is to use stdfilt() in the Image Processing Toolbox and find areas that are fairly uniform. Then threshold, fill holes, and get the convex hull.

3 Comments

lukbe
lukbe on 26 Jan 2016
Edited: lukbe on 26 Jan 2016
This is a very bad picture. In the future, I'll have better pictures with the DSLR Nikon D7100.
I have to take a picture display, and cut accurately display part, without the frame. The displayed image can be what I want.
I will take pictures in a darkroom. so you will see a display and points to the corner.
Well we don't want to put a ton of effort in handling a crummy photo that you'll never end up having. There would have to be lots of code to handle pathological images that we wouldn't need if we had a decent picture. Post a good photo - one we can segment with little trouble.
OK, I capture display with DSLR.

Sign in to comment.

Categories

Tags

Asked:

on 26 Jan 2016

Commented:

on 26 Jan 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!