Blob orientation

Typically: "How do I... ", "How can I... " questions
Post Reply
BiancaSan93
Posts: 23
Joined: 25 Apr 2017, 17:26

Blob orientation

Post by BiancaSan93 » 07 Dec 2018, 16:01

Hi,
I am making some experiments with the blob detection camera, in order to detect the orientation of some objects in the scene, but I am unsure about the returned value.
I only have one blob and my code is

Code: Select all

    
    res1,packet1a,packet1b=sim.handleVisionSensor(sensor1)

    if res1 >=0 then

        q1=packet1b[4]
        q1=q1*180/math.pi --convert to degrees
        sim.setFloatSignal('detectedAngle',q1)
        print(q1)
    end
The values printed out are obviously the angle of inclination of the detected object, but relative to what exactly? Shouldn't the orientation be a table with the euler angle, and if not, what angle is it measuring (alpha, beta, gamma)? This causes me a problem because, if I plot the results, I get the following

Image

The object I am tracking is attached to a revolute joint, exactly in front of the sensor, following a sinusoidal trajectory.
Obviously it detects the orientation of the blob as the opposite one after certain angles. Is there a way to transform the blob orientation scalar value with respect to the orientation of another object? How do I do that, if I don't know the whole orientation matrix?

Thanks in advance

coppelia
Site Admin
Posts: 6867
Joined: 14 Dec 2012, 00:25

Re: Blob orientation

Post by coppelia » 10 Dec 2018, 14:58

Hello,

the extracted blob orientation is always relative to the vision sensor's Y axis (or its viewing axis). You can't possible extract the full orientation of the object based on a single blob, since that is 2 D information.

Cheers

Post Reply