> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/linha-android/iaserver/lamyaiserverclientproxy.md).

# LamyAiServerClientProxy

Encapsulates the associated interface for the AiServer call. See the return value information of each interface 2.2.2.2 AiServerResultCode

```java
/**
* Startup algorithm
*
* @param cameraId Camera Id
* @param arithmeticType Arithmetic type
* @param paramBundle Parameters
* @param aiListener The callback
* @return Execution result
*/
public int startArithmetic(int cameraId, int arithmeticType, Bundle paramBundle,
ILamyAiListener aiListener)
/**
* Stop algorithm
*
* @param cameraId Camera Id
* @param arithmeticType Arithmetic type
* @param aiListener The callback
* @return Execution result
*/
public int stopArithmetic(int cameraId, int arithmeticType, ILamyAiListener
aiListener)
/**
* Suspend Algorithm
*
* @param cameraId cameraId
* @param arithmeticType Arithmetic type
* @return Execution result
*/
public int suspendArithmetic(int cameraId, int arithmeticType)
/**
* Continue executing the algorithm and use it in pairs with {@ link
LamyAiServerClientProxy # suspendArithmetic (int, int)}
*
* @param cameraId cameraId
* @param arithmeticType Arithmetic type
* @return Execution result
*/
public int resumeArithmetic(int cameraId, int arithmeticType)
/**
* Set the scene mode, which is updated by external services and only applies to
the main camera. Set the scene recognition mode
*
* @param mainCameraId cameraId, supports the RBG camera
* @param arithmeticType Algorithm type, currently support face-recognition,
two-dimensional code recognition
* @return Execution result
*/
public int setLamySceneMode(int mainCameraId, int arithmeticType)
/**
* Extract face feature value information in a picture
* Note: This method requires that the size of the incoming image cannot exceed
1920*1920, otherwise it will cause the extraction of feature values to fail
*
* @param imagePath Picture file path
* @param imageBytes Image data in jpg
* @return Face feature data, can be null
*/
public byte[] getFaceFeatureWithRgb(String imagePath, byte[] imageBytes)
/**
*1:1 comparison interface for facial feature values
*
*@ param feature1 feature1
*@ param feature2 feature2
*@ return Compare similarity, normal [0, 100], abnormal<0
*/
public int compareFace1To1(byte[] feature1, byte[] feature2)
/**
* To obtain the detection frame data, note that the returned image data format
is the format in shared memory, which is currently NV21 format.
*
* @param shareMemToken share memory token，{@link
com.lamy.sdk.aiserver.common.AiDetectExternalInfo#mRgbFrameToken}
* @param frameLength Detects frame length , NV21 is width*height*3/2 ，
* {@link
com.lamy.sdk.aiserver.common.AiDetectExternalInfo#mRgbFrameHeight}
* 和 {@link
com.lamy.sdk.aiserver.common.AiDetectExternalInfo#mRgbFrameHeight}
* @param destBytes The target array of stored frame data, the image format is
the actual format in the token, currently NV21 format, the caller maintains, it
is recommended to reuse to avoid memory jitter caused by frequent GC
* @return The result of the operation, true indicates success.
*/
public boolean readDetectFrame(int shareMemToken, int frameLength, byte[]
destBytes) ;
/**
* Crop and encode the image (NV21 format) into jpeg format
*
* @param srcBytes Source image data, NV21 format, RGB and IR recognition frame
data for {@ link com. family. sdk. aiserver. common. AiDetectExternalInfo #
mRgbFrameToken}
* @param imageWidth width of source
* @param imageHeight height of source
* @param left left
* @param top top
* @param right right
* @param bottom bottom
* @return Crop image data to JPEG format
*/
public byte[] cropAndEncodeNV21ToJpeg(byte[] srcBytes, int imageWidth, int
imageHeight, int left, int top, int right, int bottom);
/**
* NV21 format pictures are encoded in JPEG format
*
* @param yuv NV21 format data
* @param width width
* @param height height
* @param quality Picture quality [0, 100]
* @return Jpeg data
*/
public static byte[] nv21CompressToJpeg(byte[] yuv, int width, int height, int
quality);
/**
* Registering intelligent module status monitoring, the message type for V1
version component status callback is regular message, non sticky.
* Attention: The facial recognition function must be monitored. After receiving
the notification, please reload the feature values in the persistent data into
memory. If the notification is not processed, it may lead to facial recognition
failure,
* Please register in the application for facial recognition scenarios,
which must be linked to the process's lifecycle
*
* @param listener listener
* @return Operation results
*/
public boolean registerAiComponentStatusListener(AiComponentStatusListener
listener)
/**
* Unregister intelligent module status monitoring, generally does not require
logging out, and requires monitoring of the entire lifecycle of the process
*
* @param listener listener
* @return Operation result
*/
public boolean unregisterAiComponentStatusListener(AiComponentStatusListener
listener)
/**
2.2.2.2 AiServerResultCode
Return value information.
* Destroy feature value in memory database
*
* @return Operation result, 0 indicates success
*/
public int createMemDb()
/**
* Create a feature value in memory database for use in facial comparison
*
* @return Operation result, 0 indicates success
*/
public int destroyMemDb()
/**
* Insert facial information into memory
* Temporarily closed, please use{@link
LamyAiServerClientProxy#updateFaceInfo(byte[], int)}
*
* @param feature feature
* @param featureId featureId
* @return Operation result, 0 indicates success
*/
private int insertFaceInfo(byte[] feature, int featureId)
/**
* Delete facial information from memory
*
* @param featureId featureId
* @return Operation result, 0 indicates success
*/
public int deleteFaceInfo(int featureId)
/**
* Delete all facial information in memory
*
* @return Operation result, 0 indicates success
*/
public int deleteAllFaceInfo()
/**
* Modifying facial information in memory
*
* @param feature feature
* @param featureId featureId
* @return Operation result, 0 indicates success
*/
public int updateFaceInfo(byte[] feature, int featureId)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://portal-integracao.intelbras.com.br/linha-android/iaserver/lamyaiserverclientproxy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
