4c21321775
Issue https://github.com/google/mediapipe/issues/5017 points to the issue of incorrect bitmap conversion in Android when RGBA or Grayscale images are used. As far as the library allows the creation of ALPHA8 bitmaps, it is not enough to use only `getBitmapFromRgb` and `getBitmapFromRgba`, so the new `getBitmapFromAlpha` method is needed. Otherwise, existing users relying on the 8-bit input but not using the input packet would catch errors despite their code operating as intended. Add correct processing of images with 1, 3, and 4 channels to `FaceDetector`, `FaceLandmarker`, `FaceStylizer`, `GestureRecognizer`, `HandLandmarker`, `HolisticLandmarker`, `ImageClassifier`, `ImageEmbedder`, `ImageSegmenter`, `InteractiveSegmenter`, `ObjectDetector`, and `PoseLandmarker`. If the number of channels is not 1, 3, or 4, throw MediaPipeException with `INVALID_ARGUMENT` status code. Implement methods and functions needed to convert single-channel images to RGBA bitmaps. The native function `AlphaToRGBA` uses `memset` to set all bytes of the resulting buffer to zeros and then copies the alpha values of the input image to the alpha values of the corresponding output pixels. Perform a slight refactoring: use `operator[i]` instead of `*(array + i)` for clarity. |
||
---|---|---|
.. | ||
calculators | ||
docs | ||
examples | ||
framework | ||
gpu | ||
graphs | ||
java/com/google/mediapipe | ||
MediaPipe.tulsiproj | ||
model_maker | ||
models | ||
modules | ||
objc | ||
python | ||
tasks | ||
util | ||
web/graph_runner | ||
__init__.py | ||
BUILD | ||
platforms.bzl |