I want to first take image with opencv and convert VisionWorks(OpenVX) after making some process with Visionworks , output will be OpenCV imshow but when i convert openvx to opencv i take some mistakes could you help me?
void nvx_cv::copyVXMatrixToCVMat(mat_v,edges1);
this void or int functions not working.
Hi,
You can find visionworks sample in /usr/share/visionworks/sources.
Check the sample named as samples/opencv_npp_interop to get some idea about opencv <-> visionworks.
Thanks.
Thank you for requesting. I solved it .
Hi,
There are some information in our document:
[i]> VisionWorks Toolkit Reference Documentation
VisionWorks API
NVIDIA Extension API
OpenCV Interoperability API
convertCVMatTypeToVXImageFormat[/i]
Support image type are:
- NVX_DF_IMAGE_2F32
- NVX_DF_IMAGE_2S16
- NVX_DF_IMAGE_F32
- NVX_DF_IMAGE_RGB16
- VX_DF_IMAGE_RGB
- VX_DF_IMAGE_RGBX
- VX_DF_IMAGE_S16
- VX_DF_IMAGE_S32
- VX_DF_IMAGE_U16
- VX_DF_IMAGE_U8
Thanks
Thank you for contribution.I solved my problem with “nvx_cv::VXImageToCVMatMapper” function. Program gets video frame with OpenCV and returns OpenVX image.After OpenVX operations turns into OpenCV mat type and at last take output image with OpenCV again.
Here is the code:
#include <iostream>
#include "NVX/Application.hpp"
#include "opencv2/opencv.hpp"
#include <NVX/nvx.h>
#include <NVX/nvx_timer.hpp>
#include <NVX/nvx_opencv_interop.hpp>
#include <NVX/Application.hpp>
#include <NVX/ConfigParser.hpp>
#include <OVX/FrameSourceOVX.hpp>
#include <OVX/RenderOVX.hpp>
#include <NVX/SyncTimer.hpp>
#include <OVX/UtilityOVX.hpp>
using namespace cv;
vx_context context = vxCreateContext();
int main(int, char**)
{
VideoCapture cap("/home/ubuntu/VisionWorks-1.6-Samples/data/parking.avi");
if(!cap.isOpened())
return -1;
Mat edges,edges1;
namedWindow("Window",1);
for(;;)
{
Mat frame;
Mat frame2;
cap >> frame;
vx_image v_src = nvx_cv::createVXImageFromCVMat(context,frame);
//
// OpenVX operations...
//
nvx_cv::VXImageToCVMatMapper mapper (v_src,0,NULL,VX_READ_AND_WRITE,VX_MEMORY_TYPE_HOST);
cv::Mat copy_frame = mapper.getMat();
imshow("Window", copy_frame);
if(waitKey(30) >= 0)
{
break;
}
}
}