I believe the projection matrix has to be 3 by 4, not 4 by 4. then considering Z = 0, third column can be eliminated and we are left by a 3 by 3 Homography matrx
at 5:53 it should be a 3x4 matrix, 4x4 by 4x1 does not give 3x1. Camera intrinsic matrix is 3x3, extrinsic is 3x4 giving us a 3x4 matrix, not a 4x4. Then we take z=0, and ignore the 3rd column, giving us a 3x3 matrix. Please rectify or correct me if i am wrong.
Thanks for very informative video on homography in CV. Please clarify when I am taking coordinate from image, they will be in x,y like 0,0 for top-left corner and some other point say 115, 269. Now while calculating homographic matrix, shall we need to convert them into meters like meter/pixel into pixel coordinate or can we use image coordinates directly in the equations for calculating Homographic matrix.
No that's correct, please have look at the link where everything is available in latex and python ros-developer.com/2017/12/26/finding-homography-matrix-using-singular-value-decomposition-and-ransac-in-opencv-and-matlab/
Hi,it is really an excellent tutorial,Thank you so much. But I still have a question about its application. I am gonna use this to remove perspective distortion which requires me to get a frontal image from an arbitrary position of the same image.But i only have one picture,therefore,the question is that how can I get the corresponding points to calculate the H matrix. Looking forward your reply!Thank you Best
You need at least for points in your image that are in the same plane, for instance, if you take photo of ground floor pick for points from the floor, have look at my opencv example in the description, cheers.
does this model work for CCD cameras as well? so we can calculate coordinates of a 3D point in the world using its image coordinates and Homography matrix of camera? it would be great if you explain how we can generate homography matrix for a CCD camera. Many thanks.
This (Homography) is a pure geometrical model for a pine hole camera and nothing to do with sensor (CCD or CMOS), you can follow the link in the description for implementation. If you interested in 3D reconstruction please have look at SFM in the other post here: ros-developer.com/tag/sfm/ Good luck :)
what do you mean for "implementation"? Is this sth related to a camera matrix (sensor matrix) for CCD? If not, is there any possible solutions for the case of CCD? Thanks.
I also found this video which explains "complete camera model" using homography and homogenous coordinate system and it is also showing CCD sensor at 13:37. Could you please clarify if I am wrong! Since I don't have a good knowledge and background about cameras, I am a bit confused!
@@sahartabrizi6155 این مدل کلی هندسیه برای مرتبط کردن فضای تصویر و زمین دوربین آنالوگ باشه یا دیجیتال تو استفاده از این مدل تفاوتی ایجاد نمیکنه اگه آنالوگ باشه مختصات عکسی رو از روی عکس با یه سری دستگاهای مخصوص میخونیم اگه دیجیتال باشه مختصات ماتریسی سل سی سی دی رو به عنوان داده استفاده میکنیم.کع الان کلا عکس آنالوگ منسوخ شده و فقط تو دانشگاه روشش رو تدریس میکنن محض آموزش.
The Homography matrix has 9 parameters. Let me walk you through it. When you transform something from 3d to its projection in 2d, you lose one degree of freedom. What this means is you could scale up everything i.e. make the object bigger and twice as far and not tell the difference from your 2d photo. Example: If you took a photo of the moon vs. Took a photo of a small pea sized moon that was much much closer, you wouldn't be able to tell. They do this with miniature movie sets. Ok, so then since that degree of freedom regarding scale is lost, mathematically it translates to a scaling factor multiplied on both sides of the equations. So we say let's make the norm of the h matrix equal to 1 without loss of generality i.e. ||H|| = 1. If that's the case then we have 8 degrees of freedom to find the values of H. E.g. If I told you to find 2 variables a and b in some equation but told you that a^2 + b^2 = 1, then I have constrained the solution to a circle. You only need to find 1 variable (say a), the other is sqrt(1 - b^2). Hence n-1 degrees of freedom.
This helped a lot at 1 day before my CV exam. Thanks!
بهنام جان دمت گرم فقط عکس اول با کیفیت محتوا کمی تفاوت داشت. مطالبت بسیار مفید و آموزنده بود
This is a great video and helped me get unstuck on a problem I was working on. Thank you!
Thanks Behnam, very informative like always 🙏
13:16 A little mistake here... -x'2H11 should be -x1H11
Thank you very much for this video! It must have taken quite a lot of effort to make this video! Thank you for your effort :))
I believe the projection matrix has to be 3 by 4, not 4 by 4. then considering Z = 0, third column can be eliminated and we are left by a 3 by 3 Homography matrx
Thank you for creating this video, it helps me understand homography better.
In 9:51 - Correct : H33
Awesome explanation thank you a lot with such a difficult topic!
at 5:53 it should be a 3x4 matrix, 4x4 by 4x1 does not give 3x1. Camera intrinsic matrix is 3x3, extrinsic is 3x4 giving us a 3x4 matrix, not a 4x4. Then we take z=0, and ignore the 3rd column, giving us a 3x3 matrix. Please rectify or correct me if i am wrong.
thank you, this is what we were taught
he just forgot to put homogeneous coordinate so like x,y,z,1 for LHS and RHS
Yes there is a mistake.
Thanks for very informative video on homography in CV.
Please clarify when I am taking coordinate from image, they will be in x,y like 0,0 for top-left corner and some other point say 115, 269. Now while calculating homographic matrix, shall we need to convert them into meters like meter/pixel into pixel coordinate or can we use image coordinates directly in the equations for calculating Homographic matrix.
Great video...
Great tutorial! Thanks a lot!
Thanks for this video!
you saved my final
so how can you recover the tvec and rvec from this homography matrix if we know the intrinsic parameters
Please check here docs.opencv.org/4.x/d9/d0c/group__calib3d.html#ga7f60bdff78833d1e3fd6d9d0fd538d92
the best in the world! thank you.
17:12 Should the top left cell in the 9x9 matrix be -x2 instead of -x1
No that's correct, please have look at the link where everything is available in latex and python ros-developer.com/2017/12/26/finding-homography-matrix-using-singular-value-decomposition-and-ransac-in-opencv-and-matlab/
Hi,it is really an excellent tutorial,Thank you so much.
But I still have a question about its application.
I am gonna use this to remove perspective distortion which requires me to get a frontal image from an arbitrary position of the same image.But i only have one picture,therefore,the question is that how can I get the corresponding points to calculate the H matrix.
Looking forward your reply!Thank you
Best
You need at least for points in your image that are in the same plane, for instance, if you take photo of ground floor pick for points from the floor, have look at my opencv example in the description, cheers.
Yes, thank you, I have figured it out!
very clear - thanks
does this model work for CCD cameras as well? so we can calculate coordinates of a 3D point in the world using its image coordinates and Homography matrix of camera? it would be great if you explain how we can generate homography matrix for a CCD camera. Many thanks.
This (Homography) is a pure geometrical model for a pine hole camera and nothing to do with sensor (CCD or CMOS), you can follow the link in the description for implementation. If you interested in 3D reconstruction please have look at SFM in the other post here: ros-developer.com/tag/sfm/
Good luck :)
what do you mean for "implementation"? Is this sth related to a camera matrix (sensor matrix) for CCD? If not, is there any possible solutions for the case of CCD? Thanks.
I also found this video which explains "complete camera model" using homography and homogenous coordinate system and it is also showing CCD sensor at 13:37. Could you please clarify if I am wrong! Since I don't have a good knowledge and background about cameras, I am a bit confused!
@@sahartabrizi6155 این مدل کلی هندسیه برای مرتبط کردن فضای تصویر و زمین دوربین آنالوگ باشه یا دیجیتال تو استفاده از این مدل تفاوتی ایجاد نمیکنه اگه آنالوگ باشه مختصات عکسی رو از روی عکس با یه سری دستگاهای مخصوص میخونیم اگه دیجیتال باشه مختصات ماتریسی سل سی سی دی رو به عنوان داده استفاده میکنیم.کع الان کلا عکس آنالوگ منسوخ شده و فقط تو دانشگاه روشش رو تدریس میکنن محض آموزش.
5:46, the matrix should be 3x4.
shouldnt it be 4x3?
why degree of freedom is 8 ?
The Homography matrix has 9 parameters.
Let me walk you through it.
When you transform something from 3d to its projection in 2d, you lose one degree of freedom. What this means is you could scale up everything i.e. make the object bigger and twice as far and not tell the difference from your 2d photo.
Example:
If you took a photo of the moon vs. Took a photo of a small pea sized moon that was much much closer, you wouldn't be able to tell. They do this with miniature movie sets.
Ok, so then since that degree of freedom regarding scale is lost, mathematically it translates to a scaling factor multiplied on both sides of the equations. So we say let's make the norm of the h matrix equal to 1 without loss of generality i.e. ||H|| = 1. If that's the case then we have 8 degrees of freedom to find the values of H.
E.g. If I told you to find 2 variables a and b in some equation but told you that
a^2 + b^2 = 1, then I have constrained the solution to a circle. You only need to find 1 variable (say a), the other is sqrt(1 - b^2). Hence n-1 degrees of freedom.