@ -0,0 +1,96 @@ |
||||
#!/usr/bin/env python |
||||
|
||||
from pathlib import Path |
||||
import re |
||||
|
||||
# Tasks |
||||
# 1. Find all tutorials |
||||
# 2. Generate tree (@subpage) |
||||
# 3. Check prev/next nodes |
||||
|
||||
class Tutorial(object): |
||||
def __init__(self, path): |
||||
self.path = path |
||||
self.title = None # doxygen title |
||||
self.children = [] # ordered titles |
||||
self.prev = None |
||||
self.next = None |
||||
with open(path, "rt") as f: |
||||
self.parse(f) |
||||
|
||||
def parse(self, f): |
||||
rx_title = re.compile(r"\{#(\w+)\}") |
||||
rx_subpage = re.compile(r"@subpage\s+(\w+)") |
||||
rx_prev = re.compile(r"@prev_tutorial\{(\w+)\}") |
||||
rx_next = re.compile(r"@next_tutorial\{(\w+)\}") |
||||
for line in f: |
||||
if self.title is None: |
||||
m = rx_title.search(line) |
||||
if m: |
||||
self.title = m.group(1) |
||||
continue |
||||
if self.prev is None: |
||||
m = rx_prev.search(line) |
||||
if m: |
||||
self.prev = m.group(1) |
||||
continue |
||||
if self.next is None: |
||||
m = rx_next.search(line) |
||||
if m: |
||||
self.next = m.group(1) |
||||
continue |
||||
m = rx_subpage.search(line) |
||||
if m: |
||||
self.children.append(m.group(1)) |
||||
continue |
||||
|
||||
def verify_prev_next(self, storage): |
||||
res = True |
||||
|
||||
if self.title is None: |
||||
print("[W] No title") |
||||
res = False |
||||
|
||||
prev = None |
||||
for one in self.children: |
||||
c = storage[one] |
||||
if c.prev is not None and c.prev != prev: |
||||
print("[W] Wrong prev_tutorial: expected {} / actual {}".format(c.prev, prev)) |
||||
res = False |
||||
prev = c.title |
||||
|
||||
next = None |
||||
for one in reversed(self.children): |
||||
c = storage[one] |
||||
if c.next is not None and c.next != next: |
||||
print("[W] Wrong next_tutorial: expected {} / actual {}".format(c.next, next)) |
||||
res = False |
||||
next = c.title |
||||
|
||||
if len(self.children) == 0 and self.prev is None and self.next is None: |
||||
print("[W] No prev and next tutorials") |
||||
res = False |
||||
|
||||
return res |
||||
|
||||
if __name__ == "__main__": |
||||
|
||||
p = Path('tutorials') |
||||
print("Looking for tutorials in: '{}'".format(p)) |
||||
|
||||
all_tutorials = dict() |
||||
for f in p.glob('**/*'): |
||||
if f.suffix.lower() in ('.markdown', '.md'): |
||||
t = Tutorial(f) |
||||
all_tutorials[t.title] = t |
||||
|
||||
res = 0 |
||||
print("Found: {}".format(len(all_tutorials))) |
||||
print("------") |
||||
for title, t in all_tutorials.items(): |
||||
if not t.verify_prev_next(all_tutorials): |
||||
print("[E] Verification failed: {}".format(t.path)) |
||||
print("------") |
||||
res = 1 |
||||
|
||||
exit(res) |
@ -0,0 +1,4 @@ |
||||
High Level GUI and Media (highgui module) {#tutorial_table_of_content_highgui} |
||||
========================================= |
||||
|
||||
Content has been moved to this page: @ref tutorial_table_of_content_app |
@ -0,0 +1,4 @@ |
||||
Image Input and Output (imgcodecs module) {#tutorial_table_of_content_imgcodecs} |
||||
========================================= |
||||
|
||||
Content has been moved to this page: @ref tutorial_table_of_content_app |
@ -0,0 +1,4 @@ |
||||
Video Input and Output (videoio module) {#tutorial_table_of_content_videoio} |
||||
========================================= |
||||
|
||||
Content has been moved to this page: @ref tutorial_table_of_content_app |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@ -1,6 +1,14 @@ |
||||
Reading Geospatial Raster files with GDAL {#tutorial_raster_io_gdal} |
||||
========================================= |
||||
|
||||
@prev_tutorial{tutorial_trackbar} |
||||
@next_tutorial{tutorial_video_input_psnr_ssim} |
||||
|
||||
| | | |
||||
| -: | :- | |
||||
| Original author | Marvin Smith | |
||||
| Compatibility | OpenCV >= 3.0 | |
||||
|
||||
Geospatial raster data is a heavily used product in Geographic Information Systems and |
||||
Photogrammetry. Raster data typically can represent imagery and Digital Elevation Models (DEM). The |
||||
standard library for loading GIS imagery is the Geographic Data Abstraction Library [(GDAL)](http://www.gdal.org). In this |
@ -0,0 +1,10 @@ |
||||
Application utils (highgui, imgcodecs, videoio modules) {#tutorial_table_of_content_app} |
||||
======================================================= |
||||
|
||||
- @subpage tutorial_trackbar |
||||
- @subpage tutorial_raster_io_gdal |
||||
- @subpage tutorial_video_input_psnr_ssim |
||||
- @subpage tutorial_video_write |
||||
- @subpage tutorial_kinect_openni |
||||
- @subpage tutorial_orbbec_astra |
||||
- @subpage tutorial_intelperc |
@ -1,6 +1,14 @@ |
||||
Adding a Trackbar to our applications! {#tutorial_trackbar} |
||||
====================================== |
||||
|
||||
@next_tutorial{tutorial_raster_io_gdal} |
||||
|
||||
| | | |
||||
| -: | :- | |
||||
| Original author | Ana Huamán | |
||||
| Compatibility | OpenCV >= 3.0 | |
||||
|
||||
|
||||
- In the previous tutorials (about @ref tutorial_adding_images and the @ref tutorial_basic_linear_transform) |
||||
you might have noted that we needed to give some **input** to our programs, such |
||||
as \f$\alpha\f$ and \f$beta\f$. We accomplished that by entering this data using the Terminal. |
@ -1,8 +1,14 @@ |
||||
Video Input with OpenCV and similarity measurement {#tutorial_video_input_psnr_ssim} |
||||
================================================== |
||||
|
||||
@prev_tutorial{tutorial_raster_io_gdal} |
||||
@next_tutorial{tutorial_video_write} |
||||
|
||||
| | | |
||||
| -: | :- | |
||||
| Original author | Bernát Gábor | |
||||
| Compatibility | OpenCV >= 3.0 | |
||||
|
||||
Goal |
||||
---- |
||||
|
Before Width: | Height: | Size: 8.0 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 117 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 51 KiB |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 4.0 KiB |
@ -1,14 +0,0 @@ |
||||
High Level GUI and Media (highgui module) {#tutorial_table_of_content_highgui} |
||||
========================================= |
||||
|
||||
This section contains tutorials about how to use the built-in graphical user interface of the library. |
||||
|
||||
- @subpage tutorial_trackbar |
||||
|
||||
*Languages:* C++, Java, Python |
||||
|
||||
*Compatibility:* \> OpenCV 2.0 |
||||
|
||||
*Author:* Ana Huamán |
||||
|
||||
We will learn how to add a Trackbar to our applications |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 4.8 KiB |