Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
59313f2a
Commit
59313f2a
authored
Nov 30, 2010
by
James Bowman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added lang to sphinx template, linked py to cookbook and cpp to cheatseet, #723
parent
196d45bc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
3 deletions
+55
-3
core_introduction.tex
doc/core_introduction.tex
+42
-0
layout.html
doc/latex2sphinx/_themes/blue/layout.html
+8
-1
theme.conf
doc/latex2sphinx/_themes/blue/theme.conf
+1
-0
buildall
doc/latex2sphinx/buildall
+1
-1
conf.py
doc/latex2sphinx/conf.py
+3
-1
No files found.
doc/core_introduction.tex
View file @
59313f2a
...
...
@@ -618,4 +618,46 @@ For a 3D array of size $j \times k \times l$, it returns a
Alternatively, use
\cross
{
fromarray
}
with the
\texttt
{
allowND
}
option to always return a
\cross
{
cvMatND
}
.
\subsection
{
OpenCV to pygame
}
To convert an OpenCV image to a
\href
{
http://www.pygame.org/
}{
pygame
}
surface:
\begin{lstlisting}
>>> import pygame.image, cv
>>> src = cv.LoadImage("lena.jpg")
>>> src
_
rgb = cv.CreateMat(src.height, src.width, cv.CV
_
8UC3)
>>> cv.CvtColor(src, src
_
rgb, cv.CV
_
BGR2RGB)
>>> pg
_
img = pygame.image.frombuffer(src
_
rgb.tostring(), cv.GetSize(src
_
rgb), "RGB")
>>> print pg
_
img
<Surface(512x512x24 SW)>
\end{lstlisting}
\subsection
{
OpenCV and OpenEXR
}
Using
\href
{
http://www.excamera.com/sphinx/articles-openexr.html
}{
OpenEXR's Python bindings
}
you can make a simple
image viewer:
\begin{lstlisting}
import OpenEXR, Imath, cv
filename = "GoldenGate.exr"
exrimage = OpenEXR.InputFile(filename)
dw = exrimage.header()['dataWindow']
(width, height) = (dw.max.x - dw.min.x + 1, dw.max.y - dw.min.y + 1)
def fromstr(s):
mat = cv.CreateMat(height, width, cv.CV
_
32FC1)
cv.SetData(mat, s)
return mat
pt = Imath.PixelType(Imath.PixelType.FLOAT)
(r, g, b) = [fromstr(s) for s in exrimage.channels("RGB", pt)]
bgr = cv.CreateMat(height, width, cv.CV
_
32FC3)
cv.Merge(b, g, r, None, bgr)
cv.ShowImage(filename, bgr)
cv.WaitKey()
\end{lstlisting}
\fi
doc/latex2sphinx/_themes/blue/layout.html
View file @
59313f2a
...
...
@@ -14,7 +14,14 @@
<h2>
Help and Feedback
</h2>
You did not find what you were looking for?
<ul>
<li>
Try the
<a
href=
"faq.html"
>
FAQ
</a>
.
</li>
{% if theme_lang == 'c' %}
{% endif %}
{% if theme_lang == 'cpp' %}
<li>
Try the
<a
href=
"http://opencv.willowgarage.com/wiki/Welcome?action=AttachFile&do=get&target=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 in the
<a
href=
"http://tech.groups.yahoo.com/group/OpenCV/"
>
user group/mailing list
</a>
.
</li>
<li>
If you think something is missing or wrong in the documentation,
please file a
<a
href=
"https://code.ros.org/trac/opencv/wiki"
>
bug report
</a>
.
</li>
...
...
doc/latex2sphinx/_themes/blue/theme.conf
View file @
59313f2a
...
...
@@ -29,3 +29,4 @@ feedbacklinkcolor = #ffffff
bodyfont
=
sans
-
serif
headfont
=
'Trebuchet MS'
,
sans
-
serif
lang
=
none
doc/latex2sphinx/buildall
View file @
59313f2a
...
...
@@ -10,7 +10,7 @@ for D in $LANGUAGES
do
echo
$D
mkdir
-p
$D
cp
conf.py
$D
sed
"s/%LANG%/
$D
/"
conf.py
>
$D
/conf.py
TEXINPUTS
=
$PWD
: sphinx-build
-w
$D
/sphinx.errors
-D
"lang=
$D
"
-b
html
-d
_build/doctrees/
$D
$D
_build/html/
$D
#Insert javascript links to load the Wiki in a frame
...
...
doc/latex2sphinx/conf.py
View file @
59313f2a
...
...
@@ -97,7 +97,9 @@ html_theme = 'blue'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options
=
{
"lang"
:
"
%
LANG
%
"
# buildall substitutes this for c, cpp, py
}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path
=
[
'../_themes'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment