Programs written in Halide (a new programming language) are much easier to read and write as well as way more efficient than the corresponding codes written in the languages available in the language ‘arena’ today .
The researchers at MIT’s Computer Science and Artificial Intelligence Laboratory have put their nerves out to develop a new Programming Language – the Halide for scripting image processing softwares. The new language is described as an optimized language for image processing algorithms . Programs written in Halide are much easier to read and write as well as way more efficient than the corresponding codes written in the languages available in the language ‘arena’ today .
THE REAL THING :
Jonathan Ragan-Kelly ( from the department of Electrical Technology, MIT ) along with Andrew Adams, a CSAIL postdoc- the co developers of the Halide explained the urge to develop the new programming language for the purpose. The implementations that the programmers apply to enhance the Time-Complexity of their image processing algorithms render their code unreadable and machine specific. It then becomes extremely tedious to modify the purpose or environment (machine) that the program is running in.
Now this is where the Halide outpower the conventional image-processing languages. Writing programs in Halide is far more easier and dependable as well as the automated code-optimization feature puts it at the top of the charts. Halide stands tall on both grounds – the space in memory and the running time of the algorithm. As a result of several coding experiments conducted by the developers, results revealed Jaw dropping stats. The code written in halide was about one third of the corresponding code in other languages, yet it was around five to six times faster. In one of the instances, with a little compromise on the space the code was actually as much as 70 times faster.
The developers of Halide put up the following words to explain the nitty-gritty of the image processing :
One reason that image processing is so computationally intensive is that it generally requires a succession of discrete operations. After light strikes the sensor in a cellphone camera, the phone combs through the image data for values that indicate malfunctioning sensor pixels and corrects them. Then it correlates the readings from pixels sensitive to different colors to deduce the actual colors of image regions. Then it does some color correction, and then some contrast adjustment, to make the image colors better correspond to what the human eye sees. At this point, the phone has done so much processing that it takes another pass through the data to clean it up.
And that’s just to display the image on the phone screen.
THE REAL THING :
The megapixel cams capture every detail of the picture . The detailing goes even deeper as the MP increases, thus the processor has work on its toes to convert it into an image . It is for this reason the weak processors, say that of a mobile phone an awful long time to finally put up a captured image. Anything more than removing red eye or just setting up the brightness and colour saturation may ask for more detailed processing , even going back to the prior stages and reset the codes.
PARALLEL COMPUTATION AND SCHEDULING :
To enhance the efficiency of the image processing, the concept of parallelization is brought into use . Parts of image are sent to different cores of a multicore processor . Each core processes its image chunk indivisually and returns the computation back to the main memory. However there is a huge setback for the above implementation . The fact that the data transfer from the processor to the memory takes much time than the computation of the processor , thus leaving parallelization a ‘good for nothing ’ concept .
This is where Halide comes to the rescue , packed up with its automated feature ‘Schedule’ . A typical Halide program consists of two sections – the algorithmic part and the ‘Schedule’. The schedule specifies the vitals of the lump of the image, sent to each of the parallel cores. The schedule is drawn up by the programmer himself. Thus if he intends to run the code on a different machine , all he need to do is to alter the schedule, the algorithmic remaining same.
By all means the new programming language is surely a ease for the both the programmers and the users. With image processing softwares running wild in the socials (Instagram , a image based app, is talked of being to be acquired by Facebook for a billion dollars ), Halide is expected to pump up the stage . Once again the MITians have put up the worthiness of the name.