face-landmarking-ios icon indicating copy to clipboard operation
face-landmarking-ios copied to clipboard

Problems with image size 1080x1920

Open PPPiotr opened this issue 7 years ago • 7 comments

There is a strange problem with this lib when working on images with resolution 1080x1920 (WIDTHxHEIGHT). It produces artefacts like this: img_0191 Not only drawing is corrupted but also points positions.

To reproduce this bug You only need to add this:

if let connection = output.connectionWithMediaType(AVMediaTypeVideo) {
    if connection.supportsVideoOrientation {
        connection.videoOrientation = .Portrait
    }
}
session.sessionPreset = AVCaptureSessionPreset1920x1080

Just before session.commitConfiguration() in func openSession(). Not every device will be able work in this resolution in front camera, so changing to back camera might help.

Smaller images with resolution 720x1280 and 1280x720 works fine (I did not check smaller images than 720x1280). Even 2160x3840 and 3840x2160 works fine, so there is something wrong only with resolution 1080x1920. On other hand resolution 1920x1080 works correctly but it is for landscape and I need portrait orientation. So for now I'm using: session.sessionPreset = AVCaptureSessionPreset1280x720

Do You know what could be wrong?

PPPiotr avatar Feb 01 '17 12:02 PPPiotr

Same issue with me also .... have you solved this problem?

Miths19 avatar May 22 '17 05:05 Miths19

No, I'm using smaller resolution instead.

PPPiotr avatar May 22 '17 08:05 PPPiotr

Same issue...could be an AVFoundation issue?

alberto093 avatar Jun 23 '17 20:06 alberto093

not perfect point find face ...

ramanihiteshc avatar Oct 02 '17 07:10 ramanihiteshc

Has anyone figured out why this issue arises yet? It's affecting me as well

AlexFWulff avatar May 14 '18 05:05 AlexFWulff

Any solution, guys?

ghost avatar Jun 26 '18 11:06 ghost

DlibWrapper.mm L57 size_t width = CVPixelBufferGetBytesPerRow(imageBuffer)/4; same as below size_t width = 1088;

worked on ipad pro front camera. (1080x1920)

niimi avatar Sep 28 '18 15:09 niimi