# Notation of the summation the number of elements in a set

I am stuck on a notation problem. I have a certain image ${\hat{(x_P)}}$ with pixel values ${\hat{[x_P]}}$ and part of them belong to an area that I call Region of Interest, ROI. I would like to write in Mathematical notation that I want to sum the number of all the pixel that are contained in this area, compared to the total number of pixels (size of the image).

If I write it as: $${\frac{\sum_{i} {[\hat{x}_{ROI}]}_i} {\sum_{i} {\hat{[x_P]}}_i}}$$

it looks like that I am summing the value of the pixels, and not their number.

Any suggestion? I might use the cardinality notation of a set of numbers, but again, if this is correct, I don't know how to use it.

Thank you,

Stefania

One option could be: $$\sum_{p}[\hat{x}_p\in ROI]$$ where [] is the Iverson symbol
$\hat{x}_P = \{x_1, x_2, x_3, ... , x_n\}$
$\hat{x}_{ROI} \in \hat{x}_P = \{x'_1, x'_2, x'_3, ... , x'_k\}$
Then, your desired quantity is just: $$\frac{k}{n}$$