Aug 28, 2010

Lua + Image

I usually works with images, and have to write many code even only for a simple testing. Now I try to implement toolkits with Lua, hope that I can do more things by the help of script. With the script below:


function Main()

local img0 = Urd.CImage32F();
local img1 = Urd.CImage32F();

img0:Load("D:/img/NTU/106009.JPG", Urd.ChannelL);


CImageProcessor.GaussianSmooth(img1, img0, 7, 7, 2.0, 2.0);
CImageProcessor.OperateImgNImg(img1, img0, img1, Urd.OperatorSub);
CImageProcessor.OperateImgNScalar(img1, img1, 10.0, Urd.OperatorMul);

img1:Save("D:/img/ttt.jpg", Urd.ChannelL);

end


I got this result :


They are "C like" since I implement them in C with the same function and class name. Hope this will become useful in a few days.

No comments: