Dice Similarity compare segment TP and TN correct?

I found this documentation source module and I think is it wrong measure? formula that dice similarity is use Union instead of intersect.


I surf on the internet that dice similarity look like this. Can anyone tell me that I got it right?
image