In the case of a cannon, the diameter of the barrel is much more than that of a firearm. Hence, the bore would be specified in pounds (e.g.) 2 pounder, 3 pounder, 4 pounder, 6 pounder, 18 pounder, 24 pounder etc. This would often be appreviated as 2 pdr, 3 pdr, 4 pdr, 6 pdr etc. As with firearms, what this means is that if you took a solid spherical cannon ball that fit into (say) a 3 pounder barrel and weighed it, it would weigh 3 pounds. Similarly, a 6 pounder would use a cannon ball of such diameter that if you weighed it, it would weigh 6 pounds and so on. This establishes a relationship between the weight of the cannon ball and the bore diameter.
The difference between cannon bores and firearm bores is that in firearm bores, the material of the ball is considered to be lead, whereas with cannon bores, the cannon ball was considered to be made of iron. Since these materials have different densities, a 1 pound lead ball has smaller diameter than a 1 pound iron ball. Also, for firearm bores, when a firearm is said to be of N bore, that means the ball it takes weighs 1/N pounds. For instance, a 10 bore musket uses lead balls weighing 1/10 of a pound and a 12 bore musket uses balls weighing 1/12th of a pound. As a consequence of this, the smaller the bore number, the larger the diameter of the firearm's barrel (i.e. diameter of 2 bore > 4 bore > 10 bore etc.). In contrast to this, a cannon bore is specified by the weight of the iron cannon ball, so the larger number indicates a larger diameter barrel (16 pdr > 8 pdr > 3 pdr).
Even though two cannon might be both (say) 32 pounders, in practice though, the barrel diameters of cannon pieces varied between regions and countries, because there wasn't a world-standard for exactly how much a pound was. For example, during the time when Napoleon was leading the French around Europe, the French standard pound weighed around 489.5 grams (by modern SI standards), whereas the English standard pound weight was approximately 454 grams. Therefore, during this period, a French 32 pounder cannon would have a greater diameter than an English 32 pounder cannon, because the French 32 pounder cannon ball actually weighed about 1.14 kg more than an English 32 pound cannon ball!
This relationship between cannon ball weight and bore of the cannon began to become less connected once metallurgical techniques improved and it became practical and widespread to add rifling to cannon bores. By the 20th century, some forces, particularly British, still continued to class their weapons by the weight of the shot they fired. However, the projectile itself was no longer a solid spherical iron ball, but was more of a conical shaped hollow artillery shell with some explosive material inside. Hence, the weight of the shell had no real relationship with its diameter any more.