Intro to Image Understanding (CSC420) 4R

Java Python Intro to Image Understanding (CSC420)

Assignment 4

Due Date: November 25th , 2024, 10:59 pm

Total:  160 marks

General Instructions:

• You are allowed  (and encouraged) to search the web and use LLMs for learning, as explained in the syllabus.  You are, however, not allowed to ask an LLM to write the answers or code for you!

• You are allowed to work directly with one other person to discuss the questions. How- ever, the implementation and the report should be your own original work; i.e.  you should not submit identical documents or codes.  If you choose to work with someone else, write your teammate’s name on top of the first page of the report.

• Your submission should be in the form. of an electronic report (PDF), with the answers to the specific questions (each question separately), and a presentation and discussion of your results. For this, please submit a file called report.pdf to MarkUs directly.

•  Submit documented codes that you have written to generate your results separately. Please store all of those files in a folder called assignment4, zip the folder, and then submit the file assignment4.zip to MarkUs.  You should include a README.txt file (inside the folder) which details how to run the submitted codes.

•  Do not worry if you realize you made a mistake after submitting your zip file; you can submit multiple times on MarkUs.

• MarkUs has a file size limit. If your pdfor zip file is larger than the limit, you can try resizing or reducing the resolution of images in your report to reduce the file size. If that does not work, you can split your report into multiple files (e.g.  Report part 1 of 3.pdf, Report part 2 of 3.pdf, etc.)

Part I: Theoretical Problems (100 marks)

[Question 1] RANSAC (10 marks)

We have two images of a planar object (e.g. a painting) taken from different viewpoints and we want to align them. We have used SIFT to find a large number of point correspondences between the two images and visually estimate that at least 70% of these matches are correct with only small potential inaccuracies. We want to find the true transformation between the two images with a probability greater than 99.5%.

1. (5 marks) Calculate the number of iterations needed for fitting a homography.

2. (5 marks) Without calculating,  briefly explain whether you think fitting an affine transformation would require fewer or more RANSAC iterations and why.

[Question 2] Single View Metrology (15 marks)

Given the streetcar picture below, calculate the distance between the two tracks. We know that the distance between the rails in each track is (approximately) 1.5 metres.

Hint:  We know ratios  (of lengths or  areas) are not preserved in perspective projection. But cross-ratios are invariant.  But  cross-ratio  is a projective invariant; i.e., it is preserved by the projective transformations.  You can read the formal definition of cross-ratio here: https://en.wikipedia.org/wiki/Cross-ratio. This Numberphile video will also be very helpful in solving this question: https://www.youtube.com/watch?v=ffvojZONF_A.  The figure below illustrates what we know and what we want to measure.

[Question 3] Camera Models (50 marks)

Assume a plane passing through point P0  = [X0 ,  Y0 ,  Z0]T  with normal n.  The corresponding vanishing points for all the lines lying on this plane form. a line called the horizon.  In this question, you are asked to prove the existence of the horizon line by following the steps below:

1. (15 marks) Find the pixel coordinates of the vanishing point corresponding to a line

L, passing point P0  and going along direction d.

Hint: P = P0 +td are the points online L, and(p) = are pixel coordinates of the same line in the image, and where f  is the camera focal length and (px , py ) is the principal point.

Intro to Image Understanding (CSC420) Assignment 4R

2. (15 marks) Prove the vanishing points of all the lines lying on the plane form. a line.

Hint:  all the  lines on the plane are perpendicular to the plane’s normal n;  that is,n .d = 0, or nx dx  + ny dy + nz dz  = 0

3. (10 marks) Prove that oarallel planes in 3D have the same horizon line in the image.

4. (10 marks) In the picture below, which is higher: the camera that took this picture, the parachute, or the parachuter? Clearly explain and justify your answer.

[Question 4] Camera Models (25 marks)

We have taken a picture of a cube and have found the 3 vanishing points associated with the cube edges. Using these vanishing points (let’s call themv1, v2 , and v3 ), find the rotation ma- trix R that relates the 3D camera coordinate frame. with the world coordinate frame. aligned with the edges of the cube. Hint: The world coordinate frame. and a camera coordinate frame. are related through a rotation matrix R and a translation vector t.  That is, if Xw  is a 3D point expressed in the world coordinate system, the same 3D point has coordinates Xc  in the camera frame, where Xc  = R  Xl  +t. Here, we want to find the rotation matrix R. Assume v1  is the vanishing point associated with cube edges in the x direction, v2  the vanishing point associated with the cube edges in the y  direction, and v3  with the edges in the z  direction.

Part II: Implementation Tasks (60 marks)

[Question 5] Homography and Tracking (60 marks)

The goal of this assignment to replace a planar image throughout a video file with another im- age. For this purpose, you can use one of the the attached videos (e.g.  KandinskyBook. mp4 or GalleryGrill . mp4 or HartHousePoster. mp4) and replace one of the images/posters with a headshot of yourself (or any image you would like).   Or,  if you  prefer, you can record your own short video (e.g.  a video showing a billboard) and replace the advertisement in the billboard with a picture of yourself (or any image you would like).   For  example,  if you use KandinskyBook. mp4, then replace the top-left panel with an image of your choos- ing.   If you  use  GalleryGrill. mp4,  replace the poster for  Gallery Grill,  and if you use HartHousePoster. mp4, replace the Hart House poster.

You can use any approach you like to implement this task.  This question gives you an opportunity to use any of the techniques you’ve learned in this class to solve the problem.

For example, you can also take ideas from the SIFT/affine transformation tutorial and modify the tutorial code to achieve the desired objective in this assignment.  Alternatively, the following steps are provided as a suggestion and provide another way of implementing this objective. You are welcome to alter them or use your own innovative ideas; i.e. you can use any method that you wish, as long as it doesn’t require manually annotating anything other than the first frame. of the given video!  As with all the coding assignments, you are allowed to use tutorial code or any code samples you find online as starter code; but make sure you acknowledge all your sources.

1.  Locate the 4 corners of the top-left panel:  you  can  do this however you like, either manually  (mouse  cursor coordinates) or semi-automatically using the Harris corner detector to detect a number of corners and then manually choosing the 4 you need.

2.  Use camshift or meanshift or SIFT or whatever method you like to track the location of each of the 4 corners throughout the video.  Visualize the tracked points to make sure they are correct or to identify the frames at which tracking fails. Make sure your report contains details of which algorithms/methods you used in each step.

3. At each frame, find the homography that maps the 4 corners of your headshot with the 4 corners of the top-left panel. Use this homography to replace the top-left panel with your headshot. This suggested approach will probably not work very well and will only generate mediocre results. So you’ll need to modify it or come up with your own ideas to get good results.

4.  Save and submit the resulting video.

Submit your output video as well as a description of the steps you used in your report. We are not expecting perfect results and will accept cases in which the output is a bit noisy or off a little bit once in a while. If your results are not as good as you were hoping, discuss the failure modes, the challenges in implementing this, and any interesting observation you find         

根据原作 https://pan.quark.cn/s/459657bcfd45 的源码改编 Classic-ML-Methods-Algo 引言 建立这个项目,是为了梳理和总结传统机器学习(Machine Learning)方法(methods)或者算法(algo),和各位同仁相互学习交流. 现在的深度学习本质上来自于传统的神经网络模型,很大程度上是传统机器学习的延续,同时也在不少时候需要结合传统方法来实现. 任何机器学习方法基本的流程结构都是通用的;使用的评价方法也基本通用;使用的一些数学知识也是通用的. 本文在梳理传统机器学习方法算法的同时也会顺便补充这些流程,数学上的知识以供参考. 机器学习 机器学习是人工智能(Artificial Intelligence)的一个分支,也是实现人工智能最重要的手段.区别于传统的基于规则(rule-based)的算法,机器学习可以从数据中获取知识,从而实现规定的任务[Ian Goodfellow and Yoshua Bengio and Aaron Courville的Deep Learning].这些知识可以分为四种: 总结(summarization) 预测(prediction) 估计(estimation) 假想验证(hypothesis testing) 机器学习主要关心的是预测[Varian在Big Data : New Tricks for Econometrics],预测的可以是连续性的输出变量,分类,聚类或者物品之间的有趣关联. 机器学习分类 根据数据配置(setting,是否有标签,可以是连续的也可以是离散的)和任务目标,我们可以将机器学习方法分为四种: 无监督(unsupervised) 训练数据没有给定...
本系统采用微信小程序作为前端交互界面,结合Spring Boot与Vue.js框架实现后端服务及管理后台的构建,形成一套完整的电子商务解决方案。该系统架构支持单一商户独立运营,亦兼容多商户入驻的平台模式,具备高度的灵活性与扩展性。 在技术实现上,后端以Java语言为核心,依托Spring Boot框架提供稳定的业务逻辑处理与数据接口服务;管理后台采用Vue.js进行开发,实现了直观高效的操作界面;前端微信小程序则为用户提供了便捷的移动端购物体验。整套系统各模块间紧密协作,功能链路完整闭环,已通过严格测试与优化,符合商业应用的标准要求。 系统设计注重业务场景的全面覆盖,不仅包含商品展示、交易流程、订单处理等核心电商功能,还集成了会员管理、营销工具、数据统计等辅助模块,能够满足不同规模商户的日常运营需求。其多店铺支持机制允许平台方对入驻商户进行统一管理,同时保障各店铺在品牌展示、商品销售及客户服务方面的独立运作空间。 该解决方案强调代码结构的规范性与可维护性,遵循企业级开发标准,确保了系统的长期稳定运行与后续功能迭代的可行性。整体而言,这是一套技术选型成熟、架构清晰、功能完备且可直接投入商用的电商平台系统。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值