Your function/program will receive an image as input and has to calculate the amount of rectangles within that image. Only a rectangle that is completely clean in the inside, meaning no other strokes dividing it, counts. The strokes will all be in any color other than white. The background will be white. The answer should either be printed or returned by your function/program.
Both those images should return 4 as answer, because there are 4 unique, undisrupted/undivided rectangles in each.
This is code golf, shortest answer in bytes wins!