Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:02:31+00:00 2026-06-10T18:02:31+00:00

I have a camera and its K matrix (calibration matrix) also I have image

  • 0

I have a camera and its K matrix (calibration matrix) also I have image of plane, I know the real points of the 4 corners and thier correspondence pixel. I know how to compute the H matrix if z=0 (H is homography matrix between Image and the real plane).
And Now I try to get the real point of the plane (3D point) with the rotation matrix and the transltion vector
I follow this paper :Calibrating an Overhead Video Camera by Raul Rojas in section 3 – 3.3.
My code is:

ImagePointsScreen=[16,8,1;505,55,1;505,248,1;44,301,1;];

screenImage=imread( 'screen.jpg');
RealPointsMirror=[0,0,1;9,0,1;9,6,1;0,6,1]; %Mirror
RealPointsScreen=[0,0,1;47.5,0,1;47.5,20,1;0,20,1];%Screen
imagesc(screenImage);
hold on
for i=1:4
    drawBubble(ImagePointsScreen(i,1),ImagePointsScreen(i,2),1,'g',int2str(i),'r')
end

Points3DScreen=Get3DpointSurface(RealPointsScreen,ImagePointsScreen,'Screen');

figure
hold on
plot3(Points3DScreen(:,1),Points3DScreen(:,2),Points3DScreen(:,3));
for i=1:4
    drawBubble(Points3DScreen(i,1),Points3DScreen(i,2),1,'g',int2str(i),'r')
end



function [ Points3D ] = Get3DpointSurface( RealPoints,ImagePoints,name)
M=zeros(8,9);

for i=1:4

M((i*2)-1,1:3)=-RealPoints(i,:);
M((i*2)-1,7:9)=RealPoints(i,:)*ImagePoints(i,1);
M(i*2,4:6)=-RealPoints(i,:);
M(i*2,7:9)=RealPoints(i,:)*ImagePoints(i,2);   

end

[U S V] = svd(M);
X = V(:,end);
H(1,:)=X(1:3,1)';
H(2,:)=X(4:6,1)';
H(3,:)=X(7:9,1)';
K=[680.561906875074,0,360.536967117290;0,682.250270165388,249.568615725655;0,0,1;];

newRO=pinv(K)*H;
h1=newRO(1:3,1);
h2=newRO(1:3,2);

scaleFactor=(norm(h1)+norm(h2))/2;
newRO=newRO./scaleFactor;
r1=newRO(1:3,1);
r2=newRO(1:3,2);
r3=cross(r1,r2);
r3=r3/norm(r3);

R=[r1,r2,r3];

RInv=pinv(R);
O=-RInv*newRO(1:3,3);
M=K*[R,-R*O];
for i=1:4
   res=pinv(M)* [ImagePoints(i,1),ImagePoints(i,2),1]';
   res=res';
   res=res*(1/res(1,4));
   Points3D(i,:)=res';

end
Points3D(i+1,:)=Points3D(1,:);  %just add the first point to the end of the array for draw square

end

My result is :
enter image description here

Now I have two problem :

1.The point 1 is at (0,0,0) and this is not the real location

2.the points are upside down

What I am doing worng?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:02:33+00:00Added an answer on June 10, 2026 at 6:02 pm

    I found the answer in the paper: Calibrating an Overhead Video Camera by Raul Rojas in section 3 – 3.3.

    for the start: H=K^-1*H
    Given four points in the image and their known coordinates in the world, the
    matrix H can be recovered, up to a scaling factor . We know that the first
    two columns of the rotation matrix R must be the first two columns of the
    transformation matrix. Let us denote by h1, h2, and h3 the three columns of
    the matrix H.Due to the scaling factor we then have that
    xr1 = h1
    and
    xr2 = h2
    Since |r1| = 1, then x= |h1|/|r1| = |h1| and x = |h2|/|r2| = |h2|. We can thus
    compute the factor and eliminate it from the recovered matrix H. We just set
    H’= H/x
    In this way we recover the first two columns of the rotation matrix R.
    The third column of R can be found remembering that any column in a rotation
    matrix is the cross product of the other two columns (times the appropriate
    plus or minus sign). In particular
    r3 = r1 × r2
    Therefore, we can recover from H the rotation matrix R. We can also recover
    the translation vector (the position of the camera in field coordinates). Just
    remember that
    h’3 = −R^t
    Therefore the position vector of the camera pin-hole t is given by
    t = −R^-1 h3

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 3D camera with its current rotation stored as a quaternion, and
I have an abstract class called camera which PointCamera uses as its super class.
I have a table that will display the name of camera and its model.
I have an analog camera that returns both fields interlaced when I query its
Assume I have a camera defined by its position and direction, and a box
I have written an application which triggers an IP Camera to stream it's data
I have an application in C# that interfaces to a USB camera. It's been
I have a camera quaternion (a,b,c,d) and a cam position (camX, camY, camZ) I
I have a camera and I am trying to connect to it vis suds.
I have a camera on my network which I am trying to connect to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.