(CNN) -

Inside the operating room, video cameras track every movement. Outside, a small computer-like device analyzes the recordings, identifying when mistakes are made and providing instant feedback to surgeons as they operate.

This is the dream of the surgical "black box." Operations could become flawless. Post-operative complications could be significantly reduced. Surgeons could review the footage to improve their technique and prep for the next big case.

Such a device isn't far from reality.

Researchers in Canada are working on a surgical tracking box -- like the ones placed in airplanes -- that records surgeons' movements and identifies errors during an operation.

By pinpointing mistakes and telling surgeons when they're veering "off course," a black box could prevent future slip-ups, says Dr. Teodor Grantcharov, a minimally invasive surgeon at St Michael's Hospital in Toronto. Unlike the so-called black boxes in aviation, which are used after disasters occur, the surgical black box Grantcharov is creating will be used proactively to prevent major patient complications.

A number of hospitals have already expressed interest in using the device, Grantcharov says.

But the litigious medical environment may make its implementation problematic. If the recordings were used in court, they could open the floodgates to a new wave of malpractice concerns, which would be counterproductive to surgeons and patients, Grantcharov says.

"We have to ensure the black box is used as an educational tool to help surgeons evaluate their performance and improve," he says.

A work in progress

Grantcharov's black box is a multifaceted system. In addition to the actual box, it includes operating room microphones and cameras that record the surgery, the surgeon's movements and details about team dynamics.

It will allow surgeons to hone in on exactly what went wrong and why.

The black box will eventually assess everything from how surgeons stitch to how delicately they handle organs and communicate with nurses during high-stress situations. Error-analysis software within the black box will help surgeons identify when they are "deviating" from the norm or using techniques linked to higher rates of complications.

So far, Grantcharov's black box has been tested on about 40 patients undergoing laparoscopic weight-loss surgery.

"At this initial stage, we are analyzing surgeries to determine how many errors occur and which ones actually lead to bad results for patients," Grantcharov says. Not every error will result in a patient complication.

Grantcharov's initial research has shown that surgeons recognize few of their mistakes, and, on average, make about 20 errors per surgery -- regardless of experience level. Once Grantcharov's team determines which errors affect patient safety, it hopes to be able to provide this information to surgeons in real time. The team has also developed software that can synthesize the recorded data into user-friendly and interpretable information for surgeons.

The concept of using a black box in surgery isn't new. But until now, the technology never made it out of the laboratory because it lacked comprehensiveness, Grantcharov says. Earlier surgical black boxes didn't record all the important elements of the operating room, he says, leaving pieces of the puzzle missing.

"To truly understand what causes an error, you need to know all the factors that may come into play."

Recording mistakes

Grantcharov was inspired to develop the surgical black box after years of witnessing how patient complications affected surgeons.

"The feeling of not knowing what causes a complication, whether it's surgical technique, communication in the operating room or the patient's condition itself, is tormenting," Grantcharov says.

Many surgeons, however, may be uncomfortable with using a black box in the operating room, says Dr. Teodoro Forcht Dagi with the American College of Surgeons Perioperative Care Committee.

"If there was a legal requirement to record every operation, then many surgeons would be resistant," Forcht Dagi says. He says he believes doing so would create a sense of nervousness that would paralyze a surgeon's ability to operate and end up ultimately harming patients.

"The black box needs to be used solely by surgeons for their own education, in which case I think it's a great idea," Forcht Dagi says.

Errors during surgery have generally been dealt with after the fact, and only once a complication during the patient's recovery occurs. Weeks after surgery, cases with complications are presented to a panel of experts, who weigh in on what may have gone wrong during the operation.

Yet in many cases nothing is recorded apart from an audio transcript of the operation, making it tough to identify what caused each complication. The black box would add much needed context.