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
0de8ed10
Commit
0de8ed10
authored
Aug 21, 2011
by
Alexander Mordvintsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo description url parsing
parent
5b00763b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
17 deletions
+24
-17
demo.py
samples/python2/demo.py
+21
-16
stereo_match.py
samples/python2/stereo_match.py
+1
-1
turing.py
samples/python2/turing.py
+2
-0
No files found.
samples/python2/demo.py
View file @
0de8ed10
...
...
@@ -2,6 +2,7 @@ import Tkinter as tk
from
ScrolledText
import
ScrolledText
from
glob
import
glob
from
common
import
splitfn
import
webbrowser
#from IPython.Shell import IPShellEmbed
#ipshell = IPShellEmbed()
...
...
@@ -80,6 +81,7 @@ class App:
def
on_link
(
self
,
url
):
print
url
webbrowser
.
open
(
url
)
def
on_demo_select
(
self
,
evt
):
name
=
self
.
demos_lb
.
get
(
self
.
demos_lb
.
curselection
()[
0
]
)
...
...
@@ -101,28 +103,31 @@ class App:
s
=
s
.
rstrip
()
if
i
==
0
and
not
s
:
continue
sn
=
len
(
s
)
if
s
and
s
==
'='
*
sn
:
if
s
and
s
==
'='
*
len
(
s
):
text
.
tag_add
(
'header1'
,
'end-2l'
,
'end-1l'
)
elif
s
and
s
==
'-'
*
sn
:
elif
s
and
s
==
'-'
*
len
(
s
)
:
text
.
tag_add
(
'header2'
,
'end-2l'
,
'end-1l'
)
else
:
text
.
insert
(
'end'
,
s
+
'
\n
'
)
def
format_line
(
self
,
s
):
text
=
self
.
text
pos
,
n
=
0
,
len
(
s
)
while
pos
<
n
:
next
=
s
.
find
(
'http://'
,
pos
)
if
next
<
0
:
next
=
n
test
.
insert
(
tk
.
END
,
s
[
pos
:
next
])
pos
=
next
#text.insert(tk.END, "click here!", linker.add('http://asdfsdaf'))
def
add_link
(
start
,
end
,
url
):
for
tag
in
self
.
linker
.
add
(
url
):
text
.
tag_add
(
tag
,
start
,
end
)
self
.
match_text
(
r'http://\S+'
,
add_link
)
def
match_text
(
self
,
pattern
,
tag_proc
):
text
=
self
.
text
text
.
mark_set
(
'matchPos'
,
'1.0'
)
count
=
tk
.
IntVar
()
while
True
:
match_index
=
text
.
search
(
pattern
,
'matchPos'
,
count
=
count
,
regexp
=
True
,
stopindex
=
'end'
)
if
not
match_index
:
break
end_index
=
text
.
index
(
"
%
s+
%
sc"
%
(
match_index
,
count
.
get
())
)
text
.
mark_set
(
'matchPos'
,
end_index
)
if
callable
(
tag_proc
):
tag_proc
(
match_index
,
end_index
,
text
.
get
(
match_index
,
end_index
))
else
:
text
.
tag_add
(
tag_proc
,
match_index
,
end_index
)
def
run
(
self
):
tk
.
mainloop
()
...
...
samples/python2/stereo_match.py
View file @
0de8ed10
'''
Simple example of stereo image matching and point cloud generation.
Resulting .ply file cam be easily viewed using MeshLab (
http://meshlab.sourceforge.net/
)
Resulting .ply file cam be easily viewed using MeshLab (
http://meshlab.sourceforge.net/
)
'''
import
numpy
as
np
...
...
samples/python2/turing.py
View file @
0de8ed10
'''
Multiscale Turing Patterns generator.
=====================================
Inspired by http://www.jonathanmccabe.com/Cyclic_Symmetric_Multi-Scale_Turing_Patterns.pdf
'''
...
...
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