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.

Aug 8, 2010

Blur (Image) - Image


Nothing special, I just wanna update my blog.

Jul 18, 2010

G1S was down !

Now I have 2 choices: buy a new PC, or repair G1S. G1S was down, but ASUS never let me down. I won`t buy their notebook again.

Jul 14, 2010

塗鴨集









新玩具!

Jul 2, 2010

Simple Extension for wxFileDropTarget of wxWidgets


//--------------------------------------------------------------------------
class CWxDnDSink
{
public:
CWxDnDSink();
virtual ~CWxDnDSink() = 0;

virtual Result OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& rFile);
};

//--------------------------------------------------------------------------
class CWxFileDropTarget : public wxFileDropTarget
{
CWxDnDSink* pDnDSink;

public:
CWxFileDropTarget(CWxDnDSink* pSink);
virtual ~CWxFileDropTarget();

virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& rFile);
};


Then every wxWindow can inherit CWxDnDSink, and SetDropTarget with a CWxFileDropTarget object. Quite simple and useful for me since I don`t want to write new drop target every time (like the dnd sample).

Jun 14, 2010

HDR - 8

FINALLY !!!

Jun 11, 2010

HDR - 7

Here is better result by using 3 different response curve (red, green & blue) at the same time.

1. Linear tone mapping in log domain :


2. Tone mapping in gradient domain :

3. Response curve :


p.s.
In sampling step, I sort all pixels in the image with largest exposure. Force sampling the brightest pixel, then sampling the others averagely.