Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there any code(specifically Java or C++) or software in which we import any image and it gives the outline of that image in points, which we can use again to draw image outline by joining those points in JOGL or OPenGL ..
There's an outline tracer in Inkscape (which is open source c++).
http://inkscape.org/doc/tracing/tutorial-tracing.html
This will convert to vector format - so you could get some points out this way.
EDIT: this actually uses http://potrace.sourceforge.net/ for the tracing..
Here is an example code in MATLAB:
%# read image
I = imread('coins.png');
%# Convert to a binary image
BW = im2bw(I, graythresh(I));
%# get object boundaries
BW = imfill(BW,'holes');
B = bwboundaries(BW,'noholes');
%# plot boundaries overlayed on top of image
imshow(I), hold on
for i=1:numel(B)
plot(B{i}(:,2), B{i}(:,1), 'Color','g', 'LineWidth',2)
end
hold off
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
This post was edited and submitted for review 1 year ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
Want to create a layout for Redeem Items. Kindly suggest or help how can I accomplish this easily?
Check this image for the idea
Dark Version of the item
You can't set a shape for a view. A view is always a rectangle. What you can do is make a view with a custom background with a non-rectangular shape and transparency in the area outside the shape, and use that as the background, which will make it appear as if it has a shape.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am developing a java swing based application which show thumbnail of any format(jpg,png) images. For that, at first I read the image file by ImageIO.read(file name) and then create thumbnail of it. But it shows null pointer exception when read PSD format file.
I use ideli library for read PSD type file but it requires subcription/paid. So there have any free library to read PSD type file in Java?
image = ImageIO.read(new File(i));
thumb = Thumbnails.of(image).size(140,100).outputFormat("png").asBufferedImage();
ImageIO.write(thumb, "png", new File("thumb.png"));
By above code, I can read (without PSD) image file and create thumbnail of image.
Have a read of the documentation, PSD is not a supported format.
You might find some value from a similar question here.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I want to rotate a BufferedImage from a math phrase so that become like this :
http://i.stack.imgur.com/ekP77.jpg
convert to :
http://i.stack.imgur.com/tYth1.jpg
we have not images and them include by user.
Minimize axis aligned bounding box area.
Simplest algorithm could do coarse estimation every 10 degrees. Pick best angle and do refinement with smaller angular step.
Probably you should pick wider rather than taller result.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I search for Java free open source shapes library,
That contains shapes like: Triangle, circle, Square, Polygon and etc'.
Of course it's should be graphics and not textual (terminal \ cmd).
Do you know about good one? Thank you.
Check out two particular ones (if you're still looking) the MyroJAVA program- this one is really designed for robots, but surprisingly has some pretty good Graphics library. http://wiki.roboteducation.org/Myro_in_Java
Also this library from Williams College: http://eventfuljava.cs.williams.edu/library.html
That contains shapes like: Triangle, circle, Square, Polygon and etc'.
With exception to triangle, the Java Graphics API already contains all theses, and to be honest, triangle wouldn't be that hard to implement (it's a closed polygon with 3 points after all)
I'd start by reading through 2D Graphics, in particular Working with Geometry
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Problem: I have to plot a simple 3D graph/diagram with x,y,z coordinates given for some points.
My goal is to export this 3D diagramm to svg -> I will have to make a projection as svg is not (yet) able to handle 3D.
So my input is a 3D diagramm with x,y,z coordinates and the output is a 2D view reduced to x,y coordinates.
Does anyone know a (preferrable small) java lib like
this one for javascript?
The projection might be just point3d to point2d. That is all I really need.
Thank you!
If all you need is something simple then I might say just write it yourself. If you don't need to move the camera you can assume a lot of the calculations zero out, and you can just do the following to get the 2d coordinate for any 3d point:
rect2d.x = rect3d.x / rect3d.z;
rect2d.y = rect3d.y / rect3d.z;
Doing that you can just simple take all of the 3d points that make up your polygon, and use the 2d points as your SVG primitive. The tricky part you're going to have to deal with is hidden surface removal, but that's not too hard. Shading is going to be your real problem, but maybe you can play around with gradients to emulate light.
Have a look at JFreeChart. Have a look at Batik for saving it to SVG