Code covered by the BSD License

### Highlights from Tensor Voting Framework

4.8
4.8 | 5 ratings Rate this file 14 Downloads (last 30 days) File Size: 22.3 KB File ID: #21051 Version: 1.0

# Tensor Voting Framework

### Trevor Linton (view profile)

12 Aug 2008 (Updated )

Implementation of the 2D medioni tensor framework

File Information
Description

Implemented in MATLAB v7.4.0.287, produced from text 'Emerging Topics in
Computer Vision' by Gerard Medioni. See demo.m to get started with using

NOTE:
* Line 70 in create_stick_tensorfield is not part of Medioini's description of the tensor stick field, however it was added to make the tensor field the same as the diagrams in Medioni's text. To get the original field described by Medioni's text remove this line.

Only one operation is included for feature extraction (calc_ortho_extreme). Please contact tlinton@cs.utah.edu if you have other feature extraction methods which you wish to include in the frameowrk.

MATLAB release MATLAB 7.4 (R2007a)
31 May 2016 PRINCE AGBODJAN Jesse James Arthur

### PRINCE AGBODJAN Jesse James Arthur (view profile)

Hi everyone. I'm new in tensor voting and I've been struggling to understand. So far I cope well, but I do not understand yet how to go from a ".jpg" or other format to ". edge". I'll be very grateful if someone could explain it to me. Thanks

Comment only
09 Mar 2015 robber john

### robber john (view profile)

confused about how to decompose the result matrix T

29 May 2013 Widya Wirya

Comment only
07 Mar 2013 Le

### Le (view profile)

Your code is help me a lot to understand TV.While I'm reading the book you referenced --Topics in Computer Vision,I'm confused by a question: it mentioned an equation 5.4,is about to say "the first order voting field for a unit stick voter aligned with the z-axis": SFO(d, θ) = DF(s,κ,σ)[−cos2θ)
−sin(2θ)]
,but how does ti reflected in your code?
Could you help me?

21 Aug 2011 Koushik

### Koushik (view profile)

In read_dot_edge_file.m file the edge input is converted to tensor value using the following codes. My question is what is the theory behind this. CAN ANYBODY HELP???

h = max(buf(:,1));
w = max(buf(:,2));
T = zeros(h,w,2,2);
for i=1:n
x = cos(buf(i,3)*pi/180 + 90*pi/180);
y = sin(buf(i,3)*pi/180 + 90*pi/180);
T(h+1-buf(i,1),buf(i,2),1,1) = x^2;
T(h+1-buf(i,1),buf(i,2),1,2) = x*y;
T(h+1-buf(i,1),buf(i,2),2,1) = x*y;
T(h+1-buf(i,1),buf(i,2),2,2) = y^2;
end

Comment only
18 Aug 2011 Chris Walker

### Chris Walker (view profile)

Hi,
In your convert_tensor_ev function, you have determine eigenvalues and eigenvectors using these commands:
% trace/2
t = (K11+K22)/2;

a = K11 - t;
b = K12;

ab2 = sqrt(a.^2+b.^2);
o3 = ab2 + t;
o4 = -ab2 + t;

theta = atan2( ab2-a, b );

where does the maths that underlies these commands come from?. I typed the following into Wolfram Alpha:
l1*{{cos(t)*cos(t),cos(t)*sin(t)},{cos(t)*sin(t),sin(t)*sin(t)}}+l2*{{sin(t)*sin(t),-cos(t)*sin(t)},{-cos(t)*sin(t),cos(t)*cos(t)}}

and I get different answers for the eigenvalues and eigenvectors.
Any help would be appreciated.
thanks
Chris Walker

Comment only
26 Jul 2010 Dev Arora

### Dev Arora (view profile)

Hi, I am not able to understand the concept how an image is converted into Tensor. Can anybody please explain me.
Thanks

09 Apr 2010 Franz Account

### Franz Account (view profile)

Cool work. Thanks for sharing

06 Mar 2010 Anil

### Anil (view profile)

hi,
can anyone tell me what the .edge files contain?

Anil

Comment only
06 Apr 2009 Trevor Linton

### Trevor Linton (view profile)

Hi Ben,

You're right the example code that reads in the edge files is wrong, however these were just used for examples.

The actual tensor voting code is correct however. Let me know if you notice any problems, feel free to contact me (tlinton@cs.utah.edu).

-t

Comment only
12 Jan 2009 Ben

### Ben (view profile)

To Trevor Linton

The sparse voting procedure is NOT correct. It should be processed according to the type of each input tokens, not just a stick voting or ball voting. That is, if an input token is a ball, a ball voting field is used; otherwise, a stick voting field is used. As I know, some applications DID NOT consider ball tensors in sparse voting (token refinement) step.

Generally, the input tokens have initial saliences. In your code, they all are forced to 1, which is due to the improper format of the input file.

Hope you will correct your codes.

Comment only
28 Oct 2008 Trevor Linton

### Trevor Linton (view profile)

I apologize, the sparse field simply converts points to initial ball tensors, the refined is the ball voting and calc_vote_stick is the actual stick voting.

Comment only
17 Oct 2008 Ya-Fan Su

Your code is clear and easy to trace. I really appreciate your work. I also found the book you referenced ("Topics in Computer Vision") is more concise than their previous one ("A Computational Framework for Segmentation and Grouping"). Thanks for sharing this information.

I have a few questions after tracing your codes.
1. The input are sticks, is it necessary to use ball voting in "find_features"? I skipped "calc_sparse_field" and "calc_refined_field", and found the results are very similar.
2. I could understand why you add the code in line 70 in "create_stick_tensorfield", but I also wonder how the coordinate translation is derived. Could you tell me more details about it? Thanks.