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.
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.
We need to be able to load large (typically >10,000px in one dimension but potential larger) images into Java. The user will need to zoom/pan the image and then click points which the program then uses to make distance measurements.
As always I'd rather not reinvent the wheel so would like a library that will handle reading popular formats (JPG and TIF), but also take care of memory handling, tiling etc. I'm assuming proper image editing programs like GIMP and Photoshop don't read large images directly into memory but rather read subsets of the data as needed?
The solution needs to be open source as this is an academic project. It also needs to be cross-platform so native libs are out unless they are available for Windows, Linux and OSX.
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.
In server side image process, should I use AWT or SWT?
I think AWT maybe too abstract away from the actual image data bits, so I guess SWT maybe slightly faster.
Or do you suggest another open source image process library? (BSD or Apache licensed)
The server is running Ubuntu 11.04.
Requirements:
Read/write image from/to stream instead of files.
The image type is given as parameter rather then guess from extension.
(This is optional if it can determine the image type from the header bytes.)
Support of JPG, PNG, GIF.
(Bonus) Support of Animated GIF.
Use cases:
Generate thumbnails.
Add some banner texts.
Add cryptic image watermark and validation.
SWT has very little in terms of image processing. The standard JDK image stuff has the fancy ImageIO package, and Java2D which can do pretty much everything. I'd call this a no-brainer: use Java's built-in stuff, and don't try to use SWT for something it's not intended for.
I can second Ernest's notion about SWT for this task, forget it.
But while Swing is fine for image manipulation and output, Swing's ImageIO fails too often during input: many images which you'll meet in the wild, and which work fine in the browser, produce Exceptions.
The best Java option I know of is JAI, which unfortunately is a pain to use. So do yourself a favor, and use JAI for input, and Swing for the rest, like this:
RenderedImage renderedImage = JAI.create("fileload", imageFile.getAbsolutePath());
RenderedImageAdapter planarImage = new RenderedImageAdapter(renderedImage);
BufferedImage image planarImage.getAsBufferedImage();
JAI will also fail in rare cases (JPGs with custom color space, as written by Photoshop, are an example). If you want to do even better, use ImageMagick, which is an ultra-powerful command line tool. There are Java interfaces available, which either provide an API for the command line, or use JNI to call the native library, see here.