Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with image size 1080x1920 #17

Open
PPPiotr opened this issue Feb 1, 2017 · 7 comments
Open

Problems with image size 1080x1920 #17

PPPiotr opened this issue Feb 1, 2017 · 7 comments

Comments

@PPPiotr
Copy link

PPPiotr commented Feb 1, 2017

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?

@Miths19
Copy link

Miths19 commented May 22, 2017

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

@PPPiotr
Copy link
Author

PPPiotr commented May 22, 2017

No, I'm using smaller resolution instead.

@alberto093
Copy link

Same issue...could be an AVFoundation issue?

@ramanihiteshc
Copy link

not perfect point find face ...

@AlexFWulff
Copy link

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

@ghost
Copy link

ghost commented Jun 26, 2018

Any solution, guys?

@niimi
Copy link

niimi commented Sep 28, 2018

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

worked on ipad pro front camera. (1080x1920)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants