Is there a drawString method usable in java that will create scalable text that will be clear and crisp in a powerpoint presentation?
Backstory:
I screwed up. Big time.
A friend of mine asked for help with automating some graph creation for his company. The process involved taking in data values from a pdf file, then converting them into graphs to be exported into an image file that he could then use to place in a power point. I figured it would be easy enough to do in Java2D, and therefore used the Graphics library to do so.
The resulting image looks good, except that there is small text written by him through his manual process (which is done in excel), that I cannot replicate with my automated program. It seems that because he has created his image using excel this small text will scale well when blown up for a power point presentation, whereas when I use Java2D's drawText method it will look pixelated and blocky as this seems to draw it pixel by pixel.
I realize now that this would have been much better done using Visual Basic or through Excel macro's that are made with this sort of thing, however at this point I do not have the time to begin anew. :(
Related
I know we can extract text from image using ocr. But I need to extract the text present in video, like those in video lectures. Or in other words is it possible to transcribe a video to text. Is that possible? If so please suggest me how to do it in java or any other language.
My naive linux driven approach would be:
check: does the OCR work in my operating system?
extract some samples from the video using the normal runner. Each runner (for example VLC) has such a functionality.
check: how good is the OCR in extracting text from image files?
check: how good is the OCR in extracting text from image files with the background the video is providing?
get software to extract frames from videos in batch -> there is various software which allows to create contact-sheets, this should also be able to extract images in full resolution at abitrary points in time out of the video. Full resolution might be necessary to allow the OCR to work. Perhaps you can clip the images first, if you know, that the text is positioned in fixed rectangles.
Worst case you let OCR analyse each frame of the movie.
That mostly depends on how good and how fast your OCR is working. Everything else to me is very proven software. The language might be bash-shell-script, since the components will probably be separate linux programs. As I mentioned, it depends on the quality, performance and runtime environment of your OCR.
Yes, You can do that and there are 3 ways you can achieve it.
Split, Classify and train on your own.
Get a performance server,
A. Extract images from the video
B. Develop and Train your machine learning model. You can use tensor flow to do the same.
Note: If you prefer to train models on your own, make sure you have enough time as sometime the developing and training requires few months and you should have data to train them.
Use an OCR framework
USE API(Freemium model). There are many available in the market. Just google them and your will have many in hand.
I have an .jpg image that is generated by an application. What I want to do with it is, using java, blur out a box on the .jpg to a point where any text or content would not be able to be read, but doesn't aesthetically ruin the picture.
How would I go about doing this?
Edit:
I guess I'm needing more direction than just a simple how to do this. I don't have any background in image processing. What kind of java libraries or tools should I be looking at using?
I was wondering what tool can I use to make a single slice (image) into 3D. I can open dicom and raw images in my program but I want to display these images in 3D (just a single image rather than the whole stack). I used some of ImageJ files to open images but I don't like how ImageJ displays the stack in 3D and it doesn't really display a single image in 3d. My program is coded in java and I would like a tool that can be easily integrated into eclipse Kepler. I have found many tools like jogl, java 3d, java 3d workbench, vtk, etc. but I don't know which one to use or are there any other programs that are easier to use or integrate into the system.
EDIT:
I want to do something like this... http://www.welfenlab.de/fileadmin/forschung/gebiete/YaDiV/2008_07_18_Screenshot_YaDiV_1.png
There's a library called ImageJ which can be used to create three-dimensional models from two-dimensional slices. I haven't personally used it, but it looks like it should do the trick.
have you looked at XTK? in particular, lesson 17 seems to be exactly what you are looking for. it is in Javascript, so to integrate into your Java application, you should be able to use one of the many Java/Javascript bridges out there.
I need a solution to create one big image with sprites from ~100 single images periodically without intervention because the number of images and the images itself are changing over time. To create the sprites with e.g. http://css-sprit.es/ or any other toolu with a GUI would not be feasible.
Each image has a different width and height. Images formats are png, gif, jpg. My approach would be write a custom java program to concatenate the images vertically into one big image and create a json file to provide the coordinates for later processing. A google search returned me this java awt based tutorial:
https://sites.google.com/site/javagamescorner/home/creating-sprites
Is there another way you would recommend to create sprites? There are a lot of (too?) complex tools and libraries and maybe there is an easier solution.
This Stackoverflow thread mentions a lot of java libraries: open source image processing lib in java
Since you didn't mention Swing or SWT, I'm going to give you a SWT approach.
Engineer an ImageBuilder. Follow the builder pattern, and design it so that it suits your needs. Extend it from CompositeImageDescriptor (if you look at the class' APIs, you'll instantly figure out how to draw the images) to work with ImageDescriptors, construct your sprite, then eventually cache the result so it can be used later on.
We have a java web application. The application generates a big image with company structure diagramm on it as jpeg. Users download the image and want to print it on DIN A2 (big paper format). The jpeg in this scale has pretty bad quality after printing.
Our idea is to generate an image in vector graphics. What vector graphics format suits the best our needs, considering that we code in java and the users have windows and use MS IE browser?
May be there is a better way archieve this? Like let the browser to display the image and let users to print the page?
PDF has been invented exactly for the same purpose. iText library enables you to draw lines, boxes, circles and insert whatever text you like. If you want to automate it a bit using templates there's JasperReports which utilizes iText.
A well known vector graphics format is Scalable Vector Graphics. It's basically an XML file (starting with <svg> tag. It can be viewed in browsers like Firefox without additional plugins.
For java, you can use the Java 2D API to create SVG format. A tutorial can be found here:
If you need the vector graphic for IE you need VML, similar to SVG but can be rendered by Internet Explorer.
RaphaelJS can be used for vector graphics independent of browser model but it's client side and you may not want to do client side processing on every page load.