How do I compress only the top part of an image in inkscape? - inkscape

On inkscape, I am trying to make an SVG of a map that I drew, and I am trying to line it up with another map that I traced off of it. I imported pictures of both maps and tried to align them, however, the pictures were taken at a slightly different angle with my phone. When I stretched them out, rotated them, and aligned them, one was bigger on the top than the other one. Is there a way that I could compress the top part of the image, or a way to get around this problem?

Related

Rotated images comparing

I'm trying to find the differences between two images. The program is given 2 pictures as an input. One is original, and the second is slightly modified like this original image modified picture
After comparing the two pictures, the third one is displayed, which shows what is different in the two pictures.difference.When one of the pictures has a different set of pixels, it's easy to look for differences. But what to do if one of the pictures is rotated literally by 1-2 degrees? Since the search for differences occurs pixel by pixel, that is, each RGB pixel layer is compared, if the image is rotated by 1 degree, the location of the pixels will change and the program will think that the image is completely different and will incorrectly display the differences.slightly incorrect. So it's still shows main difference on image, that is hat, bit now you can see the silhouette of tapir, who shouldn't be there. Anny suggestions? I am using opencv and c++
So i tried just to load an image with different rotation angle, but it shows tapir silhouette.

Inkscape: enlarge figure without creating distortions

(a) what I have, (b) what I get, (c) what I want
I have a simple vector graphic in Inkscape, which consists of a rectangle, filled points and stars. Since the axis ranges are not really nice (the height equals approximatly 3 times the width of the picture) for a publication, I want to rescale the picture. However, I do not have the raw data, such that I can plot it again. How can I rescale my graphic (see figure (a)), such that the x-range is more wide (see figure (c)) without getting distortions (see figure (b))? In the end I want to create a PDF file out of it.
Any ideas on that?
Thanks for your help.
You can try to do it in 2 steps, using the Object -> Transform tool (Shift-Ctrl-M).
First, select everything, and with the transform tool select the Scale tab, and scale horizontally by, say, 300%. All figures will be distorted.
Now, unselect the rectangle, and scale horizontally again by 33.3%, but first click on Apply to each object separately. This will undo the distortion (but not the translation) of each object.
Note that 300% followed by 33.3% should leave the individual objects with the same size.
Documentation here.

Finding transformation using VIPS

I am trying to compare two images where one of them is rotated and shifted. I need to find the transformation from one to another so that I can resample and compare/subtract using VIPS to see the difference. Is there a way to do this?
nip2 has a couple of ways of doing this.
Load two images and click Toolkits / Images / Transform / Linear Match. A pair of tie points will appear on your two images: drag them to mark a pair of features on each image. The output image will be the second image resamped to match the first. There are some options to automatically improve your tie points, and to only rotate. It should be quick, even for very large images.
There's also an automatic transform finder. The auto search will only work for pairs of images which are rather similar; for example, it won't be able to match an x-ray and a visible image. To try this, load two images (they must be exactly the same size), and click Toolkits / Image / Transform / Rubber Sheet / Find. This will find a transform that matches the second image to the first. You can set how long it searches and the error threshold. It won't work for very large images (more than a few GB).
After you've found a transform, you can apply it to any other image with Toolkits / Image / Transform / Rubber Sheet / Apply. It'll take account of changes of scale, so you can find on a small image and apply on a large one.
Unfortunately, the auto transform finder was written by a friend of mine and he can't release the source. It's compiled into the Windows nip2 binary, or on linux you have to download a binary plugin and put it in the vips lib area.
http://www.vips.ecs.soton.ac.uk/supported/current/linux-64/

Strange striping in compressed NIFTI files

We're reviewing NIFTI images in the 2D viewer. The CDN version of XTK displays them upside down, so I checked out the code from Github. The master branch on Github shows the images in the correct orientation, but demonstrates a strange banding or striping artifact. Poking around commits, I found that commit 332b822... Fix compilation for the changes in parserFSM and parserTRK. works correctly, i.e. correct orientation, no banding, but the HEAD of master does not.
Unfortunately, I don't understand XTK quite enough to fix the problem.
Any ideas?
Image with stripe artifact from HEAD of master
Second broken image
Correct image from 332b822
This happens because we do not do any interpolation during the reslicing.
Here is what is going on, on the XTK side:
Before:
Parse NII (pixels)
Create a 3D array containing all the pixels
Display ii
-> orientation is messed up because we do not take it into account. We only slice 3D array through X, Y and Z axis.
Now:
Parse NII (pixels and orientation)
Create a 3D array containing all the pixels
Rotate 3D array
Extract pure Sagittal, Coronal and Axial slices from the rotated array containing the data
-> orientation is correct up because we do take it into account. But the slice we extract might present some artifacts because when we generate the slices, we do not do any interpolation.
We want to add the interpolation soon.
A good place to start is at line 861:
https://github.com/xtk/X/blob/master/io/parser.js
It might be tricky though...
We also what to add the ability to switch between "oriented volume" and "acquired volume" easily.
I think that will be faster to implement and a good trade-off for now.
Thanks

Photo gallery using different sized images in fixed viewable area

I'm hoping you can help and I'm hoping this isn't a duplicate (I've already been searching for the past 2 hours trying to find a solution).
What I'm currently doing:
I am using the Pikachoose Photo Gallery - http://www.pikachoose.com but I am open to others. I just need a very basic photo gallery that I can populate from a database. I have gotten the photo gallery looking 95% of how I need it to look but I'm running into a big problem. Although the width is set, the height is not as this would cause skewing of the image. I would assume most of the images will be landscape. So what happens while the slider rotates through the images, the main larger viewable area changes height based on the image that is loaded. It would be fine if all images were the same height/width, but that's not a possibility as I will not have control over the images loaded.
They are loaded into an unordered list and when clicked, will open a page that has the full image.
What I need it to do:
I'm familiar with how sprites work, but I wanted to know if there was a way to incorporate that type of functionality into the slider (i.e. Flickr does for thumbnails). I want to have a fixed height/width viewable area, such as 220px x 150px, and have the image load into that making the longest side 220 + 40 pixels (in case it's a narrow image) and center it, but you still only see 220px x 150px. Same with the thumbnails, I want them to be set width/height 50x50 pixels, which they are right now, but the images are squished. If I can solve either the main image or the thumbnail, I think I can solve it for the other. But I don't even know where to start.
See below for a visual example. Note: I meant for the thumbnails to read "set shortest side to 50px" not longest...