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

Commit

Permalink
release 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rgiduthuri committed Mar 17, 2016
1 parent df9413b commit f15964d
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 93 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Build this project to generate AMD OpenVX library and RUNVX executable.

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

#### Build using CMake
* Use CMake to configure and generate Makefile
* If AMD GPU (or OpenCL 2.0) is not available, use build flag -DCMAKE_DISABLE_FIND_PACKAGE_OpenCL=TRUE.
16 changes: 9 additions & 7 deletions openvx/ago/ago_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2526,14 +2526,16 @@ void agoPerfCaptureStop(vx_perf_t * perf)
void agoPerfCopyNormalize(AgoContext * context, vx_perf_t * perfDst, vx_perf_t * perfSrc)
{
agoPerfCaptureReset(perfDst);
// normalize all time units into nanoseconds
uint64_t num = 1000000000, denom = (uint64_t)agoGetClockFrequency();
perfDst->num = perfSrc->num;
perfDst->beg = perfSrc->beg;
perfDst->end = perfSrc->end;
perfDst->tmp = perfSrc->tmp;
perfDst->sum = perfSrc->sum;
perfDst->avg = perfSrc->avg;
perfDst->min = perfSrc->min;
perfDst->max = perfSrc->max;
perfDst->beg = perfSrc->beg * num / denom;
perfDst->end = perfSrc->end * num / denom;
perfDst->tmp = perfSrc->tmp * num / denom;
perfDst->sum = perfSrc->sum * num / denom;
perfDst->avg = perfSrc->avg * num / denom;
perfDst->min = perfSrc->min * num / denom;
perfDst->max = perfSrc->max * num / denom;
}

void agoAddLogEntry(vx_reference ref, vx_status status, const char *message, ...)
Expand Down
20 changes: 12 additions & 8 deletions openvx/api/vx_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1781,10 +1781,12 @@ VX_API_ENTRY vx_status VX_API_CALL vxQueryGraph(vx_graph graph, vx_enum attribut
case VX_GRAPH_ATTRIBUTE_AMD_PERFORMANCE_INTERNAL_LAST:
if (size == sizeof(AgoGraphPerfInternalInfo)) {
#if ENABLE_OPENCL
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = graph->opencl_perf.kernel_enqueue;
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = graph->opencl_perf.kernel_wait;
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = graph->opencl_perf.buffer_read;
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = graph->opencl_perf.buffer_write;
// normalize all time units into nanoseconds
uint64_t num = 1000000000, denom = (uint64_t)agoGetClockFrequency();
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = graph->opencl_perf.kernel_enqueue * num / denom;
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = graph->opencl_perf.kernel_wait * num / denom;
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = graph->opencl_perf.buffer_read * num / denom;
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = graph->opencl_perf.buffer_write * num / denom;
#else
memset(ptr, 0, size);
#endif
Expand All @@ -1795,10 +1797,12 @@ VX_API_ENTRY vx_status VX_API_CALL vxQueryGraph(vx_graph graph, vx_enum attribut
if (size == sizeof(AgoGraphPerfInternalInfo)) {
#if ENABLE_OPENCL
if (graph->perf.num > 0) {
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = graph->opencl_perf_total.kernel_enqueue / graph->perf.num;
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = graph->opencl_perf_total.kernel_wait / graph->perf.num;
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = graph->opencl_perf_total.buffer_read / graph->perf.num;
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = graph->opencl_perf_total.buffer_write / graph->perf.num;
// normalize all time units into nanoseconds
uint64_t num = 1000000000, denom = (uint64_t)agoGetClockFrequency();
((AgoGraphPerfInternalInfo *)ptr)->kernel_enqueue = (graph->opencl_perf_total.kernel_enqueue / graph->perf.num) * num / denom;
((AgoGraphPerfInternalInfo *)ptr)->kernel_wait = (graph->opencl_perf_total.kernel_wait / graph->perf.num) * num / denom;
((AgoGraphPerfInternalInfo *)ptr)->buffer_read = (graph->opencl_perf_total.buffer_read / graph->perf.num) * num / denom;
((AgoGraphPerfInternalInfo *)ptr)->buffer_write = (graph->opencl_perf_total.buffer_write / graph->perf.num) * num / denom;
}
else
#endif
Expand Down
81 changes: 81 additions & 0 deletions runvx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ RunVX is a command line tool used to execute OpenVX graphs. As input, RUNVX take
virtual data object won't be available after graph reset.
graph launch [<graphName(s)>]
Launch the default or specified graph(s).
graph info [<graphName(s)>]
Show graph details for debug.

init <dataName> <initial-value>
Initialize data object with specified value.
Expand Down Expand Up @@ -361,3 +363,82 @@ File **skintonedetect.gdf**:
node org.khronos.openvx.and and1 B20 and2 # compute B20 & and1
node org.khronos.openvx.and RmG15 RmB0 and3 # compute RmG15 & RmB0
node org.khronos.openvx.and and2 and3 output # compute and2 & and3 as output

### Feature Tracker
The feature tracker example demonstrates building an application with two
separate graphs that uses Harris Corners and Optical Flow kernels.
This example requires use of delay data objects that contain
multiple pyramid and array objects.
Use [PETS09-S1-L1-View001.avi](http://ewh.ieee.org/r6/scv/sps/openvx-material/PETS09-S1-L1-View001.avi) as input video sequence.

% runvx[.exe] file feature_tracker.gdf

File **feature_tracker.gdf**:

# create image object for the input video sequence.
data input = image:768,576,RGB2
read input PETS09-S1-L1-View001.avi

# create output keypoint array objects inside a delay object with two slots.
# two slots are needed to keep track current keypoints from previous time.
data exemplarArr = array:KEYPOINT,10000 # max trackable keypoints are 10,000
data delayArr = delay:exemplarArr,2 # two slots inside the delay object

# request for displaying input with keypoints from delay slot[0].
view input feature_tracker
view delayArr feature_tracker

# create pyramid objects inside a delay object with two slots.
# two slots of pyramids are needed for optical flow kernel.
data exemplarPyr = pyramid:6,half,768,576,U008
data delayPyr = delay:exemplarPyr,2

# create first graph to initialize keypoints using Harris Corners and
# compute pyramid for by Optical Flow later using another graph
data iyuv = image-virtual:0,0,IYUV
data luma = image-virtual:0,0,U008
data strength_thresh = scalar:FLOAT32,0.0005
data min_distance = scalar:FLOAT32,5.0
data sensitivity = scalar:FLOAT32,0.04
data grad_size = scalar:INT32,3
data block_size = scalar:INT32,3
node org.khronos.openvx.color_convert input iyuv
node org.khronos.openvx.channel_extract iyuv !CHANNEL_Y luma
node org.khronos.openvx.harris_corners luma strength_thresh min_distance sensitivity \
grad_size block_size delayArr[0] null
node org.khronos.openvx.gaussian_pyramid luma delayPyr[0]

# request vxAgeDelay call for delay objects after each frame with
# current graph and save current graph with the name "harris"
graph auto-age delayPyr delayArr
graph save-and-reset harris

# create second graph to track keypoints using Optical Flow assuming that
# pyramid/keypoints in delay objects have been initialized with previous frame
data iyuv = image-virtual:0,0,IYUV
data luma = image-virtual:0,0,U008
data termination = scalar:ENUM,CRITERIA_BOTH
data epsilon = scalar:FLOAT32,0.01
data num_iterations = scalar:UINT32,5
data use_initial_estimate = scalar:BOOL,0
data window_dimension = scalar:SIZE,6
node org.khronos.openvx.color_convert input iyuv
node org.khronos.openvx.channel_extract iyuv !CHANNEL_Y luma
node org.khronos.openvx.gaussian_pyramid luma delayPyr[0]
node org.khronos.openvx.optical_flow_pyr_lk delayPyr[-1] delayPyr[0] \
delayArr[-1] delayArr[-1] delayArr[0] \
termination epsilon num_iterations \
use_initial_estimate window_dimension

# request vxAgeDelay call for delay objects after each frame with
# current graph and save current graph with the name "opticalflow"
graph auto-age delayPyr delayArr
graph save-and-reset opticalflow

# launch "harris" graph to process first frame in the video sequence
set frames 1
graph launch harris

# launch "opticalflow" graph to process remaining frames in the video sequence
set frames default
graph launch opticalflow
Loading

0 comments on commit f15964d

Please sign in to comment.