Patent attributes
A computer system includes an input configured to receive a first image of medication located in a receptacle, memory, and a processor configured to execute instructions including creating a second image based on the first image, dividing pixels of the second image into first and second subsets, and scanning the second image along a first axis to count, for each point along the first axis, a number of pixels in the first subset along a line perpendicular to the first axis that intersects the first axis at the point. The instructions also include estimating positions of first and second edges of the receptacle along the first axis based on the counts of the pixels, defining an opening of the receptacle based on the estimated positions of the first and second edges, and outputting a processed image that indicates areas of the image that are outside of the defined opening.