image-manipulation

Numpy image - rotate matrix 270 degrees

一曲冷凌霜 提交于 2019-11-27 23:09:46
问题 I've got a Numpy 2d array that represents a grey-scale image and I need to rotate it 270 degrees. Might be being a bit thick here but the two ways I can find to do this seem quite... circulous: rotated = numpy.rot90(numpy.rot90(numpy.rot90(orignumpyarray))) rotated = numpy.fliplr(numpy.flipud(numpy.rot90(orignumpyarray))) I'm thinking there must be a better way to do this in one operation. Basically a rot270() function? Any ideas? 回答1: You can tell rot90 to rotate several times, this should

How to get the file size of a “System.Drawing.Image”

末鹿安然 提交于 2019-11-27 21:12:36
问题 I am currently writing a system that stores meta data for around 140,000 ish images stored within a legacy image library that are being moved to cloud storage. I am using the following to get the jpg data... System.Drawing.Image image = System.Drawing.Image.FromFile("filePath"); Im quite new to image manipulation but this is fine for getting simple values like width, height, aspect ratio etc but what I cannot work out is how to retrieve the physical file size of the jpg expressed in bytes.

Looking for fast image distortion algorithms

浪尽此生 提交于 2019-11-27 20:50:10
问题 I am trying to implement an application which uses shpere distortion filter. I am using an the algorithm from here which changes pixels location by getPixel() and setpixel() methods. My problem is it is too slow for Android devices and there are applications which implements same sphere(and others) filter way faster than my approach. ( for example Picsay Pro app) Could anyone share or give direction to find or implement fast distortion algorithms. Actual filter that implements the algorithm:

Looking for an Image Comparison/Pattern Recognition Library

倖福魔咒の 提交于 2019-11-27 19:54:50
The end goal would be to see if contains . the compare needs to support minor distortion, scaling, color differences, rotation, and brightness differences. it can be in any language really. i will be running this algorithm as a webservice so its no problem if i have to write this portion in c, c++, python, etc. You should probably take a look at OpenCV and VLfeat . Object detection can be performed for example using Rapidminer IMMI (image mining extension for one of the leading open-source data-mining platform) BoofCV (using SURF feature detection) How about ImageMagick ? Its not a library per

increasing the resolution of a grayscale image

邮差的信 提交于 2019-11-27 19:40:41
问题 I have a grayscale image, and need to increase its resolution. How can this be done in MATLAB? Would it mainly be done by multiplying the dimensions of the image for instance? 回答1: You need to perform interpolation. There are many ways to do this. Use imresize (e.g. imgOut=imresize(img,scale,method); ), or if you do not have the Image Processing Toolbox, consider the following code: function imres = resizeim(I,outsize,interpalg) if nargin<3 || isempty(interpalg), interpalg='cubic'; end rows

UIImage Rotation custom degrees

爷,独闯天下 提交于 2019-11-27 19:33:00
I have been using the code in this sample to assist and this works well. http://www.platinumball.net/blog/2009/03/30/iphone-uiimage-rotation-and-mirroring/ I cannot workout how to rotate by a custom amount of degrees between 0 & 360.... You'll want to do pretty much the same stuff as in that post does in rotate: CGSize size = sizeOfImage; UIGraphicsBeginImageContext(size); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextRotateCTM(ctx, angleInRadians); CGContextDrawImage(ctx, (CGRect){{}, size}, image); UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

Can you combine multiple images into a single one using JavaScript?

ぐ巨炮叔叔 提交于 2019-11-27 19:31:28
I am wondering if there is a way to combine multiple images into a single image using only JavaScript. Is this something that Canvas will be able to do. The effect can be done with positing, but can you combine them into a single image for download? Update Oct 1, 2008: Thanks for the advice, I was helping someone work on a js/css only site, with jQuery and they were looking to have some MacOS dock-like image effects with multiple images that overlay each other. The solution we came up with was just absolute positioning, and using the effect on a parent <div> relatively positioned. It would

How to resize and save a Texture2D in XNA?

人盡茶涼 提交于 2019-11-27 18:56:18
问题 In a level editor I've made for my XNA game (editor is also in XNA) I'm allowing to scale Texture2D objects. When the user tries to save the level, I'd like to actually resize the image file on disk so that it doesn't require scaling in the game. Is there an easy way to create an image file (PNG preferred) from a scaled Texture2D object? 回答1: You can scale your textures by rendering to a render target at the size you want and then saving the render target texture. This simple example shows

Merge Image using Javascript

强颜欢笑 提交于 2019-11-27 18:10:32
Is it possible to merge pictures using javascript? For example, if you have 2 rectangle .jpg or .png images files of the same size, is it possible that you can align it side by side and produce a merged copy of the two in a new .jpg or .png image file? Huỳnh Quốc Phong You can use JavaScript to 'merge' them into one canvas, and convert that canvas to image. var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); var imageObj1 = new Image(); var imageObj2 = new Image(); imageObj1.src = "1.png" imageObj1.onload = function() { ctx.drawImage(imageObj1, 0, 0, 328, 526); imageObj2.src

Combine 2-3 transparent PNG images on top of each other with PHP

末鹿安然 提交于 2019-11-27 17:32:12
I am working on a custom avatar system for a project, but I have never really done much with the image side of PHP. I assume I need to use GD in some way, but I have no idea where to even start. Basically, there are a bunch of pre-made transparent PNG images. Users can select 2-3 of them to customize their avatar, and I want to be able to take these images and make a single image out of them to be stored in a folder. $image_1 = imagecreatefrompng('image_1.png'); $image_2 = imagecreatefrompng('image_2.png'); imagealphablending($image_1, true); imagesavealpha($image_1, true); imagecopy($image_1,