processor.addPacketCallback(
"pose_landmarks",
(packet) -> {
Log.v(TAG, "Received Pose landmarks packet.");
try {
System.out.println(packet);
byte[] landmarksRaw = PacketGetter.getProtoBytes(packet);
//byte[]转bitmap
YuvImage image = new YuvImage(landmarksRaw, ImageFormat.NV21, image_width, image_height, null);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
image.compressToJpeg(new Rect(0, 0, image_width,image_height), 80, stream);
Bitmap bmp = BitmapFactory.decodeByteArray(stream.toByteArray(), 0, stream.size());
//因为图片会放生旋转,因此要对图片进行旋转到和手机在一个方向上
Bitmap bmp1 = rotateMyBitmap(bmp);
Bitmap bmp2 = turnCurrentLayer(bmp1, -1, 1);
FileUtils.savePaiZhaoBitmap(bmp2,landmarksRaw);