Technical Issues

Updated at:

Common technical issues and solutions for the Queen SDK.

Contents

How does the SDK perform?

The Queen SDK has undergone years of iteration to deliver industry-leading performance, visual quality, and efficiency. Optimizations specifically target low-end devices and older system versions, particularly in Southeast Asia. The SDK offers multiple versions for the same feature. For example, the retouching module provides advanced, power-saving, and intelligent adjustment modes to suit different scenarios. Each version includes multi-dimensional performance test reports as part of the daily iteration process, extensively validated by internal and external customers.

How to resolve the black screen issue?

Cause: Typically caused by incorrect texture IDs or texture generation errors. A black screen can also occur when the returned texture ID is used improperly or an invalid texture ID is passed to the business layer for rendering.

Solution: The Queen SDK rendering layer is based on OpenGL. Verify that the texture ID passed to the Queen SDK interface renders correctly. The Queen SDK guarantees correct output texture display and returns the original texture even if no effects are applied, the parameters are incorrect, or authorization is missing.

After you integrate the Queen SDK, the screen flashes a solid color, the screen color changes when you move your phone, but no image appears?

Conditions: This occurs when the toScreen constructor parameter is set to true, the input texture is an OES texture, and render() is called without parameters.

Solution: Change render() to renderTexture(matrix). If the input texture is an OES texture, you must use renderTexture. The matrix parameter must be retrieved from surfaceTexture.

Why does the application crash after startup?

Check whether the textureId in engine.setInputTexture is correct. If the ID is correct, try restarting the application to resolve any transient issues.

Why are facial landmarks not detected when using sticker/retouching features after the face image rotates 90 degrees to landscape?

Conditions: This occurs when the toScreen constructor parameter is set to true, the input texture is an OES texture, render() is called without parameters, and the algorithm uses a frame-grabbing solution instead of a byte buffer solution.

Solution: Use the byte buffer solution. Facial landmarks will be detected, but the image may be incorrectly stretched or compressed because of width and height issues.

Why are basic retouching features effective, but advanced retouching/makeup/sticker features ineffective?

If basic retouching works, the Queen-engine initialization, parameter settings, and rendering flow are correct. Advanced retouching is usually ineffective because incorrect parameter settings prevent facial landmark detection, causing all landmark-dependent effects to fail. Common causes include the following scenarios:

  • Incorrect width and height parameters for the texture input. In the setInputTexture(int texture, int width, int height, boolean isOES) interface, the width/height parameters must match the display dimensions of the texture and be consistent with the texture parameter. The fourth parameter, isOES, determines whether the texture is an oes texture, which is specific to Android. This setting determines whether the Queen-engine needs to perform a texture display transform, which requires the correct matrix from the current camera capture to be passed to the renderer. The specified width and height directly determine the aspect ratio of the rendered image and can affect the scaling ratio of advanced features during rendering. A common symptom is that the advanced feature is active but the image appears stretched and distorted.

  • Incorrect width and height parameters for input data. In the updateInputDataAndRunAlg(byte[] imageData, int format, int width, int height, int stride, int inputAngle, int outAngle, int flipAxis, boolean reuseData) API, the width/height parameters specify the actual dimensions of the input `imageData`. These values may match the original image dimensions or be swapped. For example, buffers obtained directly from an Android camera are often rotated by 90 degrees, which swaps the width and height. Correct width and height values are required for face detection, which in turn affects the availability of advanced features.

  • Incorrect input angle, output angle, or flip-axis rotation parameters. In the updateInputDataAndRunAlg(byte[] imageData, int format, int width, int height, int stride, int inputAngle, int outAngle, int flipAxis, boolean reuseData) interface or the frame synchronization interface updateInputTextureBufferAndRunAlg(int inputAngle, int outAngle, int flipAxis, boolean usePreviousFrame), the inputAngle/outAngle/flipAxis parameters are essential for advanced facial recognition features. inputAngle specifies the rotation in degrees applied to the input data or texture. outAngle specifies the rotation in degrees applied to the detection results before display. flipAxis is an enumeration value defined in the Queen engine that specifies whether and along which axis (X or Y) the final rendered image is flipped. These parameters depend on the current camera angle and whether the front or rear camera is used. For convenience, they are encapsulated in the QueenCameraHelper.java utility class, which you can use to directly apply or adjust the values.