adamgf / react-native-opencv3

react-native-opencv3 wraps functionality from OpenCV Java SDK 3.4.4 + contrib modules and iOS OpenCV 3.4.1 + contrib modules for use in React-Native apps. Please enjoy!
Other
191 stars 64 forks source link

Create a ndarray from Mat object. #25

Closed sdv1812 closed 4 years ago

sdv1812 commented 4 years ago

I want to convert the Mat object returned from RNCv.imageToMat to a ndarray object, as I want to use some functions of the ndarray library.

However, from the Mat object i can see it has only got 3 attributes (matIndex, rows, cols).

Can this object be used to get the image matrix or is there a way to fetch the matrix using the matIndex?

adamgf commented 4 years ago

Hi Sanskar Deepak, Take a look at the Mat javascript opaque object that wraps an OpenCV Mat. Take a look at the methods put and get for manipulating the data.

https://github.com/adamgf/react-native-opencv3/blob/master/mats.js

Hope that helps, Adam

On Tue, Jun 23, 2020 at 9:01 AM Sanskar Deepak notifications@github.com wrote:

I want to convert the Mat object returned from RNCv.imageToMat to a ndarray https://github.com/scijs/ndarray object, as I want to use some functions of the ndarray library.

However, from the Mat object i can see it has only got 3 attributes (matIndex, rows, cols).

Can this object be used to get the image matrix or is there a way to fetch the matrix using the matIndex?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adamgf/react-native-opencv3/issues/25, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6V33WFBAJGEOPNDAGY5LRYDGVZANCNFSM4OFZ4M3Q .

sdv1812 commented 4 years ago

Oh I see. That's what I needed. Thanks for the help!