A computer-implemented method for classifying and counting objects recoverable from a urine sample processed onto a slide, said method comprising: - receiving at least one digitalized image of the whole slide; - detecting connected components by segmentation of the image of the whole slide; - classifying the detected connected components into countable connected components and uncountable connected components using a classifier, wherein the countable connected components are connected components for which a human is able to visually identify each object comprised in it, and wherein the uncountable connected components are objects that cannot be visually identified by a human; - for the countable connected components: • inputting each countable connected component into an object detection model so as to detect objects and obtain an output comprising a bounding box and an associated class for each detected object; • counting the bounding boxes associated to each class obtaining a number of objects for each class; - outputting the number of objects for each class; characterized in that the method further comprises, before the step of outputting the number of objects for each class: - for the uncountable components: • inputting each uncountable connected component into a semantic segmentation model and obtaining as output a segmentation mask in which all pixels are classified into one class among multiple predefined available classes; • for each class, counting the number of objects as the ratio between a total pixel's area of the class, obtained as the number of pixels of the segmentation mask associate to said class, and an average area of the object of said class; - summing up the number of objects for each class obtained from the semantic segmentation model and the object detection model; wherein said classes for the semantic segmentation model and the object detection model are the same. - receiving at least one digitalized image of the whole slide; - detecting connected components by segmentation of the image of the whole slide; - classifying the detected connected components into countable connected components and uncountable connected components using a classifier, wherein the countable connected components are connected components for which a human is able to visually identify each object comprised in it, and wherein the uncountable connected components are objects that cannot be visually identified by a human; - for the countable connected components: • inputting each countable connected component into an object detection model so as to detect objects and obtain an output comprising a bounding box and an associated class for each detected object; • counting the bounding boxes associated to each class obtaining a number of objects for each class; • inputting each countable connected component into an object detection model so as to detect objects and obtain an output comprising a bounding box and an associated class for each detected object; • counting the bounding boxes associated to each class obtaining a number of objects for each class; - outputting the number of objects for each class; - for the uncountable components: • inputting each uncountable connected component into a semantic segmentation model and obtaining as output a segmentation mask in which all pixels are classified into one class among multiple predefined available classes; • for each class, counting the number of objects as the ratio between a total pixel's area of the class, obtained as the number of pixels of the segmentation mask associate to said class, and an average area of the object of said class; • inputting each uncountable connected component into a semantic segmentation model and obtaining as output a segmentation mask in which all pixels are classified into one class among multiple predefined available classes; • for each class, counting the number of objects as the ratio between a total pixel's area of the class, obtained as the number of pixels of the segmentation mask associate to said class, and an average area of the object of said class; - summing up the number of objects for each class obtained from the semantic segmentation model and the object detection model;