Strands of hair in the stool. Have pets at home. Treatment?

I have found long strands of hair in my stool for the first time. It's not white. I kept a sample and when it dried out, it looked like human or pet hair. I have dog that sheds quite a bit but I also have four cats I sleep with. I keep a cover on my bed and it gets washed weekly. Are these, in essence, hair balls I'm ingesting while I'm asleep?