Creating custom image filter for flutter application - flutter

I kind of reverse engineered an image filter. Actually it was just a pixel by pixel operation so I applied it over different images and by comparing each pixel of original image and filtered image (using PIL) I now know what RGB value from original image became what RGB in the filtered image. For example like RGB(0,0,1) became RGB(2,3,81) (suppose) etc and I know this for all 16,777,216 colors.
If what I did is correct then my question is how can I create a filter out of this data that can be used in flutter apps. One option is to use conditional statements but that's just theoretical as I'll have to manually write 16,777,216 statements just for this one filter. So is there any software or program or code or anything else that I can use to create a filter out of this data that can be used in flutter apps. This is important because ultimately I want to use this filter in my flutter app.
Any help would be much appreciated.
Thank you very much.

Related

Feed multiple images to CoreML image classification model (swift)

I know how to use the CoreML library to train a model and use it. However, I was wondering if it's possible to feed the model more than one image in order for it to identify it with better accuracy.
The reason for this is because i'm a trying to build an app that classifies histological slides, however, many of them look quite similar, so I thought maybe I could feed the model images at different magnifications in order to make the identification. Is it possible?
Thank you,
Mehdi
Yes, this is a common technique. You can give Core ML the images at different scales or use different crops from the same larger image.
A typical approach is to take 4 corner crops and 1 center crop, and also horizontally flip these, so you have 10 images total. Then feed these to Core ML as a batch. (Maybe in your case it makes sense to also vertically flip the crops.)
To get the final prediction, take the average of the predicted probabilities for all images.
Note that in order to use images at different sizes, the model must be configured to support "size flexibility". And it must also be trained on images of different sizes to get good results.

Load PDF Image into MATLAB

I have a PDF of building schematics. I would like to load it into MATLAB, and visualize the image via a GUI, so I can measure distances and such for some calculations.
I have no idea if this is even possible?
Furthermore, the PDF has an embedded scale (i.e. 1 cm = 1 meter). If I can extract this as well, that would be awesome.
I found extractFileText which can be used to extract text, but not much else.
I found the easiest way to do this was to convert the pdf to a image, for example using imagemagick. See this question
If you add an example of the image someone might be able to suggest some ideas for extracting the scale information using image processing.

How to get region of interest in images

I need to train R-CNN on my dataset. Above Image is an example in which first column contain path to that image and second column contain coordinates of bounded box(ROI). How to get those coordinates in matlab. As my dataset is large so how those coordinates can be extracted by pointing manually.
for example if i am training R-CNN foe stop signs then second column contain coordinates of bounded box containing stop sign in whole image.
I do not know which version of MATLAB you are running, but I'm assuming it is fairly new (R2017a and later). Also, by 'how to get the coordinates', I assume you mean 'how to determine' or 'how to assign' the coordinates.
I believe what you need to do is to use one of the image labeling Apps called
imageLabeler
to annotate rectangles in your training images. You either do this manually if that's amenable, or you need to use automation algorithms if you already have a detector that does something similar. See this page for more details:
https://www.mathworks.com/help/vision/ug/create-and-import-an-automation-algorithm-for-ground-truth-labeling.html
Once you have the results of labeling stored in a groundTruth object, you would need to use something like objectDetectorTrainingData to create the table you are looking for.
See https://www.mathworks.com/help/vision/ug/train-an-object-detector-from-ground-truth-data.html for more details.

How does one embed a file inside of an image? iOS iPhone

There is an app on the app store called active photo (http://itunes.apple.com/us/app/active-photo/id366798464?mt=8) that allows you to embed a hidden image or .exe file inside of an image. I would like to know how to do this regrading adding images to images, kinda like sub images in the original image.
I've been looking into metadata but no tag seems to be big enough to hold an NSData representation of the second picture.
How would one go about adding any type of file to an image, either through embedding or metadata, that would allow the image to be sent though email and or text message and still retain the data?
Thank you.
This is known as steganography.
I would imagine the simplest way of hiding a file inside a JPEG image is just to alter its pixel data in such a way that the compression doesn't damage it but is subtle enough that an interceptor can't detect the hidden data.
I don't think it is possible with JPEG because it's a lossy compression so you would end up corrupting the embedded file. But PNG uses a compression method similar to Deflate, which is loseless.
I have started writing a program like this. The idea was to hide bytes of data by splitting them into the least significant bits of pixels' color channels. Let me do some examples.
An RGB-8 image represents a pixel with 3 bytes, one for red, one for green and one for blue. I store 3 bits into red channel, two into green (human eye is more sensitive to green color) and 3 into blue. So I embed one byte per pixel. Similarly with RGBA-8 image I do 2-2-2-2. This of course involves some bitwise operations.
Things become more interesting with RGB(A)-16 images, where there are two bytes per channel. I use the entire least significant byte of every channel with minimal distortion (worst case 255 / 65535 = ~3.9%) and store up to 3 or 4 bytes of data per pixel. Not bad!!
Moreover there are no complex bitwise operations in this case, a single assignement does the job.
There are lot of improvement to it. I thought to ask the user a password, hash it and seed a secure pseudo random number generator, then no longer move pixel by pixel but instead asking the generator for a new random index.
The drawback of this solution is that the more data has already been embedded, the slower it becomes, because the generator will give more and more occupied indices. But it is much more secure in this way. To make it even more safer I thought to introduce noise data in the untouched pixels, in order to hide the positions of the true data.
As you can see you can do a lot with PNG images! If you are interested I can give the code I wrote so far.

Object detection in matlab

I want to write a code in matlab in which i would like to detect color objects in a given image and return the result as found the custom image or not found. i have an image of the custom object separately. im new to matlab... can anyone tell me how to proceed...
i have a pre defined image of an object say an lcd tv.... a given image which may or may not contain the object in it. i need a method to chek and find if the pre defined image is present or not in the given image... is it possible in matlab?
The I suggest you start researching. Stack Overflow is not a great place to ask such generalized questions.
1) Anything that you can do in any programming language is possible in matlab, you are limited by three things:
a) How fast do you want it to work
b) how much coding do you want to do
c) how much of your memory is matlab going to eatup
2) If I am understanding your question correctly you are: Looking to match an image that is fit inside a larger image
Solution: shift your image across the other image, calulate the difference between all the pixels. The set of pixels that is closest to your desired image should be zero.