There are thousands of vertical lines there, if you call a vertical line a series of white pixels in a single column with no breaks in it. You can count them simply by labeling the image using 4-connectivity
[labeledImage, numberOfRegions] = bwlabel(binaryImage, 4);
Now, some of those white blobs may be horizontal, or rounded blobs, so you might want to call regionprops and check the PixelIdxList property to make sure all the pixels in each blob are in the same column. Use unique on the x (column) coordinates for that.
Best Answer