1. A method comprising: determining a ratio of a pixel having a first attribute in a first region of an image to generate a first determination result; determining a ratio of a pixel having a second attribute in a second region of the image to generate a second determination result, wherein the second region is arranged in a predetermined position relative to the first region; determining whether a predetermined pattern can exist in the vicinity of the first region based on the first determination result and the second determination result; and detecting the pattern in the vicinity of the first region when it is determined that the predetermined pattern can exist.