imageproxy | A caching , resizing image proxy written in Go | Proxy library
kandi X-RAY | imageproxy Summary
kandi X-RAY | imageproxy Summary
imageproxy is a caching image proxy server written in go. It features:. Personally, I use it primarily to dynamically resize images hosted on my own site (read more in this post). But you can also enable request signing and use it as an SSL proxy for remote images, similar to atmos/camo but with additional image adjustment options. I aim to keep imageproxy compatible with the two most recent major go releases. I also keep track of the minimum go version that still works (currently go1.13 with modules enabled), but that might change at any time. You can see the go versions that are tested against in .github/workflows/tests.yml.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of imageproxy
imageproxy Key Features
imageproxy Examples and Code Snippets
Community Discussions
Trending Discussions on imageproxy
QUESTION
I am trying to implement a solution that would be able to capture a picture from the phone's camera, then operate the picture (do something with it) and repeat this process N times, quickly.
I have achieved this using the imageCapture.takePicture
method, but when trying to implement the same process for N pictures, the onCaptureSuccess
method is being called every ~500ms (on a solid Samsung device). The process of capturing and saving the picture lasts too long for me. I need it to be quicker than 500ms.
I was looking to implement it using the imageAnalyzer
class, and used code similar to this:
ANSWER
Answered 2022-Mar-23 at 19:12The default image
format is YUV_420_888 and as your buffer is only one plane (the Luminance(Y) plane ) the buffer is of pixels that are only a single byte
in size.
copyPixelsFromBuffer
assumes that the buffer
is in the same colour space as the bitmap, so as you set the bitmap format to ARGB_8888 then it is looking for 4 bytes per pixel not 1 byte per pixel you are giving it.
I've not used this but this page has a ImageProxy.toBitmap
example to convert a YUV to Bitmap via a Jpeg (if you just wanted a Jpeg you could skip the last step)
I've also seen another method not via Jpeg but to directly change the colorspace of YUV to a bitmap.
You can of course change to the only other colour space ImageAnalysis supports of ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888
which takes longer to be captured because it needs converting and is still not the right format for a Bitmap
QUESTION
I'm using the MLKit library for barcode scanning, so I can get a rectangle where is actually the barcode. But I'm getting a rectangle that is little than the barcode and it's not in the right position. So, the scale and the position of the rectangle are wrong.
Can anyone knows how to fix this problem? Is there any method that could re-scale and re-position the rectangle with the real measures?
Thank you :)
Here is my code:
...ANSWER
Answered 2022-Mar-01 at 10:08You can take a look at ML Kit sample which contains the CameraX scenario or check here to learn more about the coordinate transformation.
QUESTION
The analysis works fine in every other Android phone I've tried (Huawei Mate 20 Pro, Samsung S8, Samsung J7 and Samsung S10+), but not in the Xiaomi Mi a20 Lite. It only enters once the the analyze
function and then in the Logcat throws:
ANSWER
Answered 2021-Nov-16 at 16:20The problem was solved changing the image strategy when building:
QUESTION
I am trying to make a barcode scanner using ML Kit and CameraX. My program would pick up the wrong scan once in a while and I have download several apps using ML Kit from google play and they have the same issue, I tested on other phones too. On the other hand, the ML Kit quick start app I pulled from Github works correctly so it has to be my code. Can anyone help me to find the issue ? I cannot upload img yet you can use online barcode generator (code 128) and create barcode for PAN/230954 my app will read as PAN/2 30954☒. Here is the barcode
MainActivity.java
...ANSWER
Answered 2021-Nov-05 at 17:38I found the issue. I used barcode.getRawValue() which return the raw value. For the barcode I tried to scan the checksum is 29 so the raw value is the barcode text + char with acii code 29. So I used barcode.getDisplayValue() instead
QUESTION
I'm working on an QR scanning application that is based on CameraX. The scanning works as expected on most devices except a few random devices. After debugging this issue for a long time, I found out that the cropped image is kind of shattered on the device in which scanning wasn't working.
Expected output (works on Pixel Device):
Current output (on the devices in which scanning is not working):
The analyze method that receives each frame (part of the CustomImageAnalyzer class)
...ANSWER
Answered 2021-Oct-22 at 03:03some device have rotation special. you can use imageProxy.getImageInfo().getRotationDegrees() to get correct rotation of image. references with (ImageInfo) https://developer.android.com/reference/androidx/camera/core/ImageInfo#getRotationDegrees()
QUESTION
Trying to migrate barcode scanner to Jetpack compose and updating camera and ML Kit dependencies to latest version.
The current shows the camera view correctly, but it is not scanning the barcodes.
The ImageAnalysis
analyzer runs only once.
Code
...ANSWER
Answered 2021-Oct-18 at 15:34Thanks to Adrian's comment.
It worked after the following changes.
In BarcodeAnalyser
- Removed
imageProxy.close()
fromaddOnSuccessListener
andaddOnFailureListener
. Added it toaddOnCompleteListener
. - Added
imageProxy.close()
in else condition as well.
QUESTION
I am trying to use this new feature of CameraX Image Analysis (version 1.1.0-alpha08): using setOutputImageFormat(ImageAnalysis.OUTPUT_IMAGE_FORMAT_RGBA_8888), images sent to the analyzer will have RGBA format.
See this for reference: https://developer.android.com/reference/androidx/camera/core/ImageAnalysis#OUTPUT_IMAGE_FORMAT_RGBA_8888
I need to turn the image sent to the analyzer into a Bitmap so that I can input it to a TensorFlow classifier. Without this new feature I would receive the image in the standard YUV_420_888 format then I would have to use one of the several solutions that can be googled in order to turn YUV_420_888 to RGBA then to Bitmap. Like this: https://blog.minhazav.dev/how-to-convert-yuv-420-sp-android.media.Image-to-Bitmap-or-jpeg/. I assume getting the Media Image directly in RGBA format should help me avoid implementing those painfull solutions (that I have actually tried and do not seem to work very well for me so far).
Problem is I don't know how to turn this RGBA Media Image into a Bitmap. I have noticed that calling mediaImage.getFormat() returns 1 which is not an ImageFormat value but a PixelFormat one, the one logically corresponding to RGBA_8888 format, which is in line with the documentation: "All ImageProxy sent to ImageAnalysis.Analyzer.analyze(ImageProxy) will have format PixelFormat.RGBA_8888".
I have tried this:
...ANSWER
Answered 2021-Sep-16 at 12:26I actually found a solution myself, so I post it here if anyone is interested:
QUESTION
ANSWER
Answered 2021-Aug-19 at 14:17The difficulty that you are having is getting a good mapping from the image in the ImageProxy to what is displayed by the PreviewView. Although this sounds easy, I don't believe there is straightforward way to do this mapping. See the answer to a similar question. I took a look at implementing each of the suggestions in this answer and, although they worked in some situations, they failed in others. Of course, I could have taken the wrong approach.
I have come to the conclusion that extracting and analyzing a bitmap extracted from the preview area and identifying those words that are completely enclosed by the red rectangle is the simplest. I circumscribe those words with their own red rectangle to show that they have been correctly identified.
The following is the reworked activity, a graphic overlay the produces the word boxes and the XML for the display. Comments are in the code. Good luck!
TestPhotoscan.kt
QUESTION
On one of my AWS server I have manually started a detached Docker container running willnorris/imageproxy. With no warning, it seems to go down after a few days, for no apparent (external) reason. I checked the container logs and the syslog and found nothing.
How can I find out what goes wrong (this happens every time)?
This is how I start it:
...ANSWER
Answered 2021-Aug-14 at 15:38As this exit seemed to originate outside of the container/Docker, I needed to find the right logs. A linked-to question (which essentially makes this a dupe) hinted to checking out journald
on unix systems. Doing journald -u docker
(essentially grepping the log for docker) showed that the Docker container was killed on August 6:
QUESTION
I am trying to use CameraX with ZXing library to identify barcodes, I am using ImageAnalyzer to get ImageProxy and feed its byte array to the PlanarYUVLuminanceSource to handle it by ZXing. My target rotation is 0 and the imageProxy that is coming from the camera is 90 degrees, so the barcode is not readable until I rotate it 90 degrees. here is the code:
...ANSWER
Answered 2021-Jul-14 at 09:08byte[] data = ImageUtil.imageToJpegByteArray(imageProxy);
Bitmap bitmap= BitmapFactory.decodeByteArray(data, 0, data.size)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install imageproxy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page