Skip to content

Comments

code 3.1&3.2#12

Open
qiuting1995 wants to merge 4 commits intotroussil:masterfrom
qiuting1995:PTIR_part1
Open

code 3.1&3.2#12
qiuting1995 wants to merge 4 commits intotroussil:masterfrom
qiuting1995:PTIR_part1

Conversation

@qiuting1995
Copy link
Contributor

I wrote some codes in part 3.1&3.2, realize the calculation of the lowest cost path.

I wrote some codes in part 3.1&3.2, realize the calculation of the lowest cost path.
% Calculat the cost function
% The gradient strength cost Fg
dImg = double(dImg);
[dY, dX] = gradient(dImg);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please document what does the 'gradient' function

dFg = 1 - dFg./max(dFg(:));

% The zero-crossing cost Fz
lFz = ~edge(dImg, 'zerocross');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please recall what does the 'edge' function in a comment

% The zero-crossing cost Fz
lFz = ~edge(dImg, 'zerocross');

% The gradient direction Fd ??
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO


% The gradient direction Fd ??
% The Sum:
dF = dWz.*double(lFz)+ dWg.*dFg;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not forget that costs are defined at pixel p from its 8 neighbors (horizontal, vertical and diagonal). Fg is for instance scaled by 1 for diagonal neighbors and by 1/sqrt(2) for horizontal and vertical neighbors. See the paper (eq. 3 and text around).

@troussil
Copy link
Owner

Nice. Please, modify the code according to my comments and think about testing your code.

last time I used Fz and Fg to calculate the l(q). this time I add Fd to calculate the l(p,q). and with l(p,q) I modify some code in other functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants