EVERY documentary maker is a treasure hunter.

In the case of Finding Vivian Maier, a new film out next week, the gem turned out to be buried within a Chicago flea market.

In 2007, John Maloof had been looking for old photographs to illustrate a book on his neighbourhood. He bought a box of negatives, thinking it would do the job. A quick Google search on the photographer, Vivian Maier, yielded nothing.

As it turned out, what he had found was the work of a hitherto unknown who is now being ranked alongside the greats. He also discovered a purpose, one might say an obsession, that led both him, and co-director Charlie Siskel, to devote years of their lives to a woman they had never met.

When Siskel joined the project, the notion had been to make a television documentary, but the former protege of Michael Moore reckoned they had more than that.

"This was a great story and you don't have to be a scholar of photography or twentieth century art to appreciate [it] or the photographs," says Siskel, who brought the film to the Edinburgh International Film Festival last month for its UK premiere.

Siskel had been recommended to Maloof by Jeff Garlin, perhaps best known for playing Larry David's agent in Curb Your Enthusiasm but also a producer and photographer. Maloof had more than 100,000 photographs, and "a mountain of stuff" that Maier, who died five years ago, had kept. Siskel and Maloof were to become what their names sounded like on paper: detectives come archaeologists.

The resulting piece is certainly an elegant and illuminating portrait of an artist, but it also grips like a mystery. As Maloof sums it up: "Who the hell is this woman?"

Maier, who earned her living as a nanny and housekeeper, rarely left the house without her camera. To Siskel, she was "a kind of spy", capturing life on the street and wherever took her fancy. On one occasion she took a child to an abattoir. Life with this Mary Poppins with a camera was always memorable.

Siskel, from Los Angeles, has not had anything near as dramatic a career split. Trained as a lawyer, he has learned about documentaries by making them. He was a producer for Moore on the Oscar-winning Bowling for Columbine (2002) before going on to produce Religulous (2008), a film that looked at faith from left field. He has produced other works for television, including Moore's Emmy-nominated pranks and investigative journalism programme The Awful Truth (1999).

"Michael is an incredible talent. He is able to take on the most serious subjects and treat them in a way that is entertaining, to combine very serious subjects and humour. That's what I learned from him and what I got hooked on."

Finding Vivian Maier sees Siskel going in a more straightforwardly serious direction. It is clear from the film that both he and Maloof thought long and hard about their subject in particular and the nature of fame - or, as in this case, anonymity - in general. The documentary does make one wonder if, in the age of Google, it would be possible for anyone to repeat Maier's feat of staying under the radar.

Siskel, 45, believes so. "There probably are hidden artists today. I don't think they are better because they are hidden, and I don't fault anyone for getting their work out there." What Maier's story should make us ponder he says, is how many more artists are out there undiscovered.

"Someone described Vivian as the crazy lady who didn't have any film in her camera. Maybe there is a great writer, a brilliant photographer or painter, who you see every day who is sweeping the streets or taking your change at the toll or standing behind you in line at the supermarket."

Maloof contacted galleries and institutions for advice in curating and processing Maier's pictures. He now curates the work and it is on display in galleries. Some of the proceeds from sales pay for the Vivian Maier Scholarship Fund for female students at the School of the Art Institute in Chicago.

"I don't know how he managed to do it, why he was willing to do it, it takes a certain kind of person to do that," says Siskel. "Most people would have abandoned it. It looks like a stroke of genius now but at the time everyone told him he was crazy, wasting his time, his money, and this was never going to amount to anything."

A question central to the film is raised by one of Maier's former charges and acquaintances. Namely, would this fiercely private woman have wanted a film made about her in the first place?

"I come down very decidedly on the side that Vivian would have wanted her work to be seen during her lifetime, she just didn't make it happen," says Siskel.

"It's not as romantic as the fairytale version of the artist who creates art for art's sake but to me it's more heroic. What Vivian did was she created this work day after day, year after year, decade after decade, without the support, adoration or feedback, without knowing that her work was connecting to an audience. But it has, after her lifetime. I would like to think that she would be incredibly gratified knowing that it has found its audience."

Finding Vivian Maier, Filmhouse, Edinburgh, July 18-24, and Glasgow Film Theatre, July 20-22