mirror of
https://github.com/Ascend/ascend-opencv.git
synced 2025-10-07 01:03:49 +08:00
update
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
typedef enum TestDatatype { INT = 1, FLOAT } TestDatatype;
|
using TestDatatype = enum TestDatatype { INT = 1, FLOAT };
|
||||||
|
|
||||||
class CV_EXPORTS Common_Test {
|
class CV_EXPORTS Common_Test {
|
||||||
public:
|
public:
|
||||||
|
@@ -1,18 +1,19 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "acl/acl.h"
|
||||||
|
#include "opencv2/acl/acl.hpp"
|
||||||
#include "opencv2/core.hpp"
|
#include "opencv2/core.hpp"
|
||||||
|
#include "opencv2/highgui.hpp"
|
||||||
#include "opencv2/imgcodecs.hpp"
|
#include "opencv2/imgcodecs.hpp"
|
||||||
#include "opencv2/imgproc.hpp"
|
#include "opencv2/imgproc.hpp"
|
||||||
#include "opencv2/highgui.hpp"
|
|
||||||
#include "opencv2/acl/acl.hpp"
|
|
||||||
#include "acl/acl.h"
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
using namespace cv::acl;
|
using namespace cv::acl;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A simple example of the split and merge functions,Using a different Stream
|
* @brief A simple example of the split and merge functions, Using a different
|
||||||
*
|
* Stream
|
||||||
*/
|
*/
|
||||||
int test_func1(aclCxt *acl_context_0) {
|
int test_func1(aclCxt *acl_context_0) {
|
||||||
Mat src = imread("../cat1.jpg");
|
Mat src = imread("../cat1.jpg");
|
||||||
@@ -53,10 +54,8 @@ int test_func1(aclCxt *acl_context_0) {
|
|||||||
imshow("imgdest", imgdest);
|
imshow("imgdest", imgdest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A demo of use a stream to synchronize multiple functions
|
* @brief A demo of use a stream to synchronize multiple functions
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
int test_func2(aclCxt *acl_context_0) {
|
int test_func2(aclCxt *acl_context_0) {
|
||||||
Mat src = imread("../cat1.jpg");
|
Mat src = imread("../cat1.jpg");
|
||||||
@@ -71,7 +70,6 @@ int test_func2(aclCxt *acl_context_0) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 待split操作数据上传数据到aclMat对象中
|
// 待split操作数据上传数据到aclMat对象中
|
||||||
aclMat acl_src(src, acl_context_0);
|
aclMat acl_src(src, acl_context_0);
|
||||||
aclMat acl_dest1;
|
aclMat acl_dest1;
|
||||||
@@ -110,8 +108,7 @@ int test_func2(aclCxt *acl_context_0) {
|
|||||||
imshow("flip_dest", flip_dest);
|
imshow("flip_dest", flip_dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main() {
|
||||||
{
|
|
||||||
// 初始化
|
// 初始化
|
||||||
aclCxt *acl_context_0 = set_device("../acl.json", 1, 2);
|
aclCxt *acl_context_0 = set_device("../acl.json", 1, 2);
|
||||||
|
|
||||||
@@ -123,4 +120,3 @@ int main()
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user