Distance Transform

Hello everyone,
i have just signed up for the java forum and i have a problem as you may easily understand.
i have been working for a project related to image processing, and my supervisor asked me to write a code that implements one of the distance transform algorithms such as Euclidean or Gaussian. However, we do not need the transformed and grey-scale output of the input image but the coordinates and radiuses of the inner circles that represents the features of the original image.
actually i have no idea how can i compete those coordinate and radius values. so far, i have written a code that takes an image as input and then computes its pixes values (i used PixelGrabber class) in order to store them into both 1D and 2D arrays. the next step is to calculate the values of the transformed image in order to access the values i have been trying to get; however, i cannot really see any way to do so.
here is a link for those who do not have any idea about the circles i mentioned to understand what i meant:
http://sog1.me.qub.ac.uk/Research/medial/medial.php
if you have any idea about competing the circle values, i will be in your debt.
thanks to everybody who pays attention

here is the code i have written to obtain the pixel values.
as you can see, this code takes an image from the directory where you put the code, stores the pixel values of the input image into 1D and 2D arrays.
aside form the pixel calculation, i tried to implement a distance transform algorithm i found in the web but i think i could not correctly integrate it to my own code.
import java.awt.*;
import java.awt.image.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.imageio.*;
    public class Pixel {
         public static void main(String[] args){
     PixelGrabber pg;
     File file;
     BufferedImage image = null;
    try {
        // Read from a file which is in the same directory with this code
        file = new File("aaa.bmp");
        image = ImageIO.read(file);
    } catch (IOException e) {
         pg = new PixelGrabber(image, 0, 0, -1, -1, false);
          try {
               System.out.println(pg.grabPixels());
          } catch (InterruptedException e) {
               e.printStackTrace();
          int ysize = image.getHeight();
          int xsize = image.getWidth();
          System.out.println("Row sizw: " + ysize + " pixel");
          System.out.println("Column Size: " + xsize + " pixel");
          pg.startGrabbing();
          byte[] data = new byte[xsize*ysize];
          data = (byte[]) pg.getPixels();
         int i=0;
          //printing the 1D array
            do{
               System.out.print(data);
          i++;
          if( i%xsize == 0)
               System.out.println();
     }while(i<data.length);
     System.out.println();
     System.out.println();
     System.out.println();*/
     //copying the 1D array to 2D array
     int index=0;
     int[][] matris = new int[ysize][xsize];
     for(int a=0; a<ysize; a++)
          for(int b=0; b<xsize; b++){
               matris[a] = data[index];
               index++;
     //printing the 2D array      
     for(int a=0; a<ysize; a++){
          for(int b=0; b<xsize; b++)
               System.out.print(matris[a][b]);
          System.out.println();
     //Backing up the 2D array      
     int[][] mat1 = new int[ysize][xsize];
     for(int a=0; a<ysize; a++)
          for(int b=0; b<xsize; b++)
               mat1[a][b] = matris[a][b];
     int temp, j;
     //performing the distance transform (got this part from net)
     for(j=0;j<ysize;j++)
          for(i=0;i<xsize;i++)
               if(mat1[i][j]==0)
                    continue;
               if((j==0)||(j==ysize-1)){
                    mat1[i][j]=1;
                    continue;
               if((i==0)||(i==xsize-1)){
                    mat1[i][j]=1;
                    continue;
     temp=findmin(mat1[i-1][j],mat1[i-1][j-1],mat1[i][j-1],mat1[i+1][j-1]);
     mat1[i][j]=temp+1;
     //performing the distance transform from bottom (got this part from net)
     for(j=ysize-1;j>=0;j--)
          for(i=xsize-1;i>=0;i--){
               if(mat1[i][j]==0)
                    continue;
               if((j==0)||(j==ysize-1)){
                    mat1[i][j]=1;
                    continue;
               if((i==0)||(i==xsize-1)){
                    mat1[i][j]=1;
                    continue;
     temp=findmin(mat1[i-1][j+1],mat1[i][j+1],mat1[i+1][j+1],mat1[i+1][j]);
     if(temp>(mat1[i][j]-1))temp=mat1[i][j]-1;
     mat1[i][j]=temp+1;
     //printing the original pixels
     for(int a=0; a<ysize; a++){
          for(int b=0; b<xsize; b++)
               System.out.print(matris[a][b]);
          System.out.println();
     System.out.println();
     System.out.println();
     System.out.println();
     //printing the transformed values
     for(int a=0; a<ysize; a++){
          for(int b=0; b<xsize; b++)
               System.out.print(mat1[a][b]);
          System.out.println();
          private static int findmin(int num1, int num2, int num3, int num4) {
               int min=4000;
               if(min>num1)
                    min=num1;
               if(min>num2)
                    min=num2;
               if(min>num3)
                    min=num3;
               if(min>num4)
                    min=num4;
               return min;
please help me about how can i convert the 2d array into an image output in order for me to check the correctness and validity of the distance transform algorithm i found in the web. and i still need to figure out how to compete the coordinates and radiuses of the circles.
thanks everybody                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Measure pixels distance

    Hi everyone!
    I would like to measure the radius of each pixels by reading BMP file. BMP dimensions is 50x50 pixels and each pixel size is 0.032 milimeters.
    This is what I've done so far. I was able to get only grey level of pixels in diagonal lines but I would like to get each pixel's distance(milimeters) from center point of the circle.
    Can anyone show me a way on how to do it?
    Thanks
     (I attached jpg file because i couldn't upload bmp file)
    Attachments:
    pixels.vi ‏22 KB
    lens.jpg ‏2 KB

    Hi rainy01!
    altenbach posted this very neat vi
    The linked vi calculates an centered euclidian distance transform  in px of a given input image.
    All you have to do is to scale it up by multiplication with your mm/px factor (0,032)
    The euclidian distance is calculated very efficient in altenbachs approach via complex numbers.
    You also could try a more explicit approach without complex numbers by using directly the i of the FOR loop and arithmetic functions.
    Alex
    ♜♖ LabView 8.6 - LabView 2014 ♖♜
    Attachments:
    2013-05-08_px-euklid-mm.png ‏33 KB

  • Help for image pattern matching

    Hello Everyone
    I am working for my last year project. In my project I will work on the image processing to find a moving object. I will work by JMF. I have finished to grab a frame from the webcam video clips. Now I need a algorithm to find a Image pattern from the grabed image. But I donot know which algorithm is fine for image pattern matching as well as how can I implement in java. Is anyone know please help me very urgently.
    Thank you
    Md. Mainul Hasan

    If you would like to take a look at http://www.exactfutures.com/index01.htm and http://www.exactfutures.com/index02.htm and http://www.codeproject.com/useritems/activity.asp then these pages and links may well be useful to you. It may not be exactly what you are looking for, but it does point to some examples with source for video analytics, and at the very least they illustrate how to capture & handle the data including a fast movement detection algorithm. If you want to find a specific shape then search the internet for information on chamfer distance transforms - one can use JMF or extend these simple examples to apply those techniques.

  • Exception in thread "AWT-Event Queue 0" Mem Out of Bounds. Java Heap Space

    Hello,
    I'm not sure how to resolve this Java Heap Space Memory Out of Bounds error. Could someone please assist me with this error?
    A SCENARIO:
    I am reading in tons of data from 5 separate text files. The files have tons of rows (up to 64,220 in one). The data must be read into the program and assembled. When I have all of the files populated, I receive the OOM Error. If I remove the data from one of the 5 files the program runs successfully. If I add the data back into the file and then remove the data from some other file, the program runs successfully.
    Thanks
    RodneyM

    ff.skip(18);
    i = ff.read();
    i = ((ff.read() << 8) | i);
    i = ((ff.read() << 16) | i);
    i = ((ff.read() << 24) | i);
    xsize = i;
    System.out.println("width=" + xsize);
    i = 0;
    i = ff.read();
    i = ((ff.read() << 8) | i);
    i = ((ff.read() << 16) | i);
    i = ((ff.read() << 24) | i);
    ysize = i;
    System.out.println("Height=" + ysize);
    ff.skip(38);//62-(2+16+4+4=26)=36, actually total=62 Bytes header This is completely wrong. First an foremost you should not have this code in the paint(Graphics g) method. This is a GUI thing. The paint method may be called for any reason and you do not+ want to open a file stream, read it, and do the distance transformation every single time the method is called. There's also the issue that you have overridden the paint method as opposed to subclassing a component, overriding the paintComponent method, and adding it to the frame. But that can be ignored for right now (it will come back later and cause complications).
    Next, you've said that the header is 62 bytes. This is incorrect for a png file. The code you have posted assumes (very specifically) that you have inputted a BMP version 3 with 2-color entry palette. In other words you can only open a very specific type of image with that code. Definitely not a png. This is what was causing the out of memory error since it interprets the width and height wrong when reading the bytes and you end up trying to create a 2-D int array that will take up several hundred megabytes in size
    //xsize and ysize are interpreted wrongly
    pix=new int[xsize][ysize];
    mat1=new int[xsize][ysize]; Now granted, BMP v3 is the most common type you will encounter but you must admit that the code is not very robust at all (since it requires a very specific input).

  • Feature request: make the "transform" dialogs non-modal

    Currently, the transformation dialogs accessible at Object>Transform are modal. I'm talking about "Move…", "Rotate…", "Reflect…", and so forth. These dialogs, when open, lock the user out of any interaction with the artboard other than the "preview" button, until the dialog is closed.
    Even more problematically, they lock the scroll and zoom factor of the current user view, so that there's no way to inspect how a precise numeric adjustment affects a part of the layout outside the current window (or within the current window but very small inside it) without committing the change, inspecting it, and then later undoing if necessary. This creates cycles of tedious user adjustments (especially on small monitors) that really should be possible in one user step, by toggling the preview button on and off, and zooming/scrolling.
    This is contrary to most modern UI design principles, which suggest avoiding modes unless they are truly and meaningfully necessary. I don't think this is one of those cases. Photoshop made dialogs for adjustment layers non-modal with CS4, and while there are issues with the newer interface (see John Nack's Configurator workaround), I think it's a win overall. Illustrator needs to catch up in this regard. I realize there is some pretty serious refactoring involved to do this, but it has to be do-able.
    In the words of Larry Tesler's immortal Subaru license plate: "NO MODES"!

    ...make the "transform" dialogs non-modal...
    What, and bring Illustrator out of the 1980s?! Are you mad, man?
    Just so you know you're not alone; I've been complaining about AI's archaic dependency upon modal dialogs for many years.
    ...I'm fully aware of the Transform panel...observing that there's another way to do it...doesn't really address any of my points here...
    But it's not "another way to do it," because the functionality is not the same. The modal dialogs include crucial functionality that cannot be done in the Transform palette. For example, moving something in terms of distance and direction (diagonally), instead of merely by lame X and Y factors. Or transforming about an off-object center of transformation, rather than merely by the 9-point proxy.
    ...the "preview" isn't updated on keyboard entry, and the "preview" checkbox need to be manually toggled on and off...
    But the preview does refresh (and does not have to be toggled) in response to keyboard entry if that keyboard entry is by the arrow keys. For example: Select something, doubleClick the Scale tool, click your cursor in the Uniform value field, and tap the up/down arrow keys (or press and hold them). The value will increment and the preview will update with each key tap. (Be sure to teach that to your students.)
    That does not, of course, negate the complaint, but it does ameleorate it somewhat. The increments are preset; there are no preference settings for them. (Don't even get me started on preferences that should be doc-specific settings, and vice-versa).
    Nor does the valid point that problematic dialogs abound beyond just those associated with the transform tools, but I do agree with it. For just one of many examples, it's nothing short of idiotic that the Scale fields of Transform Each do not have a uniform scaling lock, and that only percentage fields are provided and no explicit dimension fields. Illustrator is quite saturated with such inconsistencies and half-baked implementations.
    But...you're often arguing with the emotionally attached Illustrator devoted here. So I wouldn't recommend holding your breath. It would probably be more effective teaching Illustrator's shortcomings to your beginning students. Probably one of the easiest ways to explain the problem of modal dialogs is to point out that you can't change the current selection with the dialog open.
    JET

  • Free transform a color matte...

    Hi,
    There's a very simple thing i'm trying to do that's puzzling me...
    I'm working on a split screen. On the right, I have graphics. On the left, i have a talking head. THe talking head frame has 3 different sizes that i juggle with.
    I'm just trying to create a thin Vertical line that will act as a border between the graphics and the talking head.
    I can ofcourse do this by distancing the two frames, but i'd rather have a thin black line i can just copy paste over.
    The obnly way i found to do this was to transform a color matte. But even by changing the aspect in the motion tab, i can't get it thin enough. There must be an easier way to free transform a shape, and to do this directly in the viewer no?
    thanks for your help...

    Thanks David,
    Croping is what i'll end up doing. But isn't there a way to change the aspect directly via wireframe in the viewer. Using the wireframe, i can change the scale, and rotation, but how do i unlock the aspect proportions?
    thanks

  • Free transform tween not working

    This is another common problem that's driving me up the wall:
    - At 0 frames, I draw a blue square with no border.
    - I insert a keyframe on the 10th frame, then I move the
    square a short distance and stretch it with the free transform
    tool.
    - I create a motion tween between the two frames.
    Now by all rights, I should see the square gradually move and
    stretch. But all Flash does is animate the motion of the square and
    show the end result of the stretch. There's no transformation in
    between. How can I fix this?

    or - convert it to a symbol forst - then create 2nd keyframe,
    use free transform tool and aply
    Motion tween. You are making the mistake of using the wrong
    tween for the wrong object or the right
    tween for the wrong shape.
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    Glitcher2000 wrote:
    > This is another common problem that's driving me up the
    wall:
    >
    > - At 0 frames, I draw a blue square with no border.
    > - I insert a keyframe on the 10th frame, then I move the
    square a short
    > distance and stretch it with the free transform tool.
    > - I create a motion tween between the two frames.
    >
    > Now by all rights, I should see the square gradually
    move and stretch. But all
    > Flash does is animate the motion of the square and show
    the end result of the
    > stretch. There's no transformation in between. How can I
    fix this?
    >

  • Need help creating illusion of a long road going off into the distance...

    I can't for the life of me seem to figure something as simple sounding as this out... I've spent 2 whole days now working with every different program in the CS4 Master Collection and am ready to shoot myself.
    I'm trying to create a nice banner and in it is a street sign and the road it's naming going off into the distance as if you were standing on the road looking straight down it forever into the vanishing point.
    For some stupid reason this is the hardest illusion of all. In PS CS4 I create a really long Road as a Smart object,and then try to turn it into a 3d postcard so I can rotate it, but only the part that is seen within the boundaries of the Banner renders in 3D, the rest of the layer that hangs outside the border is cropped.
    I want to be able to put a light on it and texture it to make it look realistic, other wise I would have just drawn a triangle with lines on it. So I try using After effects to at least handle this part. I created a really long (20,000 px) road in Illustrator, ported it into AE, but AE kinda does the same thing, I am only able to see a piece of the road, the ends are invisible, so only the middle, say 5,000 px of the road are rendered when I rotate it into the plane I want!
    Is there a tutorial or something that can help me achieve a realistic looking long road?
    Thanks All
    Aza

    My advice is to use good old perspective transform, along with Scale and maybe distort to change the vanishing point. Edit/transform/perspective. These transform parameters are very easy to work with and will create a good visual perspective. Not a good idea to use Warp or Liquify because this will throw your perspective off. Best thing to do is light the image from above before transforming. This is an excellent use for Smart Objects.
    Another slightly more complex way is to use the vanishing point filter. Copy your flat road and paste it into a carefully created vanishing point grid.
    Getting into the 3D tools for a simple task like this, just creates more things that can go wrong, as you have discovered.

  • Calculating Distance given a 4 point 2D image

    Hi All,
    3d n00b so play nice :-)
    I'm trying to use a Wii remote camera to calculate real world distance from an object in Java.
    The Wiimote will supply me the x and y coordinates of the 4 point object, which is actually 4 lights on the floor in this configuration.
    I know the exact measurements of the 4 objects and the distance between them in the real world.
    I know the 2D co-ordinates as represented on a 1024x768 screen.
    I know the Angle of the Wiimote.
    The lights will only ever be on a flat horizontal plane.
    Is there anyway to reverse transform the 2D image from the camera back into 3D, taking into account the fact that the image may be rotated, and thus calculate the distance in the real world?
    I'm guessing its some clever trig and some wizzy transformations although its been 20 years since I was in school! :-)
    If you need any more explenation I'd be happy to attach some drawings.
    Thanks in advance.
    Uzerfriendly

    hi
    did you ever find out anything regarding your query?
    i was trying to solve maybe a similar problem
    though i'm not sure
    how can i calculate the distance of an object of a known size (say, a person) that appears in a picture
    presupposing the picture was image is not magnified or is somehow "sstandardized" or somehow "like" human vision
    does it make any sense?
    be happy to hear
    thanks
    doron

  • Transform Effect problems when used with 3D layer's depth

    Here is my set up.
    I have PreComp with graphics illustrator imported layer with continuosly rasterise enabled.
    This graphics has a reflection underneath it. I made the reflection by applying Transform effect, setting offset to -100 and adjusting the Anchor point.
    As far as graphics move left to right (X,Y) there is no problem and Anchor point is in its place.
    As soon as I make the layer 3D and start changing depth values the reflection starts to jump around.
    My guess is - it happens because anchor point is a constant value and since reflection is based off its value it does not follow the base of the graphics. Purhasps there is a code snippet which need to be used to link the Anchor Point value to the Zoom Value? Adjusting Anchor point values with key frames proved too difficult.
    In another words I would like to keep the reflection at a constant distance from the base of the graphics and once the graphics move out or in the reflection does not follow.
    I PreComposed this graphics and imported it into the new Compostion and applied XY and Z movement using camera and Null layers. It was the same effect and reflection did not stick to the base of the graphics.
    I need to keep Collapse Transformation enabled on all the consecutive Comps/PreComps to make sure the vector art renders at high quality.
    What would be a proper way to make a reflection of a 3D layer/preComp  in the Comp where movement controlled with Camera and Null layers, with Continuosly Rasterise/Collapse Transformations enabled?

    Great! At least I know not to spent my time in a wrong direction.
    Two questions:
    Do I need to enable "Collapse Transformations" in the final rendering Comp in order to keep "Continuously Rasterize" settings within the nested PreComps enabled (for illustrator files rendering sharp). I have a few nested preComps and originally activated "Continuously Rasterize" throughout the project in all of them.
    "How" to create reflections seem clear from your comment. Do not use any effects but rather create a copy of a layer I would like to have a reflection of and scale it to -100. "When" seems to be a mystery. Should I apply reflection in the very first preComp or very last or the one where I create all the major animation for my graphics?

  • Transform in perspective

    hi, usually when i press Cmd + t i can trasform my layer.
    let's say i have a simple shape, if i transform i can chose prospective but it wont make it longer or shorter in perspective. Today searching the web i found a psd file where for some reason i can do that.
    here is a gif of what this psd file does. i press transform, and it let me change lenght n witdth based on perspective. amazing! how do i do that??
    http://it.tinypic.com/r/2le5gn9/5
    i noticed theres a small icon on the layer, is it that making the magic? how do i do that?
    http://it.tinypic.com/r/hwyfq0/5 <- icon on the layer
    please help me:D

    You would make a window, as if you are looking straight at it.  It can have several layers.  Once done, you put all the layers into a smart object.  Then you can transform them to fit the wall.  In the attached image, I started out with the windows all squared up then put them in smart objects to shape them to the walls.  I also had several different layers within the smart objects so that I could move some layers to look like the window was open to different distances.

  • Moving objects a certain distance at an angle

    I'm trying to move an object a certain distance at a certain angle. I select the object and hit Enter to bring up the Move dialog. I enter the angle and distance, and instead of moving the specified distance, it moves some other distance. I don't get it. Am I doing it wrong? I can't imagine how else it's supposed to work. Here's a simple example:
    Based on the angle and distance I entered in the video, the duplicate square should have been placed so that its lower right corner touches the upper left corner of the original. Instead, it only moved half an inch or so.

    I did not encounter your problem but you might find this a work around
    Use the Effect>Distort and Transform>Transform
    use the vertical and horizontal distances to get where you want it might also work witht he move tool dialog.

  • Perspective Transform in Javascript

    Hej everyone,
    I'm working on a script, which should do an automatic perspective correction. Unfortunately the only way I found out until now is some code, generated with the ScriptListener Plugin - and I am having a hard time figuring out what the values / maths are doing. For better understanding what I'm trying to achieve, here is an image:
    The yellow colored area is the original image. Green is the image I'm trying to get. I need to do an perspective correction on the top anchor points. Doing it manually it works fine. However, when I look at the script, the scriptListener is generating, I don't have any clue what the values in there are meaning. Perhaps there is some kind of math I don't get. I can't get any match regarding the values by doing it manually, and the ones the listener writes.
    Anyone an idea? Is there anywhere an angle or distance of how the anchor points are being moved?
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc48 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref21 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref21.putEnumerated( idLyr, idOrdn, idTrgt );
        desc48.putReference( idnull, ref21 );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc48.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc49 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc49.putUnitDouble( idHrzn, idPxl, -16.066570 );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc49.putUnitDouble( idVrtc, idPxl, 16.381048 );
        var idOfst = charIDToTypeID( "Ofst" );
        desc48.putObject( idOfst, idOfst, desc49 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc48.putUnitDouble( idWdth, idPrc, 134.475806 );
        var idSkew = charIDToTypeID( "Skew" );
            var desc50 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idAng = charIDToTypeID( "#Ang" );
            desc50.putUnitDouble( idHrzn, idAng, 19.127500 );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idAng = charIDToTypeID( "#Ang" );
            desc50.putUnitDouble( idVrtc, idAng, 0.000000 );
        var idPnt = charIDToTypeID( "Pnt " );
        desc48.putObject( idSkew, idPnt, desc50 );
        var idUsng = charIDToTypeID( "Usng" );
            var desc51 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc51.putUnitDouble( idHrzn, idPrc, -0.000000 );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc51.putUnitDouble( idVrtc, idPrc, 0.655242 );
        var idPnt = charIDToTypeID( "Pnt " );
        desc48.putObject( idUsng, idPnt, desc51 );
        var idIntr = charIDToTypeID( "Intr" );
        var idIntp = charIDToTypeID( "Intp" );
        var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
        desc48.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
    executeAction( idTrnf, desc48, DialogModes.NO );

    I know of this thread. but it didn't gave me any insight.
    To make it a little bit easier:
    Yellow: Box with 100x100 px dimensions. Doing a perspective transform (manually and listening with scriptListener) of 45°.Top Right Handle. The only values that have changed are die width (from 100% to 300%) and the angle (45°).
    Now, this is what the listener gets:
    var idTrnf = charIDToTypeID( "Trnf" );
        var desc6 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref4 = new ActionReference();
            var idLyr = charIDToTypeID( "Lyr " );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref4.putEnumerated( idLyr, idOrdn, idTrgt );
        desc6.putReference( idnull, ref4 );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc6.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc7 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc7.putUnitDouble( idHrzn, idPxl, 0.000000 );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc7.putUnitDouble( idVrtc, idPxl, 25.000000 );
        var idOfst = charIDToTypeID( "Ofst" );
        desc6.putObject( idOfst, idOfst, desc7 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc6.putUnitDouble( idWdth, idPrc, 150.000000 );
        var idUsng = charIDToTypeID( "Usng" );
            var desc8 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc8.putUnitDouble( idHrzn, idPrc, -0.000000 );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPrc = charIDToTypeID( "#Prc" );
            desc8.putUnitDouble( idVrtc, idPrc, 1.000000 );
        var idPnt = charIDToTypeID( "Pnt " );
        desc6.putObject( idUsng, idPnt, desc8 );
        var idIntr = charIDToTypeID( "Intr" );
        var idIntp = charIDToTypeID( "Intp" );
        var idbicubicAutomatic = stringIDToTypeID( "bicubicAutomatic" );
        desc6.putEnumerated( idIntr, idIntp, idbicubicAutomatic );
    executeAction( idTrnf, desc6, DialogModes.NO );
    Where are the values, that I've used manually? And how can I use this Script to do something like 20°, for instance?

  • SDO_LENGTH vs Mapviewer Distance Tool

    Hello All
    we have an issue related with sdo_length function
    Using distance tool i take the length of my lenear geometry , and it shows 62.568 YARD , by using following sdo_length query i got different answer 78.09 .
    select SDO_GEOM.SDO_LENGTH(st.OGC_GEOMETRY, m.diminfo,'unit=YARD') from STRAND st, user_sdo_geom_metadata m where ST.XFM_ID=157146
    is there anything wrong with my spatial query .
    Please help me

    That explains it. 3785 is a projection system. The length result returned by sdo_length is the Euclidean distance in the projection system, which is usually not very accurate. The oracle maps client calculates distance in a more accurate way. It first transforms coordinates in 3785 into lat/lon and then calculates the great earth distance between them. If you do the same with sdo_length, you should get the same result.
    Edited by: Ji Yang on Dec 9, 2010 6:14 AM

  • Distance calculation with the help of mappoint and sql server integration services

    How to use mappoint 2011 with SSIS 2012 to calculate the distance between two zip codes? is there any process to calculate the distancein ssis?

    SSIS being an ETL tool (moving and transforming data) does not have native integration with mapPoint, nor it exposes any 'Geo' functions to operate on geometry or geoshape data.
    I imagine to achieve what you need SSIS should not be used solely, if you can read the ZIP codes then you can calculate the distance in C# (say) code which in turn can be used in SSIS Script Task if needed: http://www.wiredprairie.us/blog/index.php/archives/688
    Arthur
    MyBlog
    Twitter

Maybe you are looking for