Closed CaoGiaHieu-dev closed 5 months ago
Hello @CaoGiaHieu-dev, you can check the official documentation.
You can also check our examples 👍
Hello @CaoGiaHieu-dev, you can check the official documentation.
You can also check our examples 👍
Thanks . But i still cant found any example or doc is tell me how to display AnalysisImage from onImageForAnalysis
In examples, you have a InputImage inputImage
object like here.
You can found a Uint8List
property inside it: inputImage.bytes
, so you can display it like this (for example): Image.memory(Uint8List bytes);
I try to follow your example and display inputImage.bytes but it show this error ════════ Exception caught by image resource service ════════════════════════════ The following _Exception was thrown resolving an image codec: Exception: Invalid image data
When the exception was thrown, this was the stack
If you want to display it you have to use a format jpeg. Or you can convert it before showing it.
If you want to display it you have to use a format jpeg. Or you can convert it before showing it.
Thanks @g-apparence . that all i want . Can you show me an example code . Thank you
I will provide you an example :) Are you on iOS or Android?
I will provide you an example :) Are you on iOS or Android?
im want to show it on android .
It is not as trivial as I though :/ Since the format is not the typical one displayed in a Flutter Image, there is some conversion to do and the best way to do that is to do it on the native side, which involves method channels etc. Can you give use your use case for this? Doing the conversion for each frame in nv21 for analysis and in jpeg for displaying should be quite demanding as well.
im stuck in this issue even i try to call back image from native side like CameraImage of Camera package
I've tried a similar approach but it requires more work and maybe some changes from CamerAwesome for this to work.
Can you explain why you are trying to display the analysis image?
I've tried a similar approach but it requires more work and maybe some changes from CamerAwesome for this to work.
Can you explain why you are trying to display the analysis image?
It more like an ekyc bussiness and i need image of action to verify user.
@apalala-dev Hi . any update on this ?
Hi, not yet sorry. You'll be able to track progress on this in #218.
The idea would be to rework the AnalysisConfig
and AnalysisImage
. The later one could include both an analysis image (e.g.: NV21 for android) AND a jpeg one if necessary to be able to display it.
Some tests need to be done first as it will duplicate the image and treatment for every frame (it might be done every X frames or something like that, not sure yet).
An other option would be to provide a method to convert analysis images (nv21...) to more traditional JPEG. This way, you would have to do it on demand. It might be simpler to implement but less performant.
convert analysis images (nv21...) to more traditional JPEG
i found this https://github.com/google-ar/sceneform-android-sdk/issues/965 and the AwesomeCamera was return the nv21 bytes . Could you look around this?
We almost have the technical part (like what you sent) but we need to figure out a good API to use it. If you really need it fast, you can use the sent code and convert the nv21 image with method channels.
Hi ,I try to display AnalysisImage when listen on onImageForAnalysis . But i can not found any document about this.