title: Integrate Python OpenCV with React Native/Android/iOS
body: <p>I have an app built on React Native whose core functionality is to capture some images, analyse and process the images and return some results. As of now the image analysis was done in the server side using python and opencv. Only the results and the resultant images were returned. Now as per the requirement by the clients, due to privacy concerns, they want the image processing to be done on the mobile app itself. (As the images are medical related and they don't want the images to be sent to the server)</p>
  
  <p>So, my question is, if there is a way I can use my existing python with opencv code and integrate it directly into react-native/android/ios? </p>
  
  <p>Right now what I am doing is using the library <a href="https://github.com/adamgf/react-native-opencv3" rel="noreferrer">react-native-opencv3</a> , <a href="https://github.com/nicolaspanel/numjs" rel="noreferrer">numjs</a>, etc to re-write the algorithm in react-native as I feel comfortable using javascript (I have no experience in swift). However not all opencv, numpy functions are supported by these libraries and it is consuming all the time to re-write the code. </p>
  
  <p>I found about using <a href="https://www.jython.org/" rel="noreferrer">jython</a>, <a href="https://github.com/kivy/python-for-android" rel="noreferrer">python-for-android</a> and <a href="https://www.tensorflow.org/swift/tutorials/python_interoperability" rel="noreferrer">swift-python-interoperability</a>
  Can I use these to directly integrate python opencv code into my current application? If yes, it would be great if someone can help me with some small example or guidelines as I cannot find anything.  </p>
  
  <p>Other method that I considered was:</p>
  
  <p>Re-write the algorithm using native code and opencv-android and opencv-ios sdks and create the react-native bridge to call the algorithm. (I am guessing it will take a lot of time as I have to write in 2 different languages. Time that I don't have)</p>