Skip to content
This repository was archived by the owner on Feb 16, 2019. It is now read-only.

Commit f15964d

Browse files
author
rgiduthuri
committed
release 0.9.1
1 parent df9413b commit f15964d

File tree

8 files changed

+240
-93
lines changed

8 files changed

+240
-93
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Build this project to generate AMD OpenVX library and RUNVX executable.
2929

3030
#### Build using Visual Studio Professional 2013 on 64-bit Windows 10/8.1/7
3131
* Use amdovx-core/amdovx.sln to build for x64 platform
32+
* If AMD GPU (or OpenCL 2.0) is not available, set build flag ENABLE_OPENCL=0 in amdovx-core/openvx/openvx.vcxproj.
3233

3334
#### Build using CMake
3435
* Use CMake to configure and generate Makefile
36+
* If AMD GPU (or OpenCL 2.0) is not available, use build flag -DCMAKE_DISABLE_FIND_PACKAGE_OpenCL=TRUE.

openvx/ago/ago_util.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,14 +2526,16 @@ void agoPerfCaptureStop(vx_perf_t * perf)
25262526
void agoPerfCopyNormalize(AgoContext * context, vx_perf_t * perfDst, vx_perf_t * perfSrc)
25272527
{
25282528
agoPerfCaptureReset(perfDst);
2529+
// normalize all time units into nanoseconds
2530+
uint64_t num = 1000000000, denom = (uint64_t)agoGetClockFrequency();
25292531
perfDst->num = perfSrc->num;
2530-
perfDst->beg = perfSrc->beg;
2531-
perfDst->end = perfSrc->end;
2532-
perfDst->tmp = perfSrc->tmp;
2533-
perfDst->sum = perfSrc->sum;
2534-
perfDst->avg = perfSrc->avg;
2535-
perfDst->min = perfSrc->min;
2536-
perfDst->max = perfSrc->max;
2532+
perfDst->beg = perfSrc->beg * num / denom;
2533+
perfDst->end = perfSrc->end * num / denom;
2534+
perfDst->tmp = perfSrc->tmp * num / denom;
2535+
perfDst->sum = perfSrc->sum * num / denom;
2536+
perfDst->avg = perfSrc->avg * num / denom;
2537+
perfDst->min = perfSrc->min * num / denom;
2538+
perfDst->max = perfSrc->max * num / denom;
25372539
}
25382540

25392541
void agoAddLogEntry(vx_reference ref, vx_status status, const char *message, ...)

openvx/api/vx_api.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,10 +1781,12 @@ VX_API_ENTRY vx_status VX_API_CALL vxQueryGraph(vx_graph graph, vx_enum attribut
17811781
case VX_GRAPH_ATTRIBUTE_AMD_PERFORMANCE_INTERNAL_LAST:
17821782
if (size == sizeof(AgoGraphPerfInternalInfo)) {
17831783
#if ENABLE_OPENCL
1784-
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = graph->opencl_perf.kernel_enqueue;
1785-
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = graph->opencl_perf.kernel_wait;
1786-
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = graph->opencl_perf.buffer_read;
1787-
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = graph->opencl_perf.buffer_write;
1784+
// normalize all time units into nanoseconds
1785+
uint64_t num = 1000000000, denom = (uint64_t)agoGetClockFrequency();
1786+
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = graph->opencl_perf.kernel_enqueue * num / denom;
1787+
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = graph->opencl_perf.kernel_wait * num / denom;
1788+
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = graph->opencl_perf.buffer_read * num / denom;
1789+
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = graph->opencl_perf.buffer_write * num / denom;
17881790
#else
17891791
memset(ptr, 0, size);
17901792
#endif
@@ -1795,10 +1797,12 @@ VX_API_ENTRY vx_status VX_API_CALL vxQueryGraph(vx_graph graph, vx_enum attribut
17951797
if (size == sizeof(AgoGraphPerfInternalInfo)) {
17961798
#if ENABLE_OPENCL
17971799
if (graph->perf.num > 0) {
1798-
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = graph->opencl_perf_total.kernel_enqueue / graph->perf.num;
1799-
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = graph->opencl_perf_total.kernel_wait / graph->perf.num;
1800-
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = graph->opencl_perf_total.buffer_read / graph->perf.num;
1801-
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = graph->opencl_perf_total.buffer_write / graph->perf.num;
1800+
// normalize all time units into nanoseconds
1801+
uint64_t num = 1000000000, denom = (uint64_t)agoGetClockFrequency();
1802+
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = (graph->opencl_perf_total.kernel_enqueue / graph->perf.num) * num / denom;
1803+
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = (graph->opencl_perf_total.kernel_wait / graph->perf.num) * num / denom;
1804+
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = (graph->opencl_perf_total.buffer_read / graph->perf.num) * num / denom;
1805+
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = (graph->opencl_perf_total.buffer_write / graph->perf.num) * num / denom;
18021806
}
18031807
else
18041808
#endif

runvx/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ RunVX is a command line tool used to execute OpenVX graphs. As input, RUNVX take
167167
virtual data object won't be available after graph reset.
168168
graph launch [<graphName(s)>]
169169
Launch the default or specified graph(s).
170+
graph info [<graphName(s)>]
171+
Show graph details for debug.
170172

171173
init <dataName> <initial-value>
172174
Initialize data object with specified value.
@@ -361,3 +363,82 @@ File **skintonedetect.gdf**:
361363
node org.khronos.openvx.and and1 B20 and2 # compute B20 & and1
362364
node org.khronos.openvx.and RmG15 RmB0 and3 # compute RmG15 & RmB0
363365
node org.khronos.openvx.and and2 and3 output # compute and2 & and3 as output
366+
367+
### Feature Tracker
368+
The feature tracker example demonstrates building an application with two
369+
separate graphs that uses Harris Corners and Optical Flow kernels.
370+
This example requires use of delay data objects that contain
371+
multiple pyramid and array objects.
372+
Use [PETS09-S1-L1-View001.avi](http://ewh.ieee.org/r6/scv/sps/openvx-material/PETS09-S1-L1-View001.avi) as input video sequence.
373+
374+
% runvx[.exe] file feature_tracker.gdf
375+
376+
File **feature_tracker.gdf**:
377+
378+
# create image object for the input video sequence.
379+
data input = image:768,576,RGB2
380+
read input PETS09-S1-L1-View001.avi
381+
382+
# create output keypoint array objects inside a delay object with two slots.
383+
# two slots are needed to keep track current keypoints from previous time.
384+
data exemplarArr = array:KEYPOINT,10000 # max trackable keypoints are 10,000
385+
data delayArr = delay:exemplarArr,2 # two slots inside the delay object
386+
387+
# request for displaying input with keypoints from delay slot[0].
388+
view input feature_tracker
389+
view delayArr feature_tracker
390+
391+
# create pyramid objects inside a delay object with two slots.
392+
# two slots of pyramids are needed for optical flow kernel.
393+
data exemplarPyr = pyramid:6,half,768,576,U008
394+
data delayPyr = delay:exemplarPyr,2
395+
396+
# create first graph to initialize keypoints using Harris Corners and
397+
# compute pyramid for by Optical Flow later using another graph
398+
data iyuv = image-virtual:0,0,IYUV
399+
data luma = image-virtual:0,0,U008
400+
data strength_thresh = scalar:FLOAT32,0.0005
401+
data min_distance = scalar:FLOAT32,5.0
402+
data sensitivity = scalar:FLOAT32,0.04
403+
data grad_size = scalar:INT32,3
404+
data block_size = scalar:INT32,3
405+
node org.khronos.openvx.color_convert input iyuv
406+
node org.khronos.openvx.channel_extract iyuv !CHANNEL_Y luma
407+
node org.khronos.openvx.harris_corners luma strength_thresh min_distance sensitivity \
408+
grad_size block_size delayArr[0] null
409+
node org.khronos.openvx.gaussian_pyramid luma delayPyr[0]
410+
411+
# request vxAgeDelay call for delay objects after each frame with
412+
# current graph and save current graph with the name "harris"
413+
graph auto-age delayPyr delayArr
414+
graph save-and-reset harris
415+
416+
# create second graph to track keypoints using Optical Flow assuming that
417+
# pyramid/keypoints in delay objects have been initialized with previous frame
418+
data iyuv = image-virtual:0,0,IYUV
419+
data luma = image-virtual:0,0,U008
420+
data termination = scalar:ENUM,CRITERIA_BOTH
421+
data epsilon = scalar:FLOAT32,0.01
422+
data num_iterations = scalar:UINT32,5
423+
data use_initial_estimate = scalar:BOOL,0
424+
data window_dimension = scalar:SIZE,6
425+
node org.khronos.openvx.color_convert input iyuv
426+
node org.khronos.openvx.channel_extract iyuv !CHANNEL_Y luma
427+
node org.khronos.openvx.gaussian_pyramid luma delayPyr[0]
428+
node org.khronos.openvx.optical_flow_pyr_lk delayPyr[-1] delayPyr[0] \
429+
delayArr[-1] delayArr[-1] delayArr[0] \
430+
termination epsilon num_iterations \
431+
use_initial_estimate window_dimension
432+
433+
# request vxAgeDelay call for delay objects after each frame with
434+
# current graph and save current graph with the name "opticalflow"
435+
graph auto-age delayPyr delayArr
436+
graph save-and-reset opticalflow
437+
438+
# launch "harris" graph to process first frame in the video sequence
439+
set frames 1
440+
graph launch harris
441+
442+
# launch "opticalflow" graph to process remaining frames in the video sequence
443+
set frames default
444+
graph launch opticalflow

0 commit comments

Comments
 (0)