I'm surprised that none of the other answers here provide reliable citations regarding the Japanese language or Japanese culture.
Meanings of the Japanese Word "Otaku"
The Japanese Language SE has considered this question here, here, and here, pointing out that
- The original meaning of 「お宅」(o-taku) is one's household/home/family/husband/organization and is, in this usage, employed by Japanese politicians or near-strangers to imply that the relationship between the speaker and the other person is not close and possibly estranged
- The word is used as a passive form for politeness when talking to other members of your in-group about something that someone who is socially above you (such as a teacher) has done for you
- In the context of a fanboy/fangirl, the word is not considered strongly negative by everyone in Japan, but does bear some connotations such as "narrow interest," "not caring about anything except for a specific topic," "not sociable," and "strong interest on a particular field and spend more time for knowing the subject or collecting the related goods" that many Japanese would view negatively.
Japanese people would not generally think to use otaku to refer to people outside of Japan who are passionate about hobbies.
Negative View of Anime/Manga Fandom in Japanese Culture
In general Japanese culture, an interest in anime and manga is looked down upon, as I posted here:
Unlike in many parts of the world where manga and anime are considered esteemed art forms, in Japan most parents consider manga to be junk and discourage their kids 1) from reading manga, since they should be reading literary novels instead, and 2) from becoming a mangaka when they grow up. So most Japanese do not read manga as adults, and most who had a dream of being a mangaka gave up on it. Teens and adults who are involved in subculture are generally viewed negatively by the general populace [...]
It is due to this cultural perception that anime/manga fans have a somewhat negative association, and as a result why some were derogatorily referred to as otaku by others and/or some took on the term otaku to refer to themselves. It is not simply that otaku is a rude term used by haters that got thrown onto anime/manga fans, but early anime/manga fans themselves felt some embarrassment/shame over being such and described themselves self-deprecatingly as otaku.
Current Perception & Japanese Anime/Manga Fans' Preferred Term
The current generation of young adult anime/manga fans in Japan are still viewed as oddball by others; they have not reached the level of acceptance by society at large that Western otaku enjoy (for example, the popularity of the TV sitcom The Big Bang Theory or that in American people could mention in passing that they're going to a con or RenFair this weekend and many others won't judge them for it). However, the demographic is not as negatively viewed as it was in past generations. Now, they might jokingly refer to themselves as otaku.
But the Japanese adults who are unabashed anime/manga fans do not usually refer to themselves as otaku, but rather prefer using the term 「サブカルチャー」(subculture) to describe their interest and what they are involved in. This term, rather than focusing on oneself, focuses on being part of a group that differentiates itself from the parent culture to which it belongs in particular, intentional ways. This usage of subculture is used not only for anime/manga fans but for other demographics of Japanese people, such as those interested in the occult, clubbing, or reggae, which are likewise not mainstream hobbies in Japan.
Otaku ≠ Hikikomori
In Japanese language and culture, the word otaku by itself does not include the meaning of 「引き籠もり」 (hikikomori, sometimes translated as "shut-in" or "acute social withdrawal"), which is a social and psychological phenomenon defined by the Japanese Ministry of Health, Labour and Welfare as those who people who refuse to leave their house for a period exceeding six months (further definitions have and are being created by researchers and mental health professionals). Some hikikomori have an interest in anime/manga/gaming, but others do not. Some became hikikomori after having experienced bullying at school, but the cause for others is unknown. According to the Japanese Constitution, children have a right to education, in other words, a right to attend school, but they are not legally required to attend school in order to make use of this right (this is why homeschooling is legal in Japan). As a result, becoming hikikomori is not illegal activity.
Article 26: All people shall have the right to receive an equal education correspondent to their ability, as provided for by law.
2) All people shall be obligated to have all boys and girls under their protection receive ordinary education as provided for by law. Such compulsory education shall be free.
Article 27: All people shall have the right and the obligation to work
When I joined the Manga and Illustration Research Society at my Japanese university, I was a bit surprised to find out that most members are strongly socially awkward in ways which I hadn't seen prevalent among American fanboys/fangirls. There is an overlap between social awkwardness and social withdrawl and the Japanese anime/manga fan community, but it is not a simple and well-understood correlation. It could be that the less-socially-adept veer toward niche interests, or it could be that when a hikikomori is in his/her bedroom for years on end, it makes sense that he/she would gain an interest in hobbies that can be done alone at home using the TV or computer for entertainment and for reaching out to fellows through the web.
It makes good marketing sense that the growing number of hikikomori, of whom a sizable percent are interested in anime/manga/light novels, has created enough consumers who would relate to hikikomori protagonists that the Japanese companies are responding to this market by producing more titles that feature hikikomori in a positive light. This may figure into a cycle in which people who are considering making the switch to being hikikomori feel more like it is not a terribly shameful that that only losers do but that there are a lot of other people in the same boat (it's still too early to know whether these titles have any effect on increasing the numbers of hikikomori).