react-native-opencv-tutorial icon indicating copy to clipboard operation
react-native-opencv-tutorial copied to clipboard

Use of undeclared identifier 'CV_BGR2GRAY' in RNOpenCvLibrary.mm

Open hayr-hotoca opened this issue 3 years ago • 4 comments

I just grab the code and run but this issue appears.

Any help is really appreciated.

Xcode Version 10.3 (10G8) opencv2.framework 4.5.1 downloaded form https://opencv.org/releases/

hayr-hotoca avatar Mar 19 '21 10:03 hayr-hotoca

I think OpenCV have deprecated the constant names,

Change “CV_BGR2GRAY” to “cv::COLOR_BGRA2GRAY”

aidenmurphy89 avatar Mar 28 '21 16:03 aidenmurphy89

That works.

Another thing i want to ask is could I use other opencv features in react native with this code base or do i need to make more code in Xcode to bridge those features?

Thanks alot!

hayr-hotoca avatar Apr 02 '21 04:04 hayr-hotoca

Hi, I am not fully sure what you mean. I was trying to use extra features such as the qr code scanner and the wraps for images. However, I was unsuccessful as i was not familiar with Objective C and found the process very difficult. I have since moved to try to complete my project in Swift and have had more success, using the a bridging file in Objective C, to a pure C++ file where i can write the openCV code.

aidenmurphy89 avatar Apr 06 '21 19:04 aidenmurphy89

I think OpenCV have deprecated the constant names,

Change “CV_BGR2GRAY” to “cv::COLOR_BGRA2GRAY”

awesome that's work

mostasim avatar Aug 24 '21 15:08 mostasim