Image reconstruction

조회 수: 1 (최근 30일)
li
li 2011년 4월 1일
http://www.flickr.com/photos/58977081@N02/5579460185/ Dear all I am currently doing the last part of my project, My project is to create the high resolution image, so as described as above, I have implemented a code for the ak function like
function piecewise=piecew(x)
z = mod(x,2)-1;
piecewise=abs(1-abs(z)).*(abs(z)<1);
end
for those I1(x-x1,y-y1),I2(x-x2,y-y2)....Ik(x-xk,y-yk) noted that x1,y1,x2......yk are the shifts on each images. so how can I use the piecew(x) function to construct a high resolution code ? thanks

답변 (1개)

Walter Roberson
Walter Roberson 2011년 4월 1일
mod(x,2) is zero if and only if x is an integer multiple of 2; otherwise, mod(x,2) is a number larger than 0. z = mod(x,2)-1 thus reaches its minimum, -1 if x is an integer multiple of 2 and reaches its maximum (2-delta)-1 = 1-delta at limit(delta->0, delta>0, x+delta is an integer multiple of 2). -1 <= z < 1 .
abs(z) is thus 1 if and only if x is an integer multiple of 2, and is less than 1 otherwise. Hence abs(z)<1 is false (0) if and only if x is an integer multiple of 2, and is true (1) otherwise.
abs(z) decreases from 1 as x increases away from an integer multiple of 2, reaching minimum of 0 at x-1 being an integer multiple of 2, and increasing again to 1-delta as x approaches the next multiple of 2.
Hence 1-abs(z) increases from 0 as x increases away from an integer multiple of 2, reaching 1 when x-1 is an integer multiple of 2, and decreases again to delta as x approaches the next multiple of 2. None of these values are negative so abs(1-abs(z)) has the same behavior.
The effect of multiplying the above expression by a number that is 0 when x is an integer multiple of 2 is nothing, as the value is already 0 when that is the case. The overall expression can thus be reduced to
1-abs(mod(x,2)-1)
As analyzed above, this expresion is 0 when x is an integer multiple of 2, is mod(x,2) when mod(x,2) <= 1, and is 1-mod(x,2) for mod(x,2) > 1
This function is not 1-periodic as is required by the problem definition paper: it is 2-periodic instead. You would have to work with z = mod(2*x,2)-1 instead to make it 1-periodic, and if you are going to do that you might as well rebuild the function from scratch.
  댓글 수: 2
li
li 2011년 4월 4일
thanks for your reply, so should I just change the function into 1-abs(mod(x,2)-1) than I can get the result?
thanks
Walter Roberson
Walter Roberson 2011년 4월 4일
No, 1-abs(mod(x,2)-1) is the _same_ as your function, and has the same problem as your function: it is 2-periodic instead of 1-periodic. You need to find a new function that is 1-periodic.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by