# Finidng edges of convexhull from rectangles

1. Green Boxes = rectangles
2. red dots = edge points
3. red lines = to be generated from convex hull algorithm

I have a problem with creating the convex hull algorithm. I want to select or collect all the edges from these rectangles and draw convex hull around through these edges (See red dots from the Image). To make my algorithm more efficient, I don't know how to deselect or eliminate the points (X black points) inside all rectangles.

Could someone give me a solution for this?

If you have $$n$$ rectangles, take the convex hull of the $$4n$$ points given by the corners of those rectangles. This gives you exactly what you want, and you can use any standard algorithm for computing the convex hull. There is no need to explicitly deselect individual corners -- let the algorithm for computing a convex hull take care of that.