@ -0,0 +1,274 @@ |
||||
{# |
||||
basic/layout.html |
||||
~~~~~~~~~~~~~~~~~ |
||||
|
||||
Master layout template for Sphinx themes. |
||||
|
||||
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. |
||||
:license: BSD, see LICENSE for details. |
||||
#} |
||||
{%- block doctype -%} |
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
||||
{%- endblock %} |
||||
{% set script_files = script_files + [pathto("_static/insertIframe.js", 1)] %} |
||||
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} |
||||
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} |
||||
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and |
||||
(sidebars != []) %} |
||||
{%- set url_root = pathto('', 1) %} |
||||
{# XXX necessary? #} |
||||
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} |
||||
{%- if not embedded and docstitle %} |
||||
{%- set titlesuffix = " — "|safe + docstitle|e %} |
||||
{%- else %} |
||||
{%- set titlesuffix = "" %} |
||||
{%- endif %} |
||||
<script type="text/javascript"> |
||||
|
||||
var _gaq = _gaq || []; |
||||
_gaq.push(['_setAccount', 'UA-33108845-1']); |
||||
_gaq.push(['_setDomainName', 'opencv.org']); |
||||
_gaq.push(['_trackPageview']); |
||||
|
||||
(function() { |
||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
||||
})(); |
||||
|
||||
</script> |
||||
{%- macro relbar() %} |
||||
<div class="related"> |
||||
<h3>{{ _('Navigation') }}</h3> |
||||
<ul> |
||||
{%- for rellink in rellinks %} |
||||
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> |
||||
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" |
||||
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> |
||||
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> |
||||
{%- endfor %} |
||||
{%- block rootrellink %} |
||||
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li> |
||||
{%- endblock %} |
||||
{%- for parent in parents %} |
||||
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li> |
||||
{%- endfor %} |
||||
{%- block relbaritems %} {% endblock %} |
||||
</ul> |
||||
</div> |
||||
{%- endmacro %} |
||||
|
||||
{%- macro sidebar() %} |
||||
{%- if render_sidebar %} |
||||
<div class="sphinxsidebar"> |
||||
<div class="sphinxsidebarwrapper"> |
||||
{%- block sidebarlogo %} |
||||
{%- if logo %} |
||||
<p class="logo"><a href="{{ pathto(master_doc) }}"> |
||||
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> |
||||
</a></p> |
||||
{%- endif %} |
||||
{%- endblock %} |
||||
{%- if sidebars == None %} |
||||
{%- block sidebarsearch %} |
||||
{%- include "searchbox.html" %} |
||||
{%- endblock %} |
||||
{%- endif %} |
||||
{%- if sidebars != None %} |
||||
{#- new style sidebar: explicitly include/exclude templates #} |
||||
{%- for sidebartemplate in sidebars %} |
||||
{%- include sidebartemplate %} |
||||
{%- endfor %} |
||||
{%- else %} |
||||
{#- old style sidebars: using blocks -- should be deprecated #} |
||||
{%- block sidebartoc %} |
||||
{%- include "localtoc.html" %} |
||||
{%- endblock %} |
||||
{%- block sidebarrel %} |
||||
{%- include "relations.html" %} |
||||
{%- endblock %} |
||||
{%- if customsidebar %} |
||||
{%- include customsidebar %} |
||||
{%- endif %} |
||||
{%- endif %} |
||||
</div> |
||||
</div> |
||||
{%- endif %} |
||||
{%- endmacro %} |
||||
|
||||
{%- macro script() %} |
||||
<script type="text/javascript"> |
||||
var DOCUMENTATION_OPTIONS = { |
||||
URL_ROOT: '{{ url_root }}', |
||||
VERSION: '{{ release|e }}', |
||||
COLLAPSE_INDEX: false, |
||||
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}', |
||||
HAS_SOURCE: {{ has_source|lower }} |
||||
}; |
||||
</script> |
||||
{%- for scriptfile in script_files %} |
||||
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
||||
{%- endfor %} |
||||
{%- endmacro %} |
||||
|
||||
{%- macro css() %} |
||||
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> |
||||
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> |
||||
{%- for cssfile in css_files %} |
||||
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> |
||||
{%- endfor %} |
||||
{%- endmacro %} |
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"> |
||||
<head> |
||||
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" /> |
||||
{{ metatags }} |
||||
{%- block htmltitle %} |
||||
<title>{{ title|striptags|e }}{{ titlesuffix }}</title> |
||||
{%- endblock %} |
||||
{{ css() }} |
||||
{%- if not embedded %} |
||||
{{ script() }} |
||||
{%- if use_opensearch %} |
||||
<link rel="search" type="application/opensearchdescription+xml" |
||||
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" |
||||
href="{{ pathto('_static/opensearch.xml', 1) }}"/> |
||||
{%- endif %} |
||||
{%- if favicon %} |
||||
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> |
||||
{%- endif %} |
||||
{%- endif %} |
||||
{%- block linktags %} |
||||
{%- if hasdoc('about') %} |
||||
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> |
||||
{%- endif %} |
||||
{%- if hasdoc('genindex') %} |
||||
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> |
||||
{%- endif %} |
||||
{%- if hasdoc('search') %} |
||||
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> |
||||
{%- endif %} |
||||
{%- if hasdoc('copyright') %} |
||||
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> |
||||
{%- endif %} |
||||
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" /> |
||||
{%- if parents %} |
||||
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" /> |
||||
{%- endif %} |
||||
{%- if next %} |
||||
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" /> |
||||
{%- endif %} |
||||
{%- if prev %} |
||||
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" /> |
||||
{%- endif %} |
||||
{%- endblock %} |
||||
{%- block extrahead %} |
||||
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700' |
||||
rel='stylesheet' type='text/css' /> |
||||
{%- if not embedded %} |
||||
<style type="text/css"> |
||||
table.right { float: right; margin-left: 20px; } |
||||
table.right td { border: 1px solid #ccc; } |
||||
</style> |
||||
<script type="text/javascript"> |
||||
// intelligent scrolling of the sidebar content |
||||
$(window).scroll(function() { |
||||
var sb = $('.sphinxsidebarwrapper'); |
||||
var win = $(window); |
||||
var sbh = sb.height(); |
||||
var offset = $('.sphinxsidebar').position()['top']; |
||||
var wintop = win.scrollTop(); |
||||
var winbot = wintop + win.innerHeight(); |
||||
var curtop = sb.position()['top']; |
||||
var curbot = curtop + sbh; |
||||
// does sidebar fit in window? |
||||
if (sbh < win.innerHeight()) { |
||||
// yes: easy case -- always keep at the top |
||||
sb.css('top', $u.min([$u.max([0, wintop - offset - 10]), |
||||
$(document).height() - sbh - 200])); |
||||
} else { |
||||
// no: only scroll if top/bottom edge of sidebar is at |
||||
// top/bottom edge of window |
||||
if (curtop > wintop && curbot > winbot) { |
||||
sb.css('top', $u.max([wintop - offset - 10, 0])); |
||||
} else if (curtop < wintop && curbot < winbot) { |
||||
sb.css('top', $u.min([winbot - sbh - offset - 20, |
||||
$(document).height() - sbh - 200])); |
||||
} |
||||
} |
||||
}); |
||||
</script> |
||||
{%- endif %} |
||||
{% endblock %} |
||||
</head> |
||||
{%- block header %}{% endblock %} |
||||
|
||||
{%- block relbar1 %}{{ relbar() }}{% endblock %} |
||||
|
||||
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} |
||||
{%- block sidebar2 %}{{ sidebar() }}{% endblock %} |
||||
<body> |
||||
|
||||
{%- block content %} |
||||
|
||||
<div class="document"> |
||||
{%- block document %} |
||||
<div class="documentwrapper"> |
||||
{%- if render_sidebar %} |
||||
<div class="bodywrapper"> |
||||
{%- endif %} |
||||
<div class="body"> |
||||
{% block body %} {% endblock %} |
||||
</div> |
||||
<div class="feedback"> |
||||
<h2>Help and Feedback</h2> |
||||
You did not find what you were looking for? |
||||
<ul> |
||||
{% if theme_lang == 'c' %} |
||||
{% endif %} |
||||
{% if theme_lang == 'cpp' %} |
||||
<li>Try the <a href="http://docs.opencv.org/opencv_cheatsheet.pdf">Cheatsheet</a>.</li> |
||||
{% endif %} |
||||
{% if theme_lang == 'py' %} |
||||
<li>Try the <a href="cookbook.html">Cookbook</a>.</li> |
||||
{% endif %} |
||||
<li>Ask a question on the <a href="http://answers.opencv.org">Q&A forum</a>.</li> |
||||
<li>If you think something is missing or wrong in the documentation, |
||||
please file a <a href="http://code.opencv.org">bug report</a>.</li> |
||||
</ul> |
||||
</div> |
||||
{%- if render_sidebar %} |
||||
</div> |
||||
{%- endif %} |
||||
</div> |
||||
{%- endblock %} |
||||
|
||||
<div class="clearer"></div> |
||||
</div> |
||||
{%- endblock %} |
||||
|
||||
{%- block relbar2 %}{{ relbar() }}{% endblock %} |
||||
|
||||
{%- block footer %} |
||||
<div class="footer"> |
||||
{%- if show_copyright %} |
||||
{%- if hasdoc('copyright') %} |
||||
{% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} |
||||
{%- else %} |
||||
{% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} |
||||
{%- endif %} |
||||
{%- endif %} |
||||
{%- if last_updated %} |
||||
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} |
||||
{%- endif %} |
||||
{%- if show_sphinx %} |
||||
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} |
||||
{%- endif %} |
||||
{%- if show_source and has_source and sourcename %} |
||||
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow">{{ _('Show this page source.') }}</a> |
||||
{%- endif %} |
||||
</div> |
||||
{%- endblock %} |
||||
</body> |
||||
</html> |
@ -0,0 +1,21 @@ |
||||
{# |
||||
basic/searchbox.html |
||||
~~~~~~~~~~~~~~~~~~~~ |
||||
|
||||
Sphinx sidebar template: quick search box. |
||||
|
||||
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. |
||||
:license: BSD, see LICENSE for details. |
||||
#} |
||||
{%- if pagename != "search" and builder != "singlehtml" %} |
||||
<div id="searchbox" style="display: none"> |
||||
<h3>{{ _('Quick search') }}</h3> |
||||
<form class="search" action="{{ pathto('search') }}" method="get"> |
||||
<input type="text" name="q" /> |
||||
<input type="submit" value="{{ _('Go') }}" /> |
||||
<input type="hidden" name="check_keywords" value="yes" /> |
||||
<input type="hidden" name="area" value="default" /> |
||||
</form> |
||||
</div> |
||||
<script type="text/javascript">$('#searchbox').show(0);</script> |
||||
{%- endif %} |
After Width: | Height: | Size: 513 B |
@ -0,0 +1,466 @@ |
||||
/* |
||||
* sphinxdoc.css_t |
||||
* ~~~~~~~~~~~~~~~ |
||||
* |
||||
* Sphinx stylesheet -- sphinxdoc theme. |
||||
* |
||||
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. |
||||
* :license: BSD, see LICENSE for details. |
||||
* |
||||
*/ |
||||
|
||||
@import url("basic.css"); |
||||
|
||||
/* -- page layout ----------------------------------------------------------- */ |
||||
|
||||
body { |
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', |
||||
'Verdana', sans-serif; |
||||
font-size: 14px; |
||||
text-align: center; |
||||
background-image: url(bodybg.png); |
||||
color: black; |
||||
padding: 0; |
||||
border-right: 1px solid #0a507a; |
||||
border-left: 1px solid #0a507a; |
||||
|
||||
margin: 0 auto; |
||||
min-width: 780px; |
||||
max-width: 1080px; |
||||
} |
||||
|
||||
div.document { |
||||
background-color: white; |
||||
text-align: left; |
||||
} |
||||
|
||||
div.bodywrapper { |
||||
margin: 0 240px 0 0; |
||||
border-right: 1px solid #0a507a; |
||||
} |
||||
|
||||
div.body { |
||||
margin: 0; |
||||
padding: 0.5em 20px 20px 20px; |
||||
} |
||||
|
||||
div.related { |
||||
font-size: 1em; |
||||
color: white; |
||||
} |
||||
|
||||
div.related ul { |
||||
background-image: url(relbg.png); |
||||
text-align: left; |
||||
border-top: 1px solid #002e50; |
||||
border-bottom: 1px solid #002e50; |
||||
} |
||||
|
||||
div.related li + li { |
||||
display: inline; |
||||
} |
||||
|
||||
div.related ul li.right { |
||||
float: right; |
||||
margin-right: 5px; |
||||
} |
||||
|
||||
div.related ul li a { |
||||
margin: 0; |
||||
padding: 0 5px 0 5px; |
||||
line-height: 1.75em; |
||||
color: #f9f9f0; |
||||
text-shadow: 0px 0px 1px rgba(0, 0, 0, 0.5); |
||||
} |
||||
|
||||
div.related ul li a:hover { |
||||
color: white; |
||||
text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5); |
||||
} |
||||
|
||||
div.footer { |
||||
background-image: url(footerbg.png); |
||||
color: #ccc; |
||||
text-shadow: 0 0 .2px rgba(255, 255, 255, 0.8); |
||||
padding: 3px 8px 3px 0; |
||||
clear: both; |
||||
font-size: 0.8em; |
||||
text-align: center; |
||||
} |
||||
|
||||
div.sphinxsidebarwrapper { |
||||
position: relative; |
||||
top: 0px; |
||||
padding: 0; |
||||
} |
||||
|
||||
div.sphinxsidebar { |
||||
word-wrap: break-word; |
||||
margin: 0; |
||||
padding: 0 15px 15px 0; |
||||
width: 210px; |
||||
float: right; |
||||
font-size: 1em; |
||||
text-align: left; |
||||
} |
||||
|
||||
div.sphinxsidebar .logo { |
||||
text-align: center; |
||||
} |
||||
|
||||
div.sphinxsidebar .logo img { |
||||
width: 150px; |
||||
vertical-align: middle; |
||||
} |
||||
|
||||
div.sphinxsidebar input { |
||||
border: 1px solid #aaa; |
||||
font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', |
||||
'Verdana', sans-serif; |
||||
font-size: 1em; |
||||
} |
||||
|
||||
div.sphinxsidebar #searchbox input[type="text"] { |
||||
width: 160px; |
||||
} |
||||
|
||||
div.sphinxsidebar #searchbox input[type="submit"] { |
||||
width: 40px; |
||||
} |
||||
|
||||
div.sphinxsidebar h3 { |
||||
font-size: 1.5em; |
||||
border-top: 1px solid #0a507a; |
||||
margin-top: 1em; |
||||
margin-bottom: 0.5em; |
||||
padding-top: 0.5em; |
||||
} |
||||
|
||||
div.sphinxsidebar h4 { |
||||
font-size: 1.2em; |
||||
margin-bottom: 0; |
||||
} |
||||
|
||||
div.sphinxsidebar h3, div.sphinxsidebar h4 { |
||||
margin-right: -15px; |
||||
margin-left: -15px; |
||||
padding-right: 14px; |
||||
padding-left: 14px; |
||||
color: #333; |
||||
font-weight: 300; |
||||
/*text-shadow: 0px 0px 0.5px rgba(0, 0, 0, 0.4);*/ |
||||
} |
||||
|
||||
div.sphinxsidebarwrapper > h3:first-child { |
||||
margin-top: 0.5em; |
||||
border: none; |
||||
} |
||||
|
||||
div.sphinxsidebar h3 a { |
||||
color: #333; |
||||
} |
||||
|
||||
div.sphinxsidebar ul { |
||||
color: #444; |
||||
margin-top: 7px; |
||||
padding: 0; |
||||
line-height: 130%; |
||||
} |
||||
|
||||
div.sphinxsidebar ul ul { |
||||
margin-left: 20px; |
||||
list-style-image: url(listitem.png); |
||||
} |
||||
|
||||
/* -- body styles ----------------------------------------------------------- */ |
||||
|
||||
p { |
||||
margin: 0.8em 0 0.5em 0; |
||||
} |
||||
|
||||
a, a tt { |
||||
color: #2878a2; |
||||
} |
||||
|
||||
a:hover, a tt:hover { |
||||
color: #68b8c2; |
||||
} |
||||
|
||||
a tt { |
||||
border: 0; |
||||
} |
||||
|
||||
h1, h2, h3, h4, h5, h6 { |
||||
color: #0a507a; |
||||
background-color: #e5f5ff; |
||||
font-weight: 300; |
||||
} |
||||
|
||||
h1 { |
||||
margin: 10px 0 0 0; |
||||
} |
||||
|
||||
h2 { |
||||
margin: 1.em 0 0.2em 0; |
||||
padding: 0; |
||||
} |
||||
|
||||
h3 { |
||||
margin: 1em 0 -0.3em 0; |
||||
} |
||||
|
||||
h1 { font-size: 200%; } |
||||
h2 { font-size: 160%; } |
||||
h3 { font-size: 140%; } |
||||
h4 { font-size: 120%; } |
||||
h5 { font-size: 110%; } |
||||
h6 { font-size: 100%; } |
||||
|
||||
div a, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { |
||||
text-decoration: none; |
||||
} |
||||
|
||||
div.body h1 a tt, div.body h2 a tt, div.body h3 a tt, |
||||
div.body h4 a tt, div.body h5 a tt, div.body h6 a tt { |
||||
color: #0a507a !important; |
||||
font-size: inherit !important; |
||||
} |
||||
|
||||
a.headerlink { |
||||
color: #0a507a !important; |
||||
font-size: 12px; |
||||
margin-left: 6px; |
||||
padding: 0 4px 0 4px; |
||||
text-decoration: none !important; |
||||
float: right; |
||||
} |
||||
|
||||
a.headerlink:hover { |
||||
background-color: #ccc; |
||||
color: white!important; |
||||
} |
||||
|
||||
cite, code, tt { |
||||
font-family: 'Consolas', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', |
||||
monospace; |
||||
font-size: 14px; |
||||
min-width: 780px; |
||||
max-width: 1080px; |
||||
} |
||||
|
||||
tt { |
||||
color: #003048; |
||||
padding: 1px; |
||||
} |
||||
|
||||
tt.descname, tt.descclassname, tt.xref { |
||||
font-size: 12px; |
||||
} |
||||
|
||||
hr { |
||||
border: 1px solid #abc; |
||||
margin: 2em; |
||||
} |
||||
|
||||
pre { |
||||
font-family: 'Consolas', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', |
||||
monospace; |
||||
font-size: 13px; |
||||
letter-spacing: 0.015em; |
||||
line-height: 120%; |
||||
padding: 0.5em; |
||||
border: 1px solid #ccc; |
||||
border-radius: 2px; |
||||
background-color: #f8f8f8; |
||||
} |
||||
|
||||
pre a { |
||||
color: inherit; |
||||
text-decoration: none; |
||||
} |
||||
|
||||
td.linenos pre { |
||||
padding: 0.5em 0; |
||||
} |
||||
|
||||
td.code pre { |
||||
max-width: 740px; |
||||
overflow: auto; |
||||
overflow-y: hidden; /* fixes display issues on Chrome browsers */ |
||||
} |
||||
|
||||
div.quotebar { |
||||
background-color: #f8f8f8; |
||||
max-width: 250px; |
||||
float: right; |
||||
padding: 0px 7px; |
||||
border: 1px solid #ccc; |
||||
margin-left: 1em; |
||||
} |
||||
|
||||
div.topic { |
||||
background-color: #f8f8f8; |
||||
} |
||||
|
||||
table { |
||||
border-collapse: collapse; |
||||
margin: 0 -0.5em 0 -0.5em; |
||||
} |
||||
|
||||
table td, table th { |
||||
padding: 0.2em 0.5em 0.2em 0.5em; |
||||
} |
||||
|
||||
div.note { |
||||
background-color: #eee; |
||||
border: 1px solid #ccc; |
||||
} |
||||
|
||||
div.seealso { |
||||
background-color: #ffc; |
||||
border: 1px solid #ff6; |
||||
} |
||||
|
||||
div.topic { |
||||
background-color: #eee; |
||||
} |
||||
|
||||
div.warning { |
||||
background-color: #ffe4e4; |
||||
border: 1px solid #f66; |
||||
} |
||||
|
||||
div.admonition ul li, div.warning ul li, |
||||
div.admonition ol li, div.warning ol li { |
||||
text-align: left; |
||||
} |
||||
|
||||
div.admonition p.admonition-title + p { |
||||
display: inline; |
||||
} |
||||
|
||||
p.admonition-title { |
||||
display: inline; |
||||
} |
||||
|
||||
p.admonition-title:after { |
||||
content: ":"; |
||||
} |
||||
|
||||
/* ------------------ our styles ----------------*/ |
||||
|
||||
div.body p, div.body dd, div.body li { |
||||
text-align: justify; |
||||
line-height: 130%; |
||||
margin-top: 1em; |
||||
margin-bottom: 1em; |
||||
} |
||||
|
||||
div.toctree-wrapper li, ul.simple li { |
||||
margin:0; |
||||
} |
||||
|
||||
/*a.toc-backref { |
||||
}*/ |
||||
|
||||
div.feedback { |
||||
/*background-color: #;*/ |
||||
/*color: #;*/ |
||||
padding: 20px 20px 30px 20px; |
||||
border-top: 1px solid #002e50; |
||||
} |
||||
|
||||
div.feedback h2 { |
||||
margin: 10px 0 10px 0; |
||||
} |
||||
|
||||
div.feedback a { |
||||
/*color: #;*/ |
||||
font-weight: bold; |
||||
} |
||||
|
||||
div.math p { |
||||
margin-top: 10px; |
||||
margin-bottom: 10px; |
||||
} |
||||
|
||||
dl.function > dt:first-child { |
||||
margin-bottom: 7px; |
||||
} |
||||
|
||||
dl.cfunction > dt:first-child { |
||||
margin-bottom: 7px; |
||||
color: #8080B0; |
||||
} |
||||
|
||||
dl.cfunction > dt:first-child tt.descname { |
||||
color: #8080B0; |
||||
} |
||||
|
||||
dl.pyfunction > dt:first-child { |
||||
margin-bottom: 7px; |
||||
} |
||||
|
||||
dl.jfunction > dt:first-child { |
||||
margin-bottom: 7px; |
||||
} |
||||
|
||||
table.field-list { |
||||
margin-top: 20px; |
||||
} |
||||
|
||||
em.menuselection, em.guilabel { |
||||
font-family: 'Lucida Sans', 'Lucida Sans Unicode', 'Lucida Grande', Verdana, |
||||
Arial, Helvetica, sans-serif; |
||||
} |
||||
|
||||
.enumeratevisibleitemswithsquare ul { |
||||
list-style: square; |
||||
margin-bottom: 0px; |
||||
margin-left: 0px; |
||||
margin-right: 0px; |
||||
margin-top: 0px; |
||||
} |
||||
|
||||
.enumeratevisibleitemswithsquare li { |
||||
margin-bottom: 0.2em; |
||||
margin-left: 0px; |
||||
margin-right: 0px; |
||||
margin-top: 0.2em; |
||||
} |
||||
|
||||
.enumeratevisibleitemswithsquare p { |
||||
margin-bottom: 0pt; |
||||
margin-top: 1pt; |
||||
} |
||||
|
||||
.enumeratevisibleitemswithsquare dl { |
||||
margin-bottom: 0px; |
||||
margin-left: 0px; |
||||
margin-right: 0px; |
||||
margin-top: 0px; |
||||
} |
||||
|
||||
.toctableopencv { |
||||
width: 100% ; |
||||
table-layout: fixed; |
||||
} |
||||
|
||||
.toctableopencv colgroup col:first-child { |
||||
width: 100pt !important; |
||||
max-width: 100pt !important; |
||||
min-width: 100pt !important; |
||||
} |
||||
|
||||
.toctableopencv colgroup col:nth-child(2) { |
||||
width: 100% !important; |
||||
} |
||||
|
||||
div.body ul.search li { |
||||
text-align: left; |
||||
} |
||||
|
||||
div.linenodiv { |
||||
min-width: 1em; |
||||
text-align: right; |
||||
} |
After Width: | Height: | Size: 220 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 207 B |
After Width: | Height: | Size: 223 B |
@ -0,0 +1,4 @@ |
||||
[theme] |
||||
inherit = basic |
||||
stylesheet = default.css |
||||
pygments_style = sphinx |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 144 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.1 KiB |
@ -1,2 +1,2 @@ |
||||
set(the_description "2D Features Framework") |
||||
ocv_define_module(features2d opencv_imgproc opencv_flann OPTIONAL opencv_highgui) |
||||
ocv_define_module(features2d opencv_imgproc opencv_ml opencv_flann OPTIONAL opencv_highgui) |
||||
|
@ -0,0 +1,568 @@ |
||||
//
|
||||
// Copyright (C) Microsoft Corporation
|
||||
// All rights reserved.
|
||||
// Modified for native C++ WRL support by Gregory Morse
|
||||
//
|
||||
// Code in Details namespace is for internal usage within the library code
|
||||
//
|
||||
|
||||
#ifndef _PLATFORM_AGILE_H_ |
||||
#define _PLATFORM_AGILE_H_ |
||||
|
||||
#ifdef _MSC_VER |
||||
#pragma once |
||||
#endif // _MSC_VER
|
||||
|
||||
#include <algorithm> |
||||
#include <wrl\client.h> |
||||
|
||||
template <typename T, bool TIsNotAgile> class Agile; |
||||
|
||||
template <typename T> |
||||
struct UnwrapAgile |
||||
{ |
||||
static const bool _IsAgile = false; |
||||
}; |
||||
template <typename T> |
||||
struct UnwrapAgile<Agile<T, false>> |
||||
{ |
||||
static const bool _IsAgile = true; |
||||
}; |
||||
template <typename T> |
||||
struct UnwrapAgile<Agile<T, true>> |
||||
{ |
||||
static const bool _IsAgile = true; |
||||
}; |
||||
|
||||
#define IS_AGILE(T) UnwrapAgile<T>::_IsAgile |
||||
|
||||
#define __is_winrt_agile(T) (std::is_same<T, HSTRING__>::value || std::is_base_of<Microsoft::WRL::FtmBase, T>::value || std::is_base_of<IAgileObject, T>::value) //derived from Microsoft::WRL::FtmBase or IAgileObject
|
||||
|
||||
#define __is_win_interface(T) (std::is_base_of<IUnknown, T>::value || std::is_base_of<IInspectable, T>::value) //derived from IUnknown or IInspectable
|
||||
|
||||
#define __is_win_class(T) (std::is_same<T, HSTRING__>::value || std::is_base_of<Microsoft::WRL::Details::RuntimeClassBase, T>::value) //derived from Microsoft::WRL::RuntimeClass or HSTRING
|
||||
|
||||
namespace Details |
||||
{ |
||||
IUnknown* __stdcall GetObjectContext(); |
||||
HRESULT __stdcall GetProxyImpl(IUnknown*, REFIID, IUnknown*, IUnknown**); |
||||
HRESULT __stdcall ReleaseInContextImpl(IUnknown*, IUnknown*); |
||||
|
||||
template <typename T> |
||||
#if _MSC_VER >= 1800 |
||||
__declspec(no_refcount) inline HRESULT GetProxy(T *ObjectIn, IUnknown *ContextCallBack, T **Proxy) |
||||
#else |
||||
inline HRESULT GetProxy(T *ObjectIn, IUnknown *ContextCallBack, T **Proxy) |
||||
#endif |
||||
{ |
||||
#if _MSC_VER >= 1800 |
||||
return GetProxyImpl(*reinterpret_cast<IUnknown**>(&ObjectIn), __uuidof(T*), ContextCallBack, reinterpret_cast<IUnknown**>(Proxy)); |
||||
#else |
||||
return GetProxyImpl(*reinterpret_cast<IUnknown**>(&const_cast<T*>(ObjectIn)), __uuidof(T*), ContextCallBack, reinterpret_cast<IUnknown**>(Proxy)); |
||||
#endif |
||||
} |
||||
|
||||
template <typename T> |
||||
inline HRESULT ReleaseInContext(T *ObjectIn, IUnknown *ContextCallBack) |
||||
{ |
||||
return ReleaseInContextImpl(ObjectIn, ContextCallBack); |
||||
} |
||||
|
||||
template <typename T> |
||||
class AgileHelper |
||||
{ |
||||
__abi_IUnknown* _p; |
||||
bool _release; |
||||
public: |
||||
AgileHelper(__abi_IUnknown* p, bool release = true) : _p(p), _release(release) |
||||
{ |
||||
} |
||||
AgileHelper(AgileHelper&& other) : _p(other._p), _release(other._release) |
||||
{ |
||||
_other._p = nullptr; |
||||
_other._release = true; |
||||
} |
||||
AgileHelper operator=(AgileHelper&& other) |
||||
{ |
||||
_p = other._p; |
||||
_release = other._release; |
||||
_other._p = nullptr; |
||||
_other._release = true; |
||||
return *this; |
||||
} |
||||
|
||||
~AgileHelper() |
||||
{ |
||||
if (_release && _p) |
||||
{ |
||||
_p->__abi_Release(); |
||||
} |
||||
} |
||||
|
||||
__declspec(no_refcount) __declspec(no_release_return) |
||||
T* operator->() |
||||
{ |
||||
return reinterpret_cast<T*>(_p); |
||||
} |
||||
|
||||
__declspec(no_refcount) __declspec(no_release_return) |
||||
operator T * () |
||||
{ |
||||
return reinterpret_cast<T*>(_p); |
||||
} |
||||
private: |
||||
AgileHelper(const AgileHelper&); |
||||
AgileHelper operator=(const AgileHelper&); |
||||
}; |
||||
template <typename T> |
||||
struct __remove_hat |
||||
{ |
||||
typedef T type; |
||||
}; |
||||
template <typename T> |
||||
struct __remove_hat<T*> |
||||
{ |
||||
typedef T type; |
||||
}; |
||||
template <typename T> |
||||
struct AgileTypeHelper |
||||
{ |
||||
typename typedef __remove_hat<T>::type type; |
||||
typename typedef __remove_hat<T>::type* agileMemberType; |
||||
}; |
||||
} // namespace Details
|
||||
|
||||
#pragma warning(push) |
||||
#pragma warning(disable: 4451) // Usage of ref class inside this context can lead to invalid marshaling of object across contexts
|
||||
|
||||
template < |
||||
typename T, |
||||
bool TIsNotAgile = (__is_win_class(typename Details::AgileTypeHelper<T>::type) && !__is_winrt_agile(typename Details::AgileTypeHelper<T>::type)) || |
||||
__is_win_interface(typename Details::AgileTypeHelper<T>::type) |
||||
> |
||||
class Agile |
||||
{ |
||||
static_assert(__is_win_class(typename Details::AgileTypeHelper<T>::type) || __is_win_interface(typename Details::AgileTypeHelper<T>::type), "Agile can only be used with ref class or interface class types"); |
||||
typename typedef Details::AgileTypeHelper<T>::agileMemberType TypeT; |
||||
TypeT _object; |
||||
::Microsoft::WRL::ComPtr<IUnknown> _contextCallback; |
||||
ULONG_PTR _contextToken; |
||||
|
||||
#if _MSC_VER >= 1800 |
||||
enum class AgileState |
||||
{ |
||||
NonAgilePointer = 0, |
||||
AgilePointer = 1, |
||||
Unknown = 2 |
||||
}; |
||||
AgileState _agileState; |
||||
#endif |
||||
|
||||
void CaptureContext() |
||||
{ |
||||
_contextCallback = Details::GetObjectContext(); |
||||
__abi_ThrowIfFailed(CoGetContextToken(&_contextToken)); |
||||
} |
||||
|
||||
void SetObject(TypeT object) |
||||
{ |
||||
// Capture context before setting the pointer
|
||||
// If context capture fails then nothing to cleanup
|
||||
Release(); |
||||
if (object != nullptr) |
||||
{ |
||||
::Microsoft::WRL::ComPtr<IAgileObject> checkIfAgile; |
||||
HRESULT hr = reinterpret_cast<IUnknown*>(object)->QueryInterface(__uuidof(IAgileObject), &checkIfAgile); |
||||
// Don't Capture context if object is agile
|
||||
if (hr != S_OK) |
||||
{ |
||||
#if _MSC_VER >= 1800 |
||||
_agileState = AgileState::NonAgilePointer; |
||||
#endif |
||||
CaptureContext(); |
||||
} |
||||
#if _MSC_VER >= 1800 |
||||
else |
||||
{ |
||||
_agileState = AgileState::AgilePointer; |
||||
} |
||||
#endif |
||||
} |
||||
_object = object; |
||||
} |
||||
|
||||
public: |
||||
Agile() throw() : _object(nullptr), _contextToken(0) |
||||
#if _MSC_VER >= 1800 |
||||
, _agileState(AgileState::Unknown) |
||||
#endif |
||||
{ |
||||
} |
||||
|
||||
Agile(nullptr_t) throw() : _object(nullptr), _contextToken(0) |
||||
#if _MSC_VER >= 1800 |
||||
, _agileState(AgileState::Unknown) |
||||
#endif |
||||
{ |
||||
} |
||||
|
||||
explicit Agile(TypeT object) throw() : _object(nullptr), _contextToken(0) |
||||
#if _MSC_VER >= 1800 |
||||
, _agileState(AgileState::Unknown) |
||||
#endif |
||||
{ |
||||
// Assumes that the source object is from the current context
|
||||
SetObject(object); |
||||
} |
||||
|
||||
Agile(const Agile& object) throw() : _object(nullptr), _contextToken(0) |
||||
#if _MSC_VER >= 1800 |
||||
, _agileState(AgileState::Unknown) |
||||
#endif |
||||
{ |
||||
// Get returns pointer valid for current context
|
||||
SetObject(object.Get()); |
||||
} |
||||
|
||||
Agile(Agile&& object) throw() : _object(nullptr), _contextToken(0) |
||||
#if _MSC_VER >= 1800 |
||||
, _agileState(AgileState::Unknown) |
||||
#endif |
||||
{ |
||||
// Assumes that the source object is from the current context
|
||||
Swap(object); |
||||
} |
||||
|
||||
~Agile() throw() |
||||
{ |
||||
Release(); |
||||
} |
||||
|
||||
TypeT Get() const |
||||
{ |
||||
// Agile object, no proxy required
|
||||
#if _MSC_VER >= 1800 |
||||
if (_agileState == AgileState::AgilePointer || _object == nullptr) |
||||
#else |
||||
if (_contextToken == 0 || _contextCallback == nullptr || _object == nullptr) |
||||
#endif |
||||
{ |
||||
return _object; |
||||
} |
||||
|
||||
// Do the check for same context
|
||||
ULONG_PTR currentContextToken; |
||||
__abi_ThrowIfFailed(CoGetContextToken(¤tContextToken)); |
||||
if (currentContextToken == _contextToken) |
||||
{ |
||||
return _object; |
||||
} |
||||
|
||||
#if _MSC_VER >= 1800 |
||||
// Different context and holding on to a non agile object
|
||||
// Do the costly work of getting a proxy
|
||||
TypeT localObject; |
||||
__abi_ThrowIfFailed(Details::GetProxy(_object, _contextCallback.Get(), &localObject)); |
||||
|
||||
if (_agileState == AgileState::Unknown) |
||||
#else |
||||
// Object is agile if it implements IAgileObject
|
||||
// GetAddressOf captures the context with out knowing the type of object that it will hold
|
||||
if (_object != nullptr) |
||||
#endif |
||||
{ |
||||
#if _MSC_VER >= 1800 |
||||
// Object is agile if it implements IAgileObject
|
||||
// GetAddressOf captures the context with out knowing the type of object that it will hold
|
||||
::Microsoft::WRL::ComPtr<IAgileObject> checkIfAgile; |
||||
HRESULT hr = reinterpret_cast<IUnknown*>(localObject)->QueryInterface(__uuidof(IAgileObject), &checkIfAgile); |
||||
#else |
||||
::Microsoft::WRL::ComPtr<IAgileObject> checkIfAgile; |
||||
HRESULT hr = reinterpret_cast<IUnknown*>(_object)->QueryInterface(__uuidof(IAgileObject), &checkIfAgile); |
||||
#endif |
||||
if (hr == S_OK) |
||||
{ |
||||
auto pThis = const_cast<Agile*>(this); |
||||
#if _MSC_VER >= 1800 |
||||
pThis->_agileState = AgileState::AgilePointer; |
||||
#endif |
||||
pThis->_contextToken = 0; |
||||
pThis->_contextCallback = nullptr; |
||||
return _object; |
||||
} |
||||
#if _MSC_VER >= 1800 |
||||
else |
||||
{ |
||||
auto pThis = const_cast<Agile*>(this); |
||||
pThis->_agileState = AgileState::NonAgilePointer; |
||||
} |
||||
#endif |
||||
} |
||||
|
||||
#if _MSC_VER < 1800 |
||||
// Different context and holding on to a non agile object
|
||||
// Do the costly work of getting a proxy
|
||||
TypeT localObject; |
||||
__abi_ThrowIfFailed(Details::GetProxy(_object, _contextCallback.Get(), &localObject)); |
||||
#endif |
||||
return localObject; |
||||
} |
||||
|
||||
TypeT* GetAddressOf() throw() |
||||
{ |
||||
Release(); |
||||
CaptureContext(); |
||||
return &_object; |
||||
} |
||||
|
||||
TypeT* GetAddressOfForInOut() throw() |
||||
{ |
||||
CaptureContext(); |
||||
return &_object; |
||||
} |
||||
|
||||
TypeT operator->() const throw() |
||||
{ |
||||
return Get(); |
||||
} |
||||
|
||||
Agile& operator=(nullptr_t) throw() |
||||
{ |
||||
Release(); |
||||
return *this; |
||||
} |
||||
|
||||
Agile& operator=(TypeT object) throw() |
||||
{ |
||||
Agile(object).Swap(*this); |
||||
return *this; |
||||
} |
||||
|
||||
Agile& operator=(Agile object) throw() |
||||
{ |
||||
// parameter is by copy which gets pointer valid for current context
|
||||
object.Swap(*this); |
||||
return *this; |
||||
} |
||||
|
||||
#if _MSC_VER < 1800 |
||||
Agile& operator=(IUnknown* lp) throw() |
||||
{ |
||||
// bump ref count
|
||||
::Microsoft::WRL::ComPtr<IUnknown> spObject(lp); |
||||
|
||||
// put it into Platform Object
|
||||
Platform::Object object; |
||||
*(IUnknown**)(&object) = spObject.Detach(); |
||||
|
||||
SetObject(object); |
||||
return *this; |
||||
} |
||||
#endif |
||||
|
||||
void Swap(Agile& object) |
||||
{ |
||||
std::swap(_object, object._object); |
||||
std::swap(_contextCallback, object._contextCallback); |
||||
std::swap(_contextToken, object._contextToken); |
||||
#if _MSC_VER >= 1800 |
||||
std::swap(_agileState, object._agileState); |
||||
#endif |
||||
} |
||||
|
||||
// Release the interface and set to NULL
|
||||
void Release() throw() |
||||
{ |
||||
if (_object) |
||||
{ |
||||
// Cast to IInspectable (no QI)
|
||||
IUnknown* pObject = *(IUnknown**)(&_object); |
||||
// Set * to null without release
|
||||
*(IUnknown**)(&_object) = nullptr; |
||||
|
||||
ULONG_PTR currentContextToken; |
||||
__abi_ThrowIfFailed(CoGetContextToken(¤tContextToken)); |
||||
if (_contextToken == 0 || _contextCallback == nullptr || _contextToken == currentContextToken) |
||||
{ |
||||
pObject->Release(); |
||||
} |
||||
else |
||||
{ |
||||
Details::ReleaseInContext(pObject, _contextCallback.Get()); |
||||
} |
||||
_contextCallback = nullptr; |
||||
_contextToken = 0; |
||||
#if _MSC_VER >= 1800 |
||||
_agileState = AgileState::Unknown; |
||||
#endif |
||||
} |
||||
} |
||||
|
||||
bool operator==(nullptr_t) const throw() |
||||
{ |
||||
return _object == nullptr; |
||||
} |
||||
|
||||
bool operator==(const Agile& other) const throw() |
||||
{ |
||||
return _object == other._object && _contextToken == other._contextToken; |
||||
} |
||||
|
||||
bool operator<(const Agile& other) const throw() |
||||
{ |
||||
if (reinterpret_cast<void*>(_object) < reinterpret_cast<void*>(other._object)) |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
return _object == other._object && _contextToken < other._contextToken; |
||||
} |
||||
}; |
||||
|
||||
template <typename T> |
||||
class Agile<T, false> |
||||
{ |
||||
static_assert(__is_win_class(typename Details::AgileTypeHelper<T>::type) || __is_win_interface(typename Details::AgileTypeHelper<T>::type), "Agile can only be used with ref class or interface class types"); |
||||
typename typedef Details::AgileTypeHelper<T>::agileMemberType TypeT; |
||||
TypeT _object; |
||||
|
||||
public: |
||||
Agile() throw() : _object(nullptr) |
||||
{ |
||||
} |
||||
|
||||
Agile(nullptr_t) throw() : _object(nullptr) |
||||
{ |
||||
} |
||||
|
||||
explicit Agile(TypeT object) throw() : _object(object) |
||||
{ |
||||
} |
||||
|
||||
Agile(const Agile& object) throw() : _object(object._object) |
||||
{ |
||||
} |
||||
|
||||
Agile(Agile&& object) throw() : _object(nullptr) |
||||
{ |
||||
Swap(object); |
||||
} |
||||
|
||||
~Agile() throw() |
||||
{ |
||||
Release(); |
||||
} |
||||
|
||||
TypeT Get() const |
||||
{ |
||||
return _object; |
||||
} |
||||
|
||||
TypeT* GetAddressOf() throw() |
||||
{ |
||||
Release(); |
||||
return &_object; |
||||
} |
||||
|
||||
TypeT* GetAddressOfForInOut() throw() |
||||
{ |
||||
return &_object; |
||||
} |
||||
|
||||
TypeT operator->() const throw() |
||||
{ |
||||
return Get(); |
||||
} |
||||
|
||||
Agile& operator=(nullptr_t) throw() |
||||
{ |
||||
Release(); |
||||
return *this; |
||||
} |
||||
|
||||
Agile& operator=(TypeT object) throw() |
||||
{ |
||||
if (_object != object) |
||||
{ |
||||
_object = object; |
||||
} |
||||
return *this; |
||||
} |
||||
|
||||
Agile& operator=(Agile object) throw() |
||||
{ |
||||
object.Swap(*this); |
||||
return *this; |
||||
} |
||||
|
||||
#if _MSC_VER < 1800 |
||||
Agile& operator=(IUnknown* lp) throw() |
||||
{ |
||||
Release(); |
||||
// bump ref count
|
||||
::Microsoft::WRL::ComPtr<IUnknown> spObject(lp); |
||||
|
||||
// put it into Platform Object
|
||||
Platform::Object object; |
||||
*(IUnknown**)(&object) = spObject.Detach(); |
||||
|
||||
_object = object; |
||||
return *this; |
||||
} |
||||
#endif |
||||
|
||||
// Release the interface and set to NULL
|
||||
void Release() throw() |
||||
{ |
||||
_object = nullptr; |
||||
} |
||||
|
||||
void Swap(Agile& object) |
||||
{ |
||||
std::swap(_object, object._object); |
||||
} |
||||
|
||||
bool operator==(nullptr_t) const throw() |
||||
{ |
||||
return _object == nullptr; |
||||
} |
||||
|
||||
bool operator==(const Agile& other) const throw() |
||||
{ |
||||
return _object == other._object; |
||||
} |
||||
|
||||
bool operator<(const Agile& other) const throw() |
||||
{ |
||||
return reinterpret_cast<void*>(_object) < reinterpret_cast<void*>(other._object); |
||||
} |
||||
}; |
||||
|
||||
#pragma warning(pop) |
||||
|
||||
template<class U> |
||||
bool operator==(nullptr_t, const Agile<U>& a) throw() |
||||
{ |
||||
return a == nullptr; |
||||
} |
||||
|
||||
template<class U> |
||||
bool operator!=(const Agile<U>& a, nullptr_t) throw() |
||||
{ |
||||
return !(a == nullptr); |
||||
} |
||||
|
||||
template<class U> |
||||
bool operator!=(nullptr_t, const Agile<U>& a) throw() |
||||
{ |
||||
return !(a == nullptr); |
||||
} |
||||
|
||||
template<class U> |
||||
bool operator!=(const Agile<U>& a, const Agile<U>& b) throw() |
||||
{ |
||||
return !(a == b); |
||||
} |
||||
|
||||
|
||||
#endif // _PLATFORM_AGILE_H_
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,91 @@ |
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
|
||||
// Copyright (C) 2014, Itseez, Inc., all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
|
||||
#include "../perf_precomp.hpp" |
||||
#include "opencv2/ts/ocl_perf.hpp" |
||||
|
||||
#ifdef HAVE_OPENCL |
||||
|
||||
namespace cvtest { |
||||
namespace ocl { |
||||
|
||||
///////////// HoughLines //////////////////////
|
||||
|
||||
struct Vec2fComparator |
||||
{ |
||||
bool operator()(const Vec2f& a, const Vec2f b) const |
||||
{ |
||||
if(a[0] != b[0]) return a[0] < b[0]; |
||||
else return a[1] < b[1]; |
||||
} |
||||
}; |
||||
|
||||
typedef std::tr1::tuple<Size, double, double> ImageSize_RhoStep_ThetaStep_t; |
||||
typedef TestBaseWithParam<ImageSize_RhoStep_ThetaStep_t> HoughLinesFixture; |
||||
|
||||
OCL_PERF_TEST_P(HoughLinesFixture, HoughLines, Combine(OCL_TEST_SIZES, |
||||
Values( 0.1, 1 ), |
||||
Values( CV_PI / 180.0, 0.1 ))) |
||||
{ |
||||
const Size srcSize = get<0>(GetParam()); |
||||
double rhoStep = get<1>(GetParam()); |
||||
double thetaStep = get<2>(GetParam()); |
||||
int threshold = 250; |
||||
|
||||
UMat usrc(srcSize, CV_8UC1), lines(1, 1, CV_32FC2); |
||||
Mat src(srcSize, CV_8UC1); |
||||
src.setTo(Scalar::all(0)); |
||||
line(src, Point(0, 100), Point(src.cols, 100), Scalar::all(255), 1); |
||||
line(src, Point(0, 200), Point(src.cols, 200), Scalar::all(255), 1); |
||||
line(src, Point(0, 400), Point(src.cols, 400), Scalar::all(255), 1); |
||||
line(src, Point(100, 0), Point(100, src.rows), Scalar::all(255), 1); |
||||
line(src, Point(200, 0), Point(200, src.rows), Scalar::all(255), 1); |
||||
line(src, Point(400, 0), Point(400, src.rows), Scalar::all(255), 1); |
||||
src.copyTo(usrc); |
||||
|
||||
declare.in(usrc).out(lines); |
||||
|
||||
OCL_TEST_CYCLE() cv::HoughLines(usrc, lines, rhoStep, thetaStep, threshold); |
||||
|
||||
Mat result; |
||||
lines.copyTo(result); |
||||
std::sort(result.begin<Vec2f>(), result.end<Vec2f>(), Vec2fComparator()); |
||||
|
||||
SANITY_CHECK(result, 1e-6); |
||||
} |
||||
|
||||
///////////// HoughLinesP /////////////////////
|
||||
|
||||
typedef std::tr1::tuple<string, double, double> Image_RhoStep_ThetaStep_t; |
||||
typedef TestBaseWithParam<Image_RhoStep_ThetaStep_t> HoughLinesPFixture; |
||||
|
||||
OCL_PERF_TEST_P(HoughLinesPFixture, HoughLinesP, Combine(Values("cv/shared/pic5.png", "stitching/a1.png"), |
||||
Values( 0.1, 1 ), |
||||
Values( CV_PI / 180.0, 0.1 ))) |
||||
{ |
||||
string filename = get<0>(GetParam()); |
||||
double rhoStep = get<1>(GetParam()); |
||||
double thetaStep = get<2>(GetParam()); |
||||
int threshold = 100; |
||||
double minLineLength = 50, maxGap = 5; |
||||
|
||||
Mat image = imread(getDataPath(filename), IMREAD_GRAYSCALE); |
||||
Canny(image, image, 50, 200, 3); |
||||
UMat usrc, lines(1, 1, CV_32SC4); |
||||
image.copyTo(usrc); |
||||
|
||||
declare.in(usrc).out(lines); |
||||
|
||||
OCL_TEST_CYCLE() cv::HoughLinesP(usrc, lines, rhoStep, thetaStep, threshold, minLineLength, maxGap); |
||||
|
||||
EXPECT_NE((int) lines.total(), 0); |
||||
SANITY_CHECK_NOTHING(); |
||||
} |
||||
|
||||
} } // namespace cvtest::ocl
|
||||
|
||||
#endif // HAVE_OPENCL
|
@ -0,0 +1 @@ |
||||
include/opencv2/bioinspired/retina.hpp |
@ -0,0 +1,97 @@ |
||||
#ifndef KDTREE_H |
||||
#define KDTREE_H |
||||
|
||||
#include "precomp.hpp" |
||||
|
||||
namespace cv |
||||
{ |
||||
namespace ml |
||||
{ |
||||
|
||||
/*!
|
||||
Fast Nearest Neighbor Search Class. |
||||
|
||||
The class implements D. Lowe BBF (Best-Bin-First) algorithm for the last |
||||
approximate (or accurate) nearest neighbor search in multi-dimensional spaces. |
||||
|
||||
First, a set of vectors is passed to KDTree::KDTree() constructor |
||||
or KDTree::build() method, where it is reordered. |
||||
|
||||
Then arbitrary vectors can be passed to KDTree::findNearest() methods, which |
||||
find the K nearest neighbors among the vectors from the initial set. |
||||
The user can balance between the speed and accuracy of the search by varying Emax |
||||
parameter, which is the number of leaves that the algorithm checks. |
||||
The larger parameter values yield more accurate results at the expense of lower processing speed. |
||||
|
||||
\code |
||||
KDTree T(points, false); |
||||
const int K = 3, Emax = INT_MAX; |
||||
int idx[K]; |
||||
float dist[K]; |
||||
T.findNearest(query_vec, K, Emax, idx, 0, dist); |
||||
CV_Assert(dist[0] <= dist[1] && dist[1] <= dist[2]); |
||||
\endcode |
||||
*/ |
||||
class CV_EXPORTS_W KDTree |
||||
{ |
||||
public: |
||||
/*!
|
||||
The node of the search tree. |
||||
*/ |
||||
struct Node |
||||
{ |
||||
Node() : idx(-1), left(-1), right(-1), boundary(0.f) {} |
||||
Node(int _idx, int _left, int _right, float _boundary) |
||||
: idx(_idx), left(_left), right(_right), boundary(_boundary) {} |
||||
|
||||
//! split dimension; >=0 for nodes (dim), < 0 for leaves (index of the point)
|
||||
int idx; |
||||
//! node indices of the left and the right branches
|
||||
int left, right; |
||||
//! go to the left if query_vec[node.idx]<=node.boundary, otherwise go to the right
|
||||
float boundary; |
||||
}; |
||||
|
||||
//! the default constructor
|
||||
CV_WRAP KDTree(); |
||||
//! the full constructor that builds the search tree
|
||||
CV_WRAP KDTree(InputArray points, bool copyAndReorderPoints = false); |
||||
//! the full constructor that builds the search tree
|
||||
CV_WRAP KDTree(InputArray points, InputArray _labels, |
||||
bool copyAndReorderPoints = false); |
||||
//! builds the search tree
|
||||
CV_WRAP void build(InputArray points, bool copyAndReorderPoints = false); |
||||
//! builds the search tree
|
||||
CV_WRAP void build(InputArray points, InputArray labels, |
||||
bool copyAndReorderPoints = false); |
||||
//! finds the K nearest neighbors of "vec" while looking at Emax (at most) leaves
|
||||
CV_WRAP int findNearest(InputArray vec, int K, int Emax, |
||||
OutputArray neighborsIdx, |
||||
OutputArray neighbors = noArray(), |
||||
OutputArray dist = noArray(), |
||||
OutputArray labels = noArray()) const; |
||||
//! finds all the points from the initial set that belong to the specified box
|
||||
CV_WRAP void findOrthoRange(InputArray minBounds, |
||||
InputArray maxBounds, |
||||
OutputArray neighborsIdx, |
||||
OutputArray neighbors = noArray(), |
||||
OutputArray labels = noArray()) const; |
||||
//! returns vectors with the specified indices
|
||||
CV_WRAP void getPoints(InputArray idx, OutputArray pts, |
||||
OutputArray labels = noArray()) const; |
||||
//! return a vector with the specified index
|
||||
const float* getPoint(int ptidx, int* label = 0) const; |
||||
//! returns the search space dimensionality
|
||||
CV_WRAP int dims() const; |
||||
|
||||
std::vector<Node> nodes; //!< all the tree nodes
|
||||
CV_PROP Mat points; //!< all the points. It can be a reordered copy of the input vector set or the original vector set.
|
||||
CV_PROP std::vector<int> labels; //!< the parallel array of labels.
|
||||
CV_PROP int maxDepth; //!< maximum depth of the search tree. Do not modify it
|
||||
CV_PROP_RW int normType; //!< type of the distance (cv::NORM_L1 or cv::NORM_L2) used for search. Initially set to cv::NORM_L2, but you can modify it
|
||||
}; |
||||
|
||||
} |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,157 @@ |
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
||||
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include "test_precomp.hpp" |
||||
#include "opencv2/videoio.hpp" |
||||
#include "opencv2/ts.hpp" |
||||
#include <stdio.h> |
||||
|
||||
#if BUILD_WITH_VIDEO_INPUT_SUPPORT |
||||
|
||||
using namespace cv; |
||||
using namespace std; |
||||
using namespace cvtest; |
||||
|
||||
#ifdef HAVE_GSTREAMER |
||||
const string ext[] = {"avi"}; |
||||
#else |
||||
const string ext[] = {"avi", "mov", "mp4"}; |
||||
#endif |
||||
|
||||
TEST(Videoio_Video, prop_resolution) |
||||
{ |
||||
const size_t n = sizeof(ext)/sizeof(ext[0]); |
||||
const string src_dir = TS::ptr()->get_data_path(); |
||||
|
||||
TS::ptr()->printf(cvtest::TS::LOG, "\n\nSource files directory: %s\n", (src_dir+"video/").c_str()); |
||||
|
||||
for (size_t i = 0; i < n; ++i) |
||||
{ |
||||
string file_path = src_dir+"video/big_buck_bunny."+ext[i]; |
||||
VideoCapture cap(file_path); |
||||
if (!cap.isOpened()) |
||||
{ |
||||
TS::ptr()->printf(cvtest::TS::LOG, "\nFile information (video %d): \n\nName: big_buck_bunny.%s\nFAILED\n\n", i+1, ext[i].c_str()); |
||||
TS::ptr()->printf(cvtest::TS::LOG, "Error: cannot read source video file.\n"); |
||||
TS::ptr()->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA); |
||||
return; |
||||
} |
||||
|
||||
ASSERT_EQ(672, cap.get(CAP_PROP_FRAME_WIDTH)); |
||||
ASSERT_EQ(384, cap.get(CAP_PROP_FRAME_HEIGHT)); |
||||
} |
||||
} |
||||
|
||||
TEST(Videoio_Video, actual_resolution) |
||||
{ |
||||
const size_t n = sizeof(ext)/sizeof(ext[0]); |
||||
const string src_dir = TS::ptr()->get_data_path(); |
||||
|
||||
TS::ptr()->printf(cvtest::TS::LOG, "\n\nSource files directory: %s\n", (src_dir+"video/").c_str()); |
||||
|
||||
for (size_t i = 0; i < n; ++i) |
||||
{ |
||||
string file_path = src_dir+"video/big_buck_bunny."+ext[i]; |
||||
VideoCapture cap(file_path); |
||||
if (!cap.isOpened()) |
||||
{ |
||||
TS::ptr()->printf(cvtest::TS::LOG, "\nFile information (video %d): \n\nName: big_buck_bunny.%s\nFAILED\n\n", i+1, ext[i].c_str()); |
||||
TS::ptr()->printf(cvtest::TS::LOG, "Error: cannot read source video file.\n"); |
||||
TS::ptr()->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA); |
||||
return; |
||||
} |
||||
|
||||
Mat frame; |
||||
cap >> frame; |
||||
|
||||
ASSERT_EQ(672, frame.cols); |
||||
ASSERT_EQ(384, frame.rows); |
||||
} |
||||
} |
||||
|
||||
TEST(Videoio_Video, prop_fps) |
||||
{ |
||||
const size_t n = sizeof(ext)/sizeof(ext[0]); |
||||
const string src_dir = TS::ptr()->get_data_path(); |
||||
|
||||
TS::ptr()->printf(cvtest::TS::LOG, "\n\nSource files directory: %s\n", (src_dir+"video/").c_str()); |
||||
|
||||
for (size_t i = 0; i < n; ++i) |
||||
{ |
||||
string file_path = src_dir+"video/big_buck_bunny."+ext[i]; |
||||
VideoCapture cap(file_path); |
||||
if (!cap.isOpened()) |
||||
{ |
||||
TS::ptr()->printf(cvtest::TS::LOG, "\nFile information (video %d): \n\nName: big_buck_bunny.%s\nFAILED\n\n", i+1, ext[i].c_str()); |
||||
TS::ptr()->printf(cvtest::TS::LOG, "Error: cannot read source video file.\n"); |
||||
TS::ptr()->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA); |
||||
return; |
||||
} |
||||
|
||||
ASSERT_EQ(24, cap.get(CAP_PROP_FPS)); |
||||
} |
||||
} |
||||
|
||||
TEST(Videoio_Video, prop_framecount) |
||||
{ |
||||
const size_t n = sizeof(ext)/sizeof(ext[0]); |
||||
const string src_dir = TS::ptr()->get_data_path(); |
||||
|
||||
TS::ptr()->printf(cvtest::TS::LOG, "\n\nSource files directory: %s\n", (src_dir+"video/").c_str()); |
||||
|
||||
for (size_t i = 0; i < n; ++i) |
||||
{ |
||||
string file_path = src_dir+"video/big_buck_bunny."+ext[i]; |
||||
VideoCapture cap(file_path); |
||||
if (!cap.isOpened()) |
||||
{ |
||||
TS::ptr()->printf(cvtest::TS::LOG, "\nFile information (video %d): \n\nName: big_buck_bunny.%s\nFAILED\n\n", i+1, ext[i].c_str()); |
||||
TS::ptr()->printf(cvtest::TS::LOG, "Error: cannot read source video file.\n"); |
||||
TS::ptr()->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA); |
||||
return; |
||||
} |
||||
|
||||
ASSERT_EQ(125, cap.get(CAP_PROP_FRAME_COUNT)); |
||||
} |
||||
} |
||||
|
||||
#endif |