I have been using exact matched term, 2 times in an article. But I have been using that same keyword in alt tag of 2-3 images.
I want to know if alt tag text contribute to keyword density. How exactly this works?
Well, at the moment of this post, you have one answer saying 'yes' and one answer saying 'no'. I guess you may be confused and I hope not make your confussion bigger, but my answer is: It doesn't matter.
"Keyword density" is a SEO concept of 1990's and maybe 2000's, but this does no apply any more. SEO evolve and this is one of the things that are now part of the past. I would care about using synonimous, non-synonimous related words (like 'war' is related to 'weapon'), user experienace and this kind of things.
Really, I don't know if Google is going to start using this matric again, at least in 2016, this is not important to rank your site.
The appearance of keyword in any of your page elements, including title, description, headers, alt tags, link titles all contribute to the overall keyword density of your page.
However, if these images do require inclusion of those keywords to describe the images aptly, don't shy away from using them. The goal is to make the content of the page (including images) as good as possible without making them look spammy.
No, Search engines will not consider the alt tags in keyword density. It helps search engines to understand your images. The alt tag parameter will be consider for image searches.
Alt tag also provides additional information to search engine to understand the content of the page. It is advisable that naming of the images should be proper to get better search engine ranking.