Python 2, 480 436 436386 bytes
H=[];V=[]exec u"""s=sorted;H=[];V=[]
defFRIinput():
ES=2*map(S,Ts,czip(*R))
FiI0,a1,b2,i=0)3:
try c=S[i][i/2];a,b=S[~i]
FeIs(H):
C,(A,B),C=S[i]=e
if(a<C<b)*(A<c<B) a<C<b&A<c<B:S[i]=e[:]=C,(A,c);H+=[C,C;S+=((c,B)],C);V+=[c,;E(S,T,c,a,C,i)],;a=C
E(S,T,cV+=[c,(a,b,i+1)],;H,V=V,H
print except:T+=sum(a==A==(ad,D)&c==C==(b,B)&B-b==D-d&{d<x<D&b<y<B Fx,cyI[(o,p)[::r]FrI-1,1Fp,OI[V,H][r>0]FoIO]}=={0}Fb,aIH FB,AIH Fd,cIV FD,CIV)""".translate({70:u"for ",73:u" in ",38:u" and "})
Takes a list of coordinate pairs through STDIN in the format:
[ [(x, y), (x, y)], [(x, y), (x, y)], ... ]
and prints the result to STDOUT.
The actual program, after string replacement, is:s=sorted;H=[];V=[]
for R in input():h,v=map
S=2*map(sorteds,zip(*R));[(E
for i in 0,1,2,3:
c=S[i][i/2];a,b=S[~i]
for e in s(H,V):
C,h[i](A,*vB)=e
if a<C<b and A<c<B:e[:]=C,E(VA,Hc);H+=[C,v[i](c,*hB)],;V+=[c,(a,C)for],;a=C
i in 0 V+=[c,1](a,b)],;H,V=V,H
print sum((a==A==(d,D))*( and c==C==(b,B))*( and B-b==D-d) and 1-any(({d<x<D)*( and b<y<B) for x,y in{ [(o,p)[::r]for r in(1, -1)for O,1for p,O in[Vin [V,H][r>0]for o in OO]})=={0}for a,b,a in H for A,B,A in H for c,d,c in V for C,D,C in V)
Takes a list of coordinate pairs through STDIN in the format:
[ [(x, y), (x, y)], [(x, y), (x, y)], ... ]
and prints the result to STDOUT.