int main( int argc, char * argv[] )
{
const char * video_sequence = argv[1];
CGuiModule gui( video_sequence );
if( !gui.Grab() )
{
printf( "ERROR: input has no video\n" );
return 1;
}
vx_uint32 width = gui.GetWidth(); // image width
vx_uint32 height = gui.GetHeight(); // image height
vx_context context = vxCreateContext();
vx_graph graph = vxCreateGraph(context);
ERROR_CHECK_OBJECT( context );
ERROR_CHECK_OBJECT( graph );
vxRegisterLogCallback( context, log_callback, vx_false_e );
vxAddLogEntry( ( vx_reference ) context, VX_FAILURE, "Hello there!\n" );
vx_image images[] = {
vxCreateImage(context, width, height,VX_DF_IMAGE_UYVY),
vxCreateImage(context, width, height,VX_DF_IMAGE_U8),
vxCreateImage(context, width, height,VX_DF_IMAGE_U8),
};
for( vx_size i = 0; i < sizeof( images ) / sizeof( images[0] ); i++ )
{
ERROR_CHECK_OBJECT( images[i] );
}
//The code to create virtual images that connect nodes
vx_image virts[] = {
vxCreateVirtualImage(graph, width, height,VX_DF_IMAGE_VIRT),
vxCreateVirtualImage(graph, width, height,VX_DF_IMAGE_VIRT),
vxCreateVirtualImage(graph, width, height,VX_DF_IMAGE_VIRT),
vxCreateVirtualImage(graph, width, height,VX_DF_IMAGE_VIRT)
};
for( vx_size i = 0; i < sizeof( virts ) / sizeof( virts[0] ); i++ )
{
ERROR_CHECK_OBJECT( virts[i] );
}
vx_node channelExtract_node = vxChannelExtractNode(graph, images[0],VX_CHANNEL_Y, virts[0]);
vx_node Gaussian3x3_node = vxGaussian3x3Node(graph, virts[0], virts[1]) ;
vx_node Sobel3x3_node = vxSobel3x3Node (graph, virts[1], virts[2], virts[3]);
vx_node Magnitude_node = vxMagnitudeNode(graph, virts[2], virts[3], images[1]);
vx_node Phase_node = vxPhaseNode (graph, virts[2], virts[3], images[2]);
ERROR_CHECK_OBJECT( channelExtract_node );
ERROR_CHECK_OBJECT( Gaussian3x3_node );
ERROR_CHECK_OBJECT( Sobel3x3_node );
ERROR_CHECK_OBJECT( Magnitude_node );
ERROR_CHECK_OBJECT( Phase_node );
ERROR_CHECK_STATUS( vxReleaseNode( &channelExtract_node ) );
ERROR_CHECK_STATUS( vxReleaseNode( &Gaussian3x3_node ) );
ERROR_CHECK_STATUS( vxReleaseNode( &Sobel3x3_node ) );
ERROR_CHECK_STATUS( vxReleaseNode( &Magnitude_node ) );
ERROR_CHECK_STATUS( vxReleaseNode( &Phase_node ) );
//Verify the graph
ERROR_CHECK_STATUS( vxVerifyGraph (graph));
it am trying a sample code, but i get this error…
**ERROR**
**OK: FILE ../../tutorial_videos/PETS09-S1-L1-View001.avi 768x480**
**LOG: [ status = -1 ] Hello there!**
**LOG: [ status = -14 ] ERROR: agoVerifyGraph: kernel org.khronos.openvx.magnitude: invalid format for argument#2**
**ERROR: failed with status = (-14) at /home/openvx/openvx_tutorial/tutorial_exercises/Acsia/Acsia.cpp#97**