我创建了一个react-native项目,我想做一些图像处理。我对OpenCV非常熟悉,所以我想在我的项目中使用OpenCV库。
我搜索了节点模块,但我找不到它。
所以,我尝试使用this method likn Android Studio实现库。
1。我有这个项目结构: Project Structure
2. 我从react-native教程
创建Native模块Native Module Project Structure
3。当我跑步时: react-native run-android 我收到这些错误:
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\MainApplication.java:15: error: cannot find symbol
import com.opencvproject2.opencvcamera;
^
symbol: class opencvcamera
location: package com.opencvproject2
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:14: error: package org.opencv.android does not exist
import org.opencv.android.BaseLoaderCallback;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:15: error: package org.opencv.android does not exist
import org.opencv.android.CameraBridgeViewBase;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:16: error: package org.opencv.android does not exist
import org.opencv.android.LoaderCallbackInterface;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:17: error: package org.opencv.android does not exist
import org.opencv.android.OpenCVLoader;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:18: error: package org.opencv.android.CameraBridgeViewBase does not exist
import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:19: error: package org.opencv.android.CameraBridgeViewBase does not exist
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:20: error: package org.opencv.core does not exist
import org.opencv.core.Mat;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:21: error: package org.opencv.highgui does not exist
import org.opencv.highgui.Highgui;
^
C:\CETIC\OpencvProject2\android\app\src\main\java\com\opencvproject2\opencvcamera\OpenCVCameraModule.java:37: error: cannot find symbol
public Mat displayImage(String path){
^
symbol: class Mat
location: class OpenCVCameraModule
所以我的问题是:我是否遗漏了将OpenCV库包含在我的React-Native项目中的内容?