Is it possible to compare 2 images on React Native? - reactjs

I'm trying to compare 2 images on React Native to get differences of them.
Example;
The second image is different 7% from the 1st photo.
Or
There are 200 different pixels.
I've installed pixelmatch and converted images to base64 and buffer. Unfortunately I couldn't get any response as i expect. Finally I would like to ask you if it is possible.

Related

Scanning through camera against a bank of 10 images

I building an app that can use an iPad camera to scan for particular images. There will be a bank of 10 images that will be matched against, and when there is a match on one I need to navigate the app to a specific screen.
I guess you can compare this to a QR scanner, but without QR codes.
Example of one of the images to scan is:
https://imgur.com/a/lhWv8ny
Trouble is, I'm struggling to come up with a solution to scan the images. The other parts, no issue.
I've tried pattern markers with a-frame, I've done a load of research but can't find anything concrete at the moment.
Any direction will greatly be appreciated.
Maybe try to import some machine-learning library and if it's text only extract the text and match it to a dictionary:
https://github.com/zsajjad/react-native-text-detector
Or you could match for similar images with opencv:
Checking images for similarity with OpenCV
https://github.com/brainhubeu/react-native-opencv-tutorial

how to re-use single array of images to different activities?

I am Making an android application in that,
I have bunch of images, around 28 images actually, and I want to use those same images in different form in 3 different activities.
How am I suppose to do it? so that I do not have to load same images from drawables to those 3 different activities.
Should I make an array.xml file ? and reference it. or
Should I make an array class and then reference it ?
Thank You.

URLImages in list renderer disappearing on iOS

I have a custom list renderer that has a logo for a business in it. It has a label Logo_URLImage that has the placeholder image. In my code I get the data and assign HashMaps to the list model, h.put("Logo_URLImage",imageURL); where imageURL is a string that has the absolute URL to the image.
On Android it seems to always work, but most of the testing has been on iOS devices. What happens is that images are updated as you'd expect the first time or two that you run it. A run later on will show blank images (flash the place holder image and then blank) and once that happens images will never come back.
Any thoughts on what might be causing this?
Check that you defined the LogoName map entry. Check that it is unique per image?
Check that it doesn't include special characters that might cause an issue.

How to download images from array to tableviewcontroller in swift?

I have a table view controller with a cell that contains an UIImageView. I also have a NSMutableArray that contains the url's. I want the url's to download the images and place them in the correct order. The NSMutableArray also contains some empty Strings and the cell that it corresponds too I want to have my placeholder image from my image assets.
How can I get it to work? I have also populated each cell with a title and summary but cannot workout how images work.
UPDATE
The code used for the image download. Note the photoLabels contains the array of images. Some of the photos are in the incorrect place once the first placeholder image occurs (It is one index late). Why is it doing that. Does anyone know why. I have println(photoLabels) and all the 50 strings are correct (with some just being "")
If anyone can help that would be great.
let imageURL: String = photoLabels.objectAtIndex(indexPath.row) as String
println(imageURL)
if imageURL == "" {
cell.imageContainer.image = UIImage(named: "placeholder")
} else {
cell.imageContainer.setImageWithURL(NSURL(string: imageURL))
}
return cell
Thanks
This seemingly innocent question actually entails a rat's nest of interesting details. These include:
Use lazy loading of the image, loading them just-in-time, rather than trying to download them up front;
Download the images asynchronously;
While downloading the images as needed, cache them (using NSCache, not NSMutableArray) so that if you scroll back to see some images recently downloaded that you don't have to download them again;
But, in response to memory pressure, make sure to empty the RAM-based cache (but still avail yourself of the persistent storage cache);
If user scrolls quickly down to the 100th row in the table example, make sure that the images for the visible cells don't get backlogged behind the requests for the previous 99 images (nb: you should test your app in suboptimal conditions, e.g. a poor 2G or 3G cellular environment, which can be simulated with the network link conditioner); and
You might want a placeholder image to show until the asynchronously retrieved image is downloaded (or retrieved from the cache).
The bottom line is that this takes a non-trivial amount of effort to do properly. As a result, I'd encourage you to use an existing solution, for example the UIImageView categories that are available from SDWebImage or AFNetworking. Both of these two frameworks offer a nice category for UIImageView that allows you to request the image to be downloaded asynchronously (it's sd_setImageWithURL in SDWebImage; it's setImageWithURL in AFNetworking).

Cuting borders of an image using GAE

So I'm wondering if there is a way to do the following:
1. Upload an image
2. Remove the 20 pixel lower border the image has
3. Save the image
Well, I can already do the easy steps (1 and 3) but I have no Idea how to do the third one. I was thinking maby using a Transform but Im not sure how to.
You need to use the crop() method.
Your steps are:
Upload the image
Get the image size
Call crop()
Save the data

Resources