I think MATLAB built-in function "bwconncomp" would work.
Or, you can use "image region analyzer", which is a built-in app. Try to type "imageRegionAnalyzer" in the command window.
Before the analysis, I think you should remove SEM information at the bottom of the image, otherwise, the number of edges would be overestimated. For this purpose, you can use "imcrop" to crop the ROI.
One potential problem with the edge image you uploaded is that lots of edges are broken. In that case, the number of edges is severely overestimated. So, before the region analysis, I recommend you refine the edge detection by parameters tuning, etc.