-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Problems to detect face in mode portrait using opencv Android sdk #5058
Copy link
Copy link
Closed
Labels
affected: 2.4EOL - not supported anymoreEOL - not supported anymoreauto-transferredbugplatform: androidpriority: normal
Description
Transferred from http://code.opencv.org/issues/4463
|| Fabian Hoyos on 2015-07-03 21:49
|| Priority: Normal
|| Affected: 2.4.9 (latest release)
|| Category: None
|| Tracker: Bug
|| Difficulty: Medium
|| PR:
|| Platform: ARM / Android
Problems to detect face in mode portrait using opencv Android sdk
I am working in detect faces using the opencv Android SDK 2.4.11. The application shows the video preview in portrait mode, I modified the opencv Android SDK to adapt to the video preview in a portrait mode, this change was done in the onCameraFrame method and It consists in rotate 90 degree the inputFrame.rgba()
public void onCameraViewStarted(int width, int height) {
//mGray = new Mat();
// mRgba = new Mat();
mRgba = new Mat(height, width, CvType.CV_8UC4);
mRgbaF = new Mat(height, width, CvType.CV_8UC4);
mRgbaT = new Mat(width, width, CvType.CV_8UC4);
}
public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
mRgba = inputFrame.rgba();
mGray = inputFrame.gray();
//rotate 90 degree
Core.transpose(mRgba, mRgbaT);
Imgproc.resize(mRgbaT, mRgbaF, mRgbaF.size(), 0, 0, 0);
Core.flip(mRgbaF, mRgba,1);
}
The video preview adapts to the phone orientation. But the face detection only works in right landscape orientation. Also I look at the stored pictures and they aren't rotated to portrait, no matter the phone rotation.
History
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affected: 2.4EOL - not supported anymoreEOL - not supported anymoreauto-transferredbugplatform: androidpriority: normal