count foreground area directly