Count the number of possible squares In a 9 by 9 grid some points have been marked. The task is it to
make a program that counts all distinct squares that can be made
using four marked points. Note that squares can also be placed
diagonally (any angle).
Input can be one of the following:

A character string of length 81 containing two distinct characters
for marked and unmarked points.
A one dimensional array (length 81) containing two distinct values.
A two dimensional array (9 by 9) with containing distinct values.

Output: The number of possible squares
You can write a full program or a function. This is code-golf. I am interested in the shortest code in every language. Standard loopholes are forbidden.
Examples:
Input:  ooo......oooooo...oooooo....oo.oo....oooooo...oooooo......ooo....................
Output: 62

Looks like: 

o o o 
o o o o o o
o o o o o o
  o o   o o
  o o o o o o
  o o o o o o
        o o o

Input:  ...ooo......ooo......ooo...ooo...oooooo.o.oooooo...ooo...ooo......ooo......ooo...
Output: 65

Input:  ...........o..o..o....................o..o..o....................o..o..o.........
Output: 6

Input:  ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Output: 540

Input:  ...........o..o.......................o.....o....................o...o...........
Output: 0
Jelly, 18 bytes
ŒṪÆịœc4ṗ2ạ/€QLƲ€ċ3

Try it online!
Input is a two-dimensional list of 0 and 1 (or any other falsy and truthy value).
Explanation
The idea is that for every four distinct points, we calculate the distance between each pair and if there are exactly three distinct distances (including 0), it's a square. (There are other shapes with this property, but they don't fit on a square grid; see @aPaulT's comment.)
ŒṪÆịœc4ṗ2ạ/€QLƲ€ċ3   Main monadic link
ŒṪ                   Get the coordinates of truthy points
  Æị                 Convert to complex numbers
    œc4              Get all combinations of size 4
               €     For each
              Ʋ      (
       ṗ2              Cartesian square
         ạ/            Absolute difference
           €             of each pair
            Q          Find unique items
             L         Length
              Ʋ      )
                ċ3   Count the occurences of 3