My aim is to let the user take a selfie from my app and then apply different image processing algorithms to convert it in a cartoon type image. I followed the algo written here, and then also used the method written just below the chosen answer to convert black and white sketch to colored image that should look like cartoon. Every thing is ok except that after applying Gaussian Blur , the image becomes too hazy and unclear. Here is the image output:
Any advice how I can make it more clear? Like shown in this link. I know they used Photoshop , but I want to achieve it with Java and Android.
PS: I found all the image processing methods from here. Plus the method mentioned here (the one below the chosen answer), what could be the ideal values in the arguments?
cartoonifying image
If you have a basic knowledge of C++, you can port this app for your need.
This application works real time. If you want to non-real time,than you can use bilateral filter against two medianBlurs at the bottom of function. That will give better results, but bad performance. But you need to use OpenCV in your application. If you want to make application with more functions, I will suggest you to do it.
Related
I have used Java language for beginners is used with object type calling so there's an app or software called processing that I used that's a bit easy at making programs... (https://processing.org/)
What could be the best shortest example to make a animated GIF using shapes/ images?
What way could be the best way to make a GIF animated in regular Java without using processing software?
What could be the easiest examples for a beginner to do an animated GIF?
Stack Overflow isn't really designed for general "how do I do this" type questions. It's for specific "I tried X, expected Y, but got Z instead" type questions. But I'll try to help in a general sense:
You need to break your problem down into smaller steps and then take those steps on one at a time. Can you create a simple animation? Something simple like a circle moving around the screen. Separately from that, can you export a single .png image from a sketch? Again, just something simple. Work your way forward in small steps: can you then export each frame of a simple animation as a .png file?
Then when you have those .png files, you can use something like Image Magick to convert them into an animated gif file.
The Processing reference is your best friend for questions like this. The save() and saveFrame() functions could come in handy for exporting an animation as a gif.
Please try something, and if you get stuck, post a MCVE along with a more specific technical question in a new post. Good luck.
I see a lot of people just reading it... Maybe you need some extra info? Comment below and I'll give it!
As my previous questions were saying, I'm building a car that will orientate in the room based on an image that you would have taken with your phone. For that i would need an image that would represent the room. Since you cant take picture directly from the top of the room (unless you are a bird), I would need to transform it to a "perpendicular" image. It would be weird if you would have to do it manually so I decided to do it automatically. Now that is something harder :) Well I asked for transforming image in this thread and got that marked comment that solved part of my program. I'm still looking for a way to automate that. Since i need the image to be the same size as it would be in real life (we can take 1 pixel as 1 cm), we will probably need some kind of "points of reference" printed on an A4 paper sheet. Also, there will probably be needed some OpenCV since we will need to know the distance between two points in image. Besides that, how would you define the "correction" that has to be done based on four points?
I've done some pics for visual reference:
Id like to transform image like this:
To image like this (or even better):
EDIT: I'd like to do this in latest (3.1) version of which i have no idea about how to use it :)
EDIT #2: I've done some work on it, solving part of it in this post: Image perspective correction
I am trying to check if an image is on a program's interface. I know how to grab the program's image but I cannot figure out a way to check if the image on on the program's screen. How can I do this?
I think checking containing one image in another is a question of "computer vision", so maybe some special libraries like OpenCV can helps you.
And this question on stackoverflow could be so useful too
OpenCV Template Matching example in Android
If you want to do the checking within the same program as the one that loads the image, it should be possible by checking the user interface control properties/attributes, and also the return values of the functions/methods used to set the image. In such a situation, Computer Vision is overkill. In this case, may be you can post some of the code used for loading the image, so that others can suggest solutions.
But if you are using a different program to capture the screen and look for the image, SIFT and SURF features of OpenCV should do the job. The accuracy won't be bad in this application.
I have one method to combine 3 greyscale images to one colour image which is done by using getRed(), getGreen() and getBlue() in Java, for each individual input image and then applying the colour to the output image which works quite well. Im looking to find other methods for doing this however.
It doesnt have to be accurate in terms of sea being blue, etc. but it needs to be coloured in a way that different areas of the 'map' can be differentiated.
Ive been looking into ways of doing this but unfortunately havent actually managed to find an alternative way of doing it, im looking to use something apart from the getRGB() values.
Im not looking for anyone to code for me, just to give me some pointers on what to look for.
Thanks!
Your comment here is critical: "but it needs to be coloured in a way that different areas of the 'map' can be differentiated. Ive been looking into ways of doing this but unfortunately havent actually managed to find an alternative way of doing it"
What did you do with the other 4 images - or "channels". Usually, when doing color space mapping one has 3 channels and one converts to another 3 channel color space. In your case you have 7 channels, and you want to put all that information into 3 channels? It all depends on what you are viewing. Hyperspectral imagery would be a good place to start to see containers for storing imagery data with more than 3 channels.
You can convert to a different colorspace as others have suggested or perform any other transformation. It sounds like though in order to differentiate different parts of the image, you will need some post processing. This will depend on your transformation.
I have an image with 400x400 image to identify different components from it. But when I try to identify components using that most of time it doesn't provide correct answers. So I need to know whether there are some kind of methods in javacv or opencv to improve the quality of the image or increase the size of the image without effecting to its quality ?
This is the sample image that I use. (This is the maximum size that I can get and I can't use any photo editing softwares in the project, because it's dynamically generated image.)
In my image processing I need to identify squares and rectangles that connects those squares. And specially I need to get the width and height of those using pixel values.
You can scale it to any size, if you can vectorize it... and in your case vestorization is quite simple as you have some simple geometrical objects in image.
So, in my view your approach should be like this:
detect edges in the image with a high threshold (as you have very distinct objects)
vectorize them
scale them to any size
You should also look at the following link: Increasing camera capture resolution in OpenCV.
If you stick to image processing the easiest way to do it is to apply an equalizeHist(). This will increase contrast and will improve subsequent steps.
But, and this is a biiiig 'but', why are you doing it? Just reading this post, I saw another solution, and a quick google proved me I am right:
Kabeja is a Java library for parsing, processing and converting
Autodesk's DXF format. You can use Kabeja from the CommandLine or
embed into your application. All parsed data are accessible with the
DOM-like API.
That means you can extract directly all the data you want from that image in a text format. Probably something like "at position x, y there is a transistor, or whatever." So why would you render that file into an image, then analyse that image to extract the components?
If you do it for school (I know that many school projects are like this) I would recommend you to find a real problem to solve, and propose it to your teacher. You will be happier to do something that is not complete nonsense.
vectorizing the image is best option I guess as suggested by mocap.
you can also use enhancement tools like sharpening, saturating etc.