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

Commit 443c996

Browse files
author
Pavel Tcherniaev
committed
fixed runvx example in README.md to use face1.jpg
1 parent 7c0a9c5 commit 443c996

File tree

1 file changed

+52
-51
lines changed

1 file changed

+52
-51
lines changed

runvx/README.md

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -315,62 +315,63 @@ File **canny.gdf**:
315315
node org.khronos.openvx.canny_edge_detector luma hyst gradient_size !NORM_L1 output
316316

317317
### Skintone Pixel Detector
318-
This example demonstrates building OpenVX graph for pixel-based skin tone detector [Peer et al. 2003]. Use [raja-koduri-640x480.jpg](http://cdn5.applesencia.com/wp-content/blogs.dir/17/files/2013/04/raja-koduri-640x480.jpg) for this example.
318+
This example demonstrates building OpenVX graph for pixel-based skin tone detector [Peer et al. 2003]. Use [face1.jpg](https://github.com/GPUOpen-ProfessionalCompute-Libraries/amdovx-core/blob/master/examples/images/face1.jpg) for this example.
319319

320320
% runvx[.exe] file skintonedetect.gdf
321321

322322
File **skintonedetect.gdf**:
323323

324-
# create input and output images
325-
data input = image:640,480,RGB2
326-
data output = image:640,480,U008
327-
328-
# specify input source for input image and request for displaying input and output images
329-
read input raja-koduri-640x480.jpg
330-
view input inputWindow
331-
view output skintoneWindow
332-
333-
# threshold objects
334-
data thr95 = threshold:BINARY,UINT8:INIT,95 # threshold for computing R > 95
335-
data thr40 = threshold:BINARY,UINT8:INIT,40 # threshold for computing G > 40
336-
data thr20 = threshold:BINARY,UINT8:INIT,20 # threshold for computing B > 20
337-
data thr15 = threshold:BINARY,UINT8:INIT,15 # threshold for computing R-G > 15
338-
data thr0 = threshold:BINARY,UINT8:INIT,0 # threshold for computing R-B > 0
339-
340-
# virtual image objects for intermediate results
341-
data R = image-virtual:0,0,U008
342-
data G = image-virtual:0,0,U008
343-
data B = image-virtual:0,0,U008
344-
data RmG = image-virtual:0,0,U008
345-
data RmB = image-virtual:0,0,U008
346-
data R95 = image-virtual:0,0,U008
347-
data G40 = image-virtual:0,0,U008
348-
data B20 = image-virtual:0,0,U008
349-
data RmG15 = image-virtual:0,0,U008
350-
data RmB0 = image-virtual:0,0,U008
351-
data and1 = image-virtual:0,0,U008
352-
data and2 = image-virtual:0,0,U008
353-
data and3 = image-virtual:0,0,U008
354-
355-
# extract R,G,B channels and compute R-G and R-B
356-
node org.khronos.openvx.channel_extract input !CHANNEL_R R # extract R channel
357-
node org.khronos.openvx.channel_extract input !CHANNEL_G G # extract G channel
358-
node org.khronos.openvx.channel_extract input !CHANNEL_B B # extract B channel
359-
node org.khronos.openvx.subtract R G !SATURATE RmG # compute R-G
360-
node org.khronos.openvx.subtract R B !SATURATE RmB # compute R-B
361-
362-
# compute threshold
363-
node org.khronos.openvx.threshold R thr95 R95 # compute R > 95
364-
node org.khronos.openvx.threshold G thr40 G40 # compute G > 40
365-
node org.khronos.openvx.threshold B thr20 B20 # compute B > 20
366-
node org.khronos.openvx.threshold RmG thr15 RmG15 # compute RmG > 15
367-
node org.khronos.openvx.threshold RmB thr0 RmB0 # compute RmB > 0
368-
369-
# aggregate all thresholded values to produce SKIN pixels
370-
node org.khronos.openvx.and R95 G40 and1 # compute R95 & G40
371-
node org.khronos.openvx.and and1 B20 and2 # compute B20 & and1
372-
node org.khronos.openvx.and RmG15 RmB0 and3 # compute RmG15 & RmB0
373-
node org.khronos.openvx.and and2 and3 output # compute and2 & and3 as output
324+
# create input and output images
325+
data input = image:480,360,RGB2
326+
data output = image:480,360,U008
327+
328+
# specify input source for input image and request for displaying input and output images
329+
read input examples/images/face1.jpg
330+
view input inputWindow
331+
view output skintoneWindow
332+
333+
# threshold objects
334+
data thr95 = threshold:BINARY,UINT8:INIT,95 # threshold for computing R > 95
335+
data thr40 = threshold:BINARY,UINT8:INIT,40 # threshold for computing G > 40
336+
data thr20 = threshold:BINARY,UINT8:INIT,20 # threshold for computing B > 20
337+
data thr15 = threshold:BINARY,UINT8:INIT,15 # threshold for computing R-G > 15
338+
data thr0 = threshold:BINARY,UINT8:INIT,0 # threshold for computing R-B > 0
339+
340+
# virtual image objects for intermediate results
341+
data R = image-virtual:0,0,U008
342+
data G = image-virtual:0,0,U008
343+
data B = image-virtual:0,0,U008
344+
data RmG = image-virtual:0,0,U008
345+
data RmB = image-virtual:0,0,U008
346+
data R95 = image-virtual:0,0,U008
347+
data G40 = image-virtual:0,0,U008
348+
data B20 = image-virtual:0,0,U008
349+
data RmG15 = image-virtual:0,0,U008
350+
data RmB0 = image-virtual:0,0,U008
351+
data and1 = image-virtual:0,0,U008
352+
data and2 = image-virtual:0,0,U008
353+
data and3 = image-virtual:0,0,U008
354+
355+
# extract R,G,B channels and compute R-G and R-B
356+
node org.khronos.openvx.channel_extract input !CHANNEL_R R # extract R channel
357+
node org.khronos.openvx.channel_extract input !CHANNEL_G G # extract G channel
358+
node org.khronos.openvx.channel_extract input !CHANNEL_B B # extract B channel
359+
node org.khronos.openvx.subtract R G !SATURATE RmG # compute R-G
360+
node org.khronos.openvx.subtract R B !SATURATE RmB # compute R-B
361+
362+
# compute threshold
363+
node org.khronos.openvx.threshold R thr95 R95 # compute R > 95
364+
node org.khronos.openvx.threshold G thr40 G40 # compute G > 40
365+
node org.khronos.openvx.threshold B thr20 B20 # compute B > 20
366+
node org.khronos.openvx.threshold RmG thr15 RmG15 # compute RmG > 15
367+
node org.khronos.openvx.threshold RmB thr0 RmB0 # compute RmB > 0
368+
369+
# aggregate all thresholded values to produce SKIN pixels
370+
node org.khronos.openvx.and R95 G40 and1 # compute R95 & G40
371+
node org.khronos.openvx.and and1 B20 and2 # compute B20 & and1
372+
node org.khronos.openvx.and RmG15 RmB0 and3 # compute RmG15 & RmB0
373+
node org.khronos.openvx.and and2 and3 output # compute and2 & and3 as output
374+
374375

375376
### Feature Tracker
376377
The feature tracker example demonstrates building an application with two

0 commit comments

Comments
 (0)