Neither of them were suppressing their magical power
Newt is quite clear about this in the script; an Obscurus only develops when magic is intentionally suppressed:
Newt: Before wizards went underground, when we were still being hunted by Muggles, young wizards and witches sometimes tried to suppress their magic to avoid persecution. Instead of learning to harness or to control their powers, they developed what was called an Obscurus.
Fantastic Beasts and Where to Find Them (2016)
The early chapters of Philosopher's Stone give us some insight into Harry's pre-Hogwarts childhood, and it's revealed that he had incidents of accidental magic even before turning eleven:
Once, Aunt Petunia, tired of Harry coming back from the barbers looking as though he hadn't been at all, had taken a pair of kitchen scissors and cut his hair so short he was almost bald except for his bangs, which she left "to hide that horrible scar." Dudley had laughed himself silly at Harry, who spent a sleepless night imagining school the next day, where he was already laughed at for his baggy clothes and taped glasses. Next morning, however, he had gotten up to find his hair exactly as it had been before Aunt Petunia had sheared it off He had been given a week in his cupboard for this, even though he had tried to explain that he couldn't explain how it had grown back so quickly.
Another time, Aunt Petunia had been trying to force him into a revolting old sweater of Dudley's (brown with orange puff balls) -- The harder she tried to pull it over his head, the smaller it seemed to become, until finally it might have fitted a hand puppet, but certainly wouldn't fit Harry. Aunt Petunia had decided it must have shrunk in the wash and, to his great relief, Harry wasn't punished.
On the other hand, he'd gotten into terrible trouble for being found on
the roof of the school kitchens. Dudley's gang had been chasing him as
usual when, as much to Harry's surprise as anyone else's, there he was
sitting on the chimney.
Harry Potter and the Philosopher's Stone Chapter 2: "The Vanishing Glass"
Although we don't know much about Hermione's childhood, presumably she had similar experiences (though without the flagrant child abuse, I should think).
Interestingly, Harry would seem to be the perfect candidate for becoming an Obscurus; since he was quite literally abused for his magical outbursts, it seems logical that he would have tried to suppress them. Although I don't have any evidence for this, I suspect that his magical ignorance is actually what protected him; since he didn't have any notion of what was causing his outbursts, he didn't know how to suppress them.
But, regardless of quite how, it's clear that he spectacularly failed at supressing his magical powers; hence, no Obscurus.