Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Oct 25, 2011

4x4


4x4 in App Store


沒什麼人下載,從下載量跟分數看來,有七分之六的人下載後連第一關都沒過,可能是介面太難操作,也可能是二位數加減法太難了。寫到這裡忽然想起小學老師總說:「米國人買東西結帳一定要用計算機才算得清楚。」難道……這就是這個App 最致命的缺點嗎? XD

Oct 9, 2010

kMean-2

Iteration = 2

Iteration = 3

Iteration = 4

Iteration = 5

Iteration = 6

Iteration = 7

Iteration = 8

All with k = 6.

Oct 8, 2010

kMean

k = 16

k = 8

k = 4

k = 2

All in 2 iterations.

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 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.

Jun 3, 2010

Commander Shepard is a Programmer !


Screenshot from Mass Effect 2.
Never thought that "code" would appear in games !

May 18, 2010

HDR - 6



alpha = 0.09
beta = 0.9
s = 0.1

May 16, 2010

HDR - 5

Some bugs are fixed. Here is new radiance map :

linear tone mapped in log domain :


Gradient attenuation map :

linear mapping after attenuation in log domain :

LDR with exp(I) :

Final result :

There are still some problems :
1. How to get better result from Poisson equation ?
2. How to select alpha & beta ?
3. Final result is not as good as the one presented in original paper.

May 11, 2010

HDR - 4


I think ...... I didn`t add any special effect ......

May 10, 2010

HDR - 3

what`s this ? Should I commit suicide ?

May 9, 2010

HDR - 2

I have tried to impl gradient domain tone mapping recently since the paper said it is "simple". But I still can`t get the correct result.

Above is the result of Poisson equation. After this, I don`t know how to mapping all channels. Below is one of my test which mixed 3 result (rgb) of poission equation.



Hope I can solve it in a few days /_\.

May 1, 2010

HDR

Recently, I have to check if the knowledge of HDR in my brain is correct. Here are some result :

1. One of Paul Debevec`s data set. Since my camera "can not" manually change shutter speed and I don`t want to implement MTB currently, I test the algorithm by this data set.


2. Rough tone mapped result :


3. Rough radiance map :


The response curve recovery algorithm is not difficult since you can find matlab version in the end of the paper.

Apr 11, 2010

stitching - 2

The left most part is incorrect...don`t know why /_\

Both of the photo set are taken without tripad.
I got more problems now :
  • It took too much time in matching. So......maybe I need something like kd tree ? (but I`m lazy)
  • I calculate the camera parameters by SBA one by one. But can`t optimize all of them at the same time (after getting rough result ), the image above are stitched by those "rough" result. There may be some bug in my sba usage.
  • Multi-band blending ?

Apr 4, 2010

stitching


Apply SBA, still can`t get good result and don`t known how to get better focal length.

20100408
p.s.
Now I got better result due to fix a typo in DLT. XD

Mar 24, 2010

stitching with DLT


Quick testing with direct linear transformation. The result is better than affine transformation. I guess it`s time to use bundle adjustment.

Mar 18, 2010

SIFT with up scale

without up scale :

with up scale :

Up scaling provide about 50% matched features. Now I have to work on memory & cpu usage balance.

Mar 13, 2010

Affine Stitching


After adding hat function, clamping descriptor and remap float to u8, I got better result. The paper weighted each bin in descriptor with 1 - d. I don`t know why I can`t get better result. But clamp magnitude to 0.01 ~ 0.99 works fine in my implementation.


I can`t wait to try this ! So I made a simple implementation to stitch image : SIFT + Affine + RANDSAC + SVD. Replace affine model should get better result, I will try it later.