How to capture image as gray-scale mode using android camerax - java

Working on an app using Camera-X and I want to capture images in grayscale mode before saving the image,
I checked out this but no solution, what is the best way to go about this.

Related

How to show images fast? I'm using Picasso but it is so slow. Can I show images fast like the Instagram app?

I just want new method for fast image upload. Can you tell us the best way for you to know? I want the images to be loaded at the same time as xml. :)
Well, image loading and rendering is time & resource consuming process. Rendering image and then displaying faster can depend on multiple factors :
Image resolution
Image size
Network strength
Android device
Algorithm used by Library for rendering
Hence, you should consider above mentioned points for image rendering on Android device.
Moreover, if you are unsatisfied with Picasso library you can try Glide
It is one of the most efficient libraries available in the market today.
Or you can also use Fresco
In addition to using these libraries, you can also improve your codebase for image loading by following below mentioned points:
Save images or image urls to your local cache directory and avoid making API call each time for loading an image. You should only make API call if imageurl has been modified in the API response.
Show proper placeholder image in case of error in image loading/rendering.
Show proper default placeholder image when image is unavailable/missing.
Use proper images resolutions. Like if you have to show a thumbnail image, then you should show thumbnail image and not full resolution image. Multiple resolutions for an image can be can be thumb, low, normal, high and they should have separate urls.
Use compressed images.
Blur thumbnail image before loading actual image.
Glide is very good about it. However, because the event shows shape according to the size and intensity of the photo, it will be healthier for you to optimize it on the backend side.
You can read about it here: Glide Vs Picasso

Can opencv be used for Image recognition?

I need to access images from phone's gallery and then perform image recognition like what all elements are there in the images(watch,food etc etc). Can this be done using opencv library's on device sdk for android. I am not getting any clue about this.

Camera resolution openCV

I'am currently working on an Android application and I need to be able to :
Find square on a preview Camera. that part is working.
The problem that I have is, in order to be able to find these square on the Camera preview, I need to change my Camera resolution to 800x600 in order to have something smooth.
What I want is : As soon as I hit my button I want to capture the image in a specific resolution (1920x1080 for example). So basically the preview have to be in 800x600 but the capture have to be in 1920x1080.
I'am using openCV to process my camera view on live.

Capture Android screenshot without having the View

I have found a lot of examples like this:
how to Capture screen in android and covert it to image
I need to capture an screenshot of screen activity, but I'm developing an external library, so I can't get current activity of the application to get the View and then flush the bitmap into canvas. Is there another way to capture a screenshot?
If you are trying to save the image from Snapchat, you need to save the Bitmap in another way.
With a rooted phone you can access the apps storage and copy the image while the app shows it.
That way the app wont notice you took a "Screenshot" :)

How do you auto-rotate a captured image using Phonegap?

I'm working on an example I got from Phonegap on capturing Images using the built in device camera. If I rotate the device, the saved image stays in that orientation.
I know in javascript, I can manipulate images-- and Phonegap has a G-Calibration sensor api I can use.... but Is there a straight forward way through Phonegap to auto-detect orientation?
the problem is that the exif data (which contains the orientation among other things) is not passed by the plugin.
For this reason you need to try to understand which "way" the picture was taken.
Worst case, allow the user to rotate it.

Categories

Resources