The bullet casings found at crime scenes, are key to start investigations to clarify the facts. A weapon fring a projectile, leaving a set of marks on the cartridges, many of them in his shorts. In this paper we present an algorithm based on a 2D image taken from a bullet casings shorts, use processing techniques and image analysis to obtain some of these characteristic marks left by the weapon, then, based on a database that records the bullet casings found previously in other crime scenes and the K-nn algorithm used to relate the bullet casings with previously registered weapons or with other cartridges found in other scenes. To determine the importance of each characteristic marks, we design a genetic algorithm to further defne the optimal number of neighbors. An experiment was conducted with 15 weapons fred 10 or 30 times each obtained promising results.