The definite article the is implied to point to something specific rather than indeterminate. It is clear that the nouns that have explanations after them should be preceded by the, like in
Walking around Prague I saw the house that was painted red.
However, if a noun is preceded by an adjective, which, by default, specifies the noun, should the be used, like in
Walking around Prague I saw the red house.
Or should a be used in both cases, because (painted) red is not specific enough for the definite article to be used? Would it be different for
Walking around Prague I saw the house where Queen Elisabeth lived.
Walking around Prague I saw the Queen Elisabeth's house.
What are the criteria that determine how specific is a noun, noun phrase or noun-adjective combination? I'm especially interested in the guidlines for scientific/academic writing.
Any help would be appreciated.