Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Octave 1.05 KB | None | 0 0
  1. %this is the image
  2. %[0 0 0 0 0 0;
  3. % 0 0 0 0 0 0;
  4. % 0 0 0 1 0 0;
  5. % 0 0 0 0 0 0;
  6. % 0 0 0 0 0 0];
  7. % FilterCoefficientes [0 1 0] is to not smooth the image
  8. % next is the answer from MATLAB
  9.  
  10.  M = cornermetric([0 0 0 0 0 0;0 0 0 0 0 0;0 0 0 1 0 0;0 0 0 0 0 0;0 0
  11. 0 0 0 0], "FilterCoefficients", [0 1 0])
  12. M =
  13.          0         0         0   -0.0400         0         0
  14.          0         0         0   -0.0400         0         0
  15.          0         0   -0.0400         0   -0.0400   -0.0400
  16.          0         0         0   -0.0400         0         0
  17.          0         0         0   -0.0400         0         0
  18.  
  19. % The calculation to go from 1 to -0.04 is:
  20. %SensitivityFactor = 0.04 (optional parameter to the function)
  21. %A = horizontal_border; % in the original paper the filter is [-1 0 1], maybe this filter is used twice in the image somehow. Any idea how to pass twice the filter?
  22. %B = vertical_border;
  23. %C = diagonal_border;
  24. %Result = A.*B - C.*C - SensitivityFactor*(A + B);
  25. % A.*B - C.*C is equal to 0, then
  26. % - SensitivityFactor*(A + B)  == -0.04
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement