热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Multi-ProjectorBasedDisplayCode----Calibration

OverviewAsmentionedpreviously,therearetwomainstepsingeneratingaseamlessdisplay.Thefi

Overview

As mentioned previously, there are two main steps in generating a seamless display. The first is camera-based calibration. This involves a user-level application that gathers the required geometric data to geometrically register each projector into the camera image coordinate space and photometric data for blending or luminance smoothing.

    Be aware that the calibration procedures that collect the geometric and photometric information need to be performed only periodically whenever there is a change in the display set-up. It is not critical to perform the calibration procedure in real time. Therefore, the overall calibration procedure can often take several minutes to perform information gathering from the camera as well as the necessary computation.

Algorithms

The purpose of calibration is to build the correspondence between projector coordinate and camera coordinate. So during the calibration procedure, we project a few feature images with the coordinate of the features (white blobs in black background) in projector space manually specified. The remaining question is how to detect the features in camera image and build the correspondence between the projected features and detected features.

    Detecting the feature is relatively simple. We first project feature image with all the features (all the white blobs, 10x10, for example), then we grab the camera image and convert to grey image (if original is color) and then to binary image. If the environment lighting and camera exposure are carefully tuned, all the pixels of features will be white and all other pixels will be black. Then we use the labeling algorithm to detect all connecting components in the image. The labeling algorithm is classic and you can find many introduction about it from the web. You can also refer to our codes for more details. After detecting all the connecting components, each of them is regarded as one feature. The total number of features detected should equal to the number we projected. The average coordinate of all the pixels inside the connecting component (the center of connecting component) is the coordinate of the feature in the camera image. We also record the bounded box of each feature for later detection.

    The bigger challenge is to determine correspondence between the projected feature and detected feature in camera coordinates. We use a binary encoding scheme to efficiently build this correspondence. First, we assign an ID for each feature in projector coordinate, for example, 1~100 for 100 features. We rewrite this ID to binary format in 7 bits, for example, 0000111 for ID 7. Then, we project a image with all the features and grab the camera image accordingly. After analysing the image with labeling algorithm mentioned previously, we are able to record the bounded box for each feature. Next, we project a feature image for each bit (7 images for 7 bits). For each feature, if the corresponding bit of the binary format of its ID equals to 1, we show this feature (the white blob) in the feature image we are going to project; if it equals to 0, we eliminate it. The following figure shows the full feature image and one feature image for each bit. After projecting the feature image of specified bit and grabbing the camera image accordingly, we detect whether a feature is shown in the bounded box generate from the full feature image. If the feature is shown, we put a "1" in that bit of the ID associated with the feature; otherwise, we put a "0". In this way, we can recover the specified bit of all the features. After repeat this process for all the bits (7 bits for 100 features), we can recover the ID of all the features in the camera image. Now we can assure that the feature in projector is corresponding to the feature with the same ID in camera image. We associate their coordinate in projector space and camera space together and successfully build the correspondence. (You can find more details about this algorithm in reference [1])

1

Figure 1. Projector-to-camera mapping registration procedure using binary encoding scheme

System Configuration

There are three typical configurations you might consider to play with. The first configuration is using only one projector (single-projector configuration). The second configuration is using multiple projectors, each driven by one PC (multi-projector multi-PC configuration). The third configuration is using multiple projectors driven by one PC with multiple outputs (multi-projector single-PC configuration), for example, we use four projectors driven by one PC supporting dual graphic cards while each card has dual outputs.

Single-Projector Configuration

Single projector configuration uses only one PC as both master PC and rendering PC, as shown in the following figure:

2

Figure 2. Single-Projector Configuration

    Though this configuration could not provide a larger display (even slightly smaller than the original display area), it is very helpful for beginners to understand the structure and concept of the system. And the codes are relative simple, so they are easy to read, understand and modify. Meanwhile, the hardware involved in this configuration is limited, so it's quite straightforward to set up the system. After finish the system, you could expect that no matter how you placed the projector, the imagery in the camera view is geometrically undistorted. Since there is only one projector in this case, no photometric correction needs to be done.

Multi-Projector Multi-PC Configuration

Multi-Projector Multi-PC configuration consists of an individual master PC and one rendering PC for each projector. It's the most common and practical configuration, as shown in the following figure:

3

Figure 3. Multi-Projector Multi-PC Configuration

    The number of rendering PCs is flexible and can vary from 1 to many. You can choose it according to your intention and available hardware (typically we adopt 4 projectors as a 2 by 2 array). All the projectors need to be registered in the camera coordinate space, so they will project the same feature images as previous configuration, one by one in the order specified in the configuration file. One result file containing geometric information and one alpha image for each projector containing photometric information will generated in the calibration procedure.

Multi-Projector Single-PC Configuration

Multi-Projector single-PC configuration uses only one PC to drive multiple projectors, as shown in the following figure:

4

Figure 4. Multi-Projector Single-PC Configuration

    There are some tricks in this configuration. It relies on the graphic card to support the function of combining all the four outputs into a large virtual desktop. Our NVIDIA GeForce 8800GTS support this feature pretty well (and I believe most mordern graphic cards do). Meanwhile, the graphic memory on the two card are isolated and any geometric or photometric correction that need to refer to the pixels in the texture buffer of the other card is impossible. This is not a problem in the Calibration and Image Viewer application, but it lead to the 3D Model Viewer unrealistic under this configuration.

Download

Please go to the download page.

How to use the code

Before you start, you should first choose the configuration you would like to adopt according to your intention and available hardware. Single-projector configuration is simplified and requires the minimum hardware, so it is a good place to start with. Multi-projector multi-PC configuration is the practical configuration and should be tried out ultimately if you have enough PCs and projectors. Multi-projector single-PC configuration is helpful to understand the calibration technology and easy to set up if you have the required graphics cards. Below are the step-by-step instructions about how to use the code.

Single-Projector Configuration:

  1. Download the binary package named Calibration from the above "Download" Section;
  2. Connect the PC, projector and camera as showed in Figure 2;
  3. Make sure that the driver of the camera is properly installed and can be supported by OpenCV;
  4. Make sure that the camera is placed properly that it can see the whole display area of the projector and no obstructing white and/or bright object is in the camera's view;
  5. Run the calibration program from command line with:
    Calibration.exe result.txt pic.bmp
  6. If everything goes well, you will see the calibration procedure goes on and finally the pic.bmp shown on screen;
  7. In less than one minute, you will get the calibration result from the file result.txt at the same directory.

Multi-Projector Multi-PC Configuration:

  1. Download the corresponding binary package named CalibClient (control client running on master PC) and CalibServer(render server running on render PC) from the above "Download" Section;
  2. Connect the PCs, projectors and camera as showed in Figure 3;
  3. Make sure that the driver of the camera is properly installed and can be supported by OpenCV;
  4. Make sure that the camera is placed properly that it can see the whole display area of all the projectors and no obstructing white and/or bright object is in the camera's view;
  5. Run the following program on all the rendering PC from command line with:
    RenderServer.exe
  6. Modify the configuration file named Client4.cfg with the help of the comments according to your actual configuration (IP address, port, etc);
  7. Run the control client program on the master PC from command line with:
    CalibClient.exe Client4.cfg
  8. If everything goes well, you will see the calibration procedure goes on;
  9. In a few minutes, you will get the calibration result from the file result2x2.txt (as specified in the configuration file) and the alpha image named Px.bmp at the same directory.

Multi-Projector Single-PC Configuration:

  1. Download the corresponding binary package named MMonCalibration from the above "Download" Section;
  2. Connect the PCs, projectors and camera as showed in Figure 4;
  3. Make sure that the driver of the camera is properly installed and can be supported by OpenCV;
  4. Make sure that the camera is placed properly that it can see the whole display area of all the projectors and no obstructing white and/or bright object is in the camera's view;
  5. Make sure that you have multiple graphics cards installed properly;
  6. From the desktop of your Windows XP, go to "Right-Click->Properties->Settings", enable all the connected monitors by select the "Extend my Windows desktop onto this monitor" check box; Make sure the top left projector is set as primary display and drag the monitor icons to match the physical arrangement;
  7. Run the following program on the PC from command line with:
    MMonCalibration.exe 2 2 result.txt
  8. If everything goes well, you will see the calibration procedure goes on;
  9. In a few minutes, you will get the calibration result from the file resul.txt (as specified in the command line) and the alpha image named Px.bmp at the same directory.

推荐阅读
  • 尽管我们尽最大努力,任何软件开发过程中都难免会出现缺陷。为了更有效地提升对支持部门的协助与支撑,本文探讨了多种策略和最佳实践,旨在通过改进沟通、增强培训和支持流程来减少这些缺陷的影响,并提高整体服务质量和客户满意度。 ... [详细]
  • Ihavetwomethodsofgeneratingmdistinctrandomnumbersintherange[0..n-1]我有两种方法在范围[0.n-1]中生 ... [详细]
  • POJ 2482 星空中的星星:利用线段树与扫描线算法解决
    在《POJ 2482 星空中的星星》问题中,通过运用线段树和扫描线算法,可以高效地解决星星在窗口内的计数问题。该方法不仅能够快速处理大规模数据,还能确保时间复杂度的最优性,适用于各种复杂的星空模拟场景。 ... [详细]
  • PHP-Casbin v3.20.0 已经发布,这是一个使用 PHP 语言开发的轻量级开源访问控制框架,支持多种访问控制模型,包括 ACL、RBAC 和 ABAC。新版本在性能上有了显著的提升。 ... [详细]
  • Python 伦理黑客技术:深入探讨后门攻击(第三部分)
    在《Python 伦理黑客技术:深入探讨后门攻击(第三部分)》中,作者详细分析了后门攻击中的Socket问题。由于TCP协议基于流,难以确定消息批次的结束点,这给后门攻击的实现带来了挑战。为了解决这一问题,文章提出了一系列有效的技术方案,包括使用特定的分隔符和长度前缀,以确保数据包的准确传输和解析。这些方法不仅提高了攻击的隐蔽性和可靠性,还为安全研究人员提供了宝贵的参考。 ... [详细]
  • 自然语言处理(NLP)——LDA模型:对电商购物评论进行情感分析
    目录一、2020数学建模美赛C题简介需求评价内容提供数据二、解题思路三、LDA简介四、代码实现1.数据预处理1.1剔除无用信息1.1.1剔除掉不需要的列1.1.2找出无效评论并剔除 ... [详细]
  • Leetcode学习成长记:天池leetcode基础训练营Task01数组
    前言这是本人第一次参加由Datawhale举办的组队学习活动,这个活动每月一次,之前也一直关注,但未亲身参与过,这次看到活动 ... [详细]
  • Cookie学习小结
    Cookie学习小结 ... [详细]
  • 2020年9月15日,Oracle正式发布了最新的JDK 15版本。本次更新带来了许多新特性,包括隐藏类、EdDSA签名算法、模式匹配、记录类、封闭类和文本块等。 ... [详细]
  • MySQL初级篇——字符串、日期时间、流程控制函数的相关应用
    文章目录:1.字符串函数2.日期时间函数2.1获取日期时间2.2日期与时间戳的转换2.3获取年月日、时分秒、星期数、天数等函数2.4时间和秒钟的转换2. ... [详细]
  • 解决Bootstrap DataTable Ajax请求重复问题
    在最近的一个项目中,我们使用了JQuery DataTable进行数据展示,虽然使用起来非常方便,但在测试过程中发现了一个问题:当查询条件改变时,有时查询结果的数据不正确。通过FireBug调试发现,点击搜索按钮时,会发送两次Ajax请求,一次是原条件的请求,一次是新条件的请求。 ... [详细]
  • 为了确保iOS应用能够安全地访问网站数据,本文介绍了如何在Nginx服务器上轻松配置CertBot以实现SSL证书的自动化管理。通过这一过程,可以确保应用始终使用HTTPS协议,从而提升数据传输的安全性和可靠性。文章详细阐述了配置步骤和常见问题的解决方法,帮助读者快速上手并成功部署SSL证书。 ... [详细]
  • 在Cisco IOS XR系统中,存在提供服务的服务器和使用这些服务的客户端。本文深入探讨了进程与线程状态转换机制,分析了其在系统性能优化中的关键作用,并提出了改进措施,以提高系统的响应速度和资源利用率。通过详细研究状态转换的各个环节,本文为开发人员和系统管理员提供了实用的指导,旨在提升整体系统效率和稳定性。 ... [详细]
  • 在尝试对从复杂 XSD 生成的类进行序列化时,遇到了 `NullReferenceException` 错误。尽管已经花费了数小时进行调试和搜索相关资料,但仍然无法找到问题的根源。希望社区能够提供一些指导和建议,帮助解决这一难题。 ... [详细]
  • Python与R语言在功能和应用场景上各有优势。尽管R语言在统计分析和数据可视化方面具有更强的专业性,但Python作为一种通用编程语言,适用于更广泛的领域,包括Web开发、自动化脚本和机器学习等。对于初学者而言,Python的学习曲线更为平缓,上手更加容易。此外,Python拥有庞大的社区支持和丰富的第三方库,使其在实际应用中更具灵活性和扩展性。 ... [详细]
author-avatar
每天听点心理学_961
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有