The story began as the sun started to goes down and travelers in varied apparel started heading to this mystery hall. Slowly, the hall began to fill up. As the travelers got settled, in came their leader. Sporting a large beard and short hair, he looked like a lion satisfied with a recent meal: serene but ready to pounce at the first sign of danger.
As the leader began to talk, all eyes were on him. It seemed as if all the lights in the world, save the one on this man, had gone out. All hung on every word. The leader’s words were wise and captivating as he talked about all that he had seen.
I could sense that he was talking about something familiar as the idea had not been one that was alien to me. As he spoke, the essence of the matter that I had failed to recognize earlier dawned on me.
Long ago, our Prince started the journey to see what others could not. The Prince was blind as a bat. As a result, it was hard to imagine the Princess. All the Prince had of her was a photo and as his numerous attempts to decipher the contents of the photo failed he had gotten sadder and sadder.
The Prince had gotten far enough to understand that in order for him to see the princess clearly, he would have to first remove all the minor dirt that covered his Princess’ portrait. The leader had referred to this as removing noise from the photo. Not knowing what his Princess truly looked like had been the bane of our Prince’s existence. He had time and again pondered over how to remove those tiny speckles of dirt but they were just so many of them. And spread so randomly that it was hard to decipher what was dust and what was the Princess’s face.
The leader said that to get rid of the unknown without harming what you wanted was impossible, yet his years of wisdom had taught him that if one simply averaged out the noise one could see a clearer picture.
The Prince, who had grown impatient, quickly designed a way of averaging out the dirt from over the portrait of his Princess. However, in his hurry he did somewhat of a clumsy job. As he hurried through reducing the effect of the dirt, he could already see the picture improving. He felt more connected to the Princess and he became more passionate about his task.
The Prince struggled for hours following the leader’s instructions to the letters in trying to find out his true Princess. He did what the leader described as using the differences between colors in looking at the picture to tell when he had come across some new feature in the picture. The Prince knew he was close to his goal so he did not lose hope despite repeated failure. Not being able to see, he used the computing power that was given to him from the great sorcerers of the past.
Once he had done the differentiating of new features based on colors he could not see, he amplified all the changes. He held his breath and ran his fingers across the photo to discern what his Princess looked like. His heart skipped a few beats as he admired how beautiful her face was. Finally, he knew. Using cutting edge techniques in edge detection in images.
The code is given below.