iOS cv.imshow() not working

asked 2020-03-03 03:25:03 -0600

philyorkshire gravatar image

updated 2020-03-03 04:49:45 -0600

berak gravatar image

I have a mobile app that I am building in ionic which uses WebRTC to display the rear camera feed on a page. I want to do some very simple OpenCV analysis on the video feed.

It works on Chrome, Safari, and Android but does not work when the project is deployed on to an iOS device. I am using the simplest OpenCV change - changing the feed to grayscale.

On all other devices - camera feed converted to grayscale

iOS/iPhone - canvas is plain black.

Example Project: https://github.com/brandudno/ionic-op...

Specific Files:

HTML -> https://github.com/brandudno/ionic-op...

JS ->https://github.com/brandudno/ionic-opencv-camera/blob/master/src/app/pages/camera/camera.page.ts

to run the project..

clone project, run npm install, ionic cordova add platform ios, ionic cordova run ios --device

ionic - 5.0 openCV - 3.4

edit retag flag offensive close merge delete

Comments

The first thing to do would be to isolate the problem. It is more likely that the problem is in retriving the frame than in viewing it... Your canvas could for exaple need format conversion, so debug what you have in each step - your code doesn't have any cheks for the success of operationd.

mvuori gravatar imagemvuori ( 2020-03-03 07:36:55 -0600 )edit

When I log the video it seems to have the element successfully. What other logging checks would you include to determine the success of reading the video content?

philyorkshire gravatar imagephilyorkshire ( 2020-03-03 10:09:02 -0600 )edit

Any update on this? I seem to have the same issue. even the simplest rectangle to the Mat doesn't show when calling imshow on a canvas

workinfromhome gravatar imageworkinfromhome ( 2020-04-29 20:14:51 -0600 )edit