Removed unnecessary loops
Doing nonMaximumSuppress function the right way:
Passing the computed gradient intensity and not just pixel color values