Eye test - How many squares are in this picture? The picture:


Sick of the same old grid where the answer is simply a square pyramidal number?
Accept the challenge and write a program that given a positive integer \$n\$ counts how many squares are in the \$n^{\text{th}}\$ iteration of the Harter-Heighway dragon!

The sequence of squares of size 1 is A003230
Your code must count all the squares of any size (the first of size 2 show up in \$7^{\text{th}}\$ iteration)
This is code-golf

Here's the beginning of the resulting sequence:
0, 0, 0, 1, 4, 11, 30, 78, 205, 546, 1455, 4062, 11192, 31889, 88487, 254594

And my un-golfed reference program in Mathematica.
Charcoal, 96 bytes
Ｆ…¹Ｘ²Ｎ«Ｆ¬⁼ＫＫ#⊞υ⟦ⅉⅈ⟧##¿＆ι⊗＆ι±ι↷↶»↷≔⁰ζＦυ«Ｊ⊟ι⊟ι≔¹ηＷ⬤ur⁼№ＫＤ⊗η✳λ#⊗η≦⊕ηＦη¿κ«↗↗≧⁺⬤dl⁼№ＫＤ⊗κ✳λ#⊗κζ»»⎚Ｉζ

Try it online! Link is to verbose version of code. Explaantion:
Ｆ…¹Ｘ²Ｎ«

Loop over all the turns of the nᵗʰ iteration of the dragon.
Ｆ¬⁼ＫＫ#⊞υ⟦ⅉⅈ⟧

If we haven't visited this cell yet then record its position.
##

Print a segment of the dragon.
¿＆ι⊗＆ι±ι↷↶

Rotate appropriately for the next segment.
»↷

At the end of the dragon, rotate back to horizontal. (Clear() doesn't do this; maybe it should?)
≔⁰ζ

Start counting squares.
Ｆυ«Ｊ⊟ι⊟ι

Loop over and jump to each visited cell.
≔¹η

Start searching for squares.
Ｗ⬤ur⁼№ＫＤ⊗η✳λ#⊗η≦⊕η

While there are enough #s in both the upwards and rightwards directions increase the size of square being searched for.
Ｆη¿κ«

Check all sizes of squares from 1 to the largest potential size found.
↗↗≧⁺⬤dl⁼№ＫＤ⊗κ✳λ#⊗κζ

Move diagonally up and right two cells, then check downwards and leftwards for the other two sides of the square of this size and keep a running total of squares found.
»»⎚Ｉζ

Once all potential squares have been checked clear the canvas and output the final number found.