Process Video Frame By Frame In Opencv On Android
My goal is as follows: I have to read in a video that is stored on the sd card, process it frame for frame and then store it in a new file on the SD card again. The problem is that
Solution 1:
@Alekz: Yes, I found a solution. Even if it is additional overhead, it was sufficient for my research project.
The solution covers the usage of OpenCV 4 Android and JavaCV. I first use JavaCV to read in a frame one by another. Afterwards, I convert this frame to the format used by OpenCV, process the frame. Finally, I either display the processed frame directly on the screen or I convert it back to JavaCV and store it in a new file. Below you find the detailed solution for the different used frame formats.
- Grab three channel IplImage frame from video with the FrameGrabber
- Convert grabbed three channel frame to four channel IplImage frame
- Convert four channel frame to Android Bitmap image
- Convert Android Bitmap image to OpenCV Mat frame
- Process OpenCV Mat frame
- Convert Processed Mat frame to Android Bitmap image
- Convert Android Bitmap image to four channel IplImage frame
- Convert four channel IplImage frame to three channel IplImage
- Store three channel IplImage as frame in the video with the FrameRecorder
Post a Comment for "Process Video Frame By Frame In Opencv On Android"