1. A method of determining a focused object programmed in a memory of a computing device, the method comprising: a. calculating a dominant gradient map to find the focused object; b. calculating a boundary for each object within a segmentation map; c. thickening the boundary for each object; d. calculating one or more parameters for each object; e. ranking each object according to a determined focus level based on the one or more parameters; and f. refining the segmentation map, wherein refining includes at least one of marking disconnected regions of same objects as separate objects, merging objects with areas smaller than a specified number of pixels with a closest object and generating a secondary binary dominant gradient map using the dominant gradient map and morphological dilation.