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

Similar Messages

  • How to measure the distance using script

    Hi
    Is there any way to measure the distance of any photoshop document using the measure tool, by using the script. Given below the steps required by me. Hope i'm clear in my communications.
    I searched the forums but couldnt find any suitable answers.
    1.Open Photoshop document
    2. Allow the user to draw the line using measure tool
    3. alert the distance
    Rgs
    Anish

    Michael L Hale wrote:
    Sorry maybe I wasn't clear. If you want the angle reported by the script to match what would be reported if the user used the line tool you do need to make the path left to right.
    That would only be half right as you can use the ruler measure tool from left to right and right to left a full 360 the angles reported will be in the range of 0 to +|-180 if you limit it to left to right the angle range will be from +90 to -90.
    I understand your statement for "var ang = (180/Math.PI) * Math.atan2(o,a);" will only generate the angle for a right triangle 0 through 90.   That is why I wrote the sign was an indication of direction meaning up or down but the problem is that there are two -45 and two +45  the other directiom left or right is only known by the line tool user. I do not understand path points you use lineStart[1] < lineEnd[1]to find out up or down perhaps some other comparison can find out left or right and then adjust the angle if to the right by to the range from +|-90 to +|-180.
    I think I did it now matches the line tool left to right or right to left the angle now matches the ruler measure tool when ruler unites is set to pixels
    // enable double-clicking from Mac Finder or Windows Explorer
    #target photoshop // this command only works in Photoshop CS2 and higher
    // bring application forward for double-click events
    app.bringToFront();
    // ensure at least one document open
    if (!documents.length) alert('There are no documents open.', 'No Document');
    else {
              main(); // at least one document exists proceed
    //                            main function                                  //
    function main() {
              // declare local variables
              var orig_ruler_units = app.preferences.rulerUnits;
              app.preferences.rulerUnits = Units.PIXELS;          // Set the ruler units to PIXELS
              try { alert(measureLine(app.activeDocument.pathItems.getByName("Work Path"))); }
              // display error message if something goes wrong
              catch(e) { alert(e + ': on line ' + e.line, 'Script Error', true); }
              app.preferences.rulerUnits = orig_ruler_units;          // Reset units to original settings
    //                           main function end                               //
    //the code below is for the Line tool.
    function measureLine(path){
              var res = new Array;
              var lineStart = path.subPathItems[0].pathPoints[0].anchor;
              var lineEnd = path.subPathItems[0].pathPoints[3].anchor;
              var a = Math.max(lineStart[0],lineEnd[0])-Math.min(lineStart[0],lineEnd[0]);
              var o = Math.max(lineStart[1],lineEnd[1])-Math.min(lineStart[1],lineEnd[1]);
              var c = Math.round(Math.sqrt((a*a)+(o*o)));
              //alert("Triangle Height = " + o + " Width = " + a + " Hypotenuse = " + c );
              res.push(c);
              var ang = (180/Math.PI) * Math.atan2(o,a);
              if(lineStart[0] > lineEnd[0]){//To the left
                        ang = 180-ang;
              if(lineStart[1] < lineEnd[1]){//Down
                        ang = -ang;
              res.push(ang);
              return res;
    Message was edited by: JJMack

  • Can i measure moving distance using after effects?

    can i measure moving distance using after effects?

    I don't know what you mean. If you mean take measurements like you can in Photoshop and relating them to the real world then the answer is not easily. No Effect I know of allows you to do that. If you mean measuring the distance in pixels a layer moves on any axis, yes you can measure that and display the result using an expression by either referring to a valueAtTime of a keyframe or a layer marker. For a layer marker for example showing the X distance a layer moves starting at first layer marker you would add this expression to the source text of a blank text layer. The moving layer would be named "target."
    t = thisComp.layer("target");
    mp = t.marker.key(1).time;
    ip = t.position.valueAtTime(mp);
    np = t.position[0] - ip[0];
    Math.round(np)
    If the layer is moving left to right and the marker is in the middle of the layer then the numbers will be negative until the marker is reached, zero at the marker, then positive after the marker is past.

  • Problems for measures the distance in my ipod nano 6 generation.

    Problems for measures the distance in my ipod nano 6 generation.
    I test take the ipod en my waist, in my wrist (clock), and i have calibrated the ipod often.
    Any solution for this problem?
    Many thanks.

    He iPod most likely died or broke on its own

  • Too many pixels distance between iview and Desktop Innerpage

    Hi,
    how can I configure the distance in pixels between iviews on a page and the desktop innerpage? In my case, the distance is around 20 pixels from iView tray to TLN. Anyone?
    Bye
    Christoph

    Yikes! Sounds like your computer is having a difficult time rendering the icons. Fortunately there are steps you can take.
    If it were me, I'd boot into Single User Mode (power off, power on, then hold Command + S till you see white on black text).
    I'm making a couple of assumptions here. The first is that you want to delete all these RAR files for good. The second is that these files are all named similarly, something like rar1, rar2, rar3, etc.
    Then type the following:
    /sbin/mount -uw /
    cd /Users/yourusername/Desktop
    rm -rf rarname* (NOTE: here, this is assuming all the files start with something similar, like 'rarname', and then have a number on the end. By using the wildcard (*), we don't have to type each filename, as 'rarname*' applies to every file on the Desktop that starts with 'rarname'. Hopefully that makes sense! Just replace 'rarname' with whatever the files start with. If you aren't sure, before this command, type 'ls' and you'll get a list of all the files on the Desktop.)
    This should permanently delete all the files on the desktop. You can then type 'reboot' and the computer will start up normally. Good luck! If anything is unclear, feel free to let me know before attempting this.

  • ?to math guru's  how to find pixel distance of this polynominal

    i have the following question
    i need to find the distance of the polynominal
    in order to step thru time correctly so i am ploting
    exactly 1 pixel per step of time.
    i need to know the distance of the curve before i plot it.
    in the following a = time; time steps thru .0 to 1.0 on a value i specify
    and b = 1 - time;
    A xyz is the starting position and D xyz is the ending position
    B and C affect the curve.
    i need to figure out exactly how many pixels are moved thru so
    i dont under plot and do not plot extra points that are not required.
    X = (int)( Ax*(b*b*b) + 3*Bx*(b*b*a) + 3*Cx*b*a*a + Dx*(a*a*a) );
               Y = (int)( Ay*(b*b*b) + 3*By*(b*b*a) + 3*Cy*b*a*a + Dy*(a*a*a) );   
               Z = (int)( Az*(b*b*b) + 3*Bz*(b*b*a) + 3*Cz*b*a*a + Dz*(a*a*a) );very much thanks for any help even if you dont know the solution
    any advise on the terminology that i can look up for what the solution
    to this type of problem is called i never even finish algebra in high
    school and i am teaching myself as i go along.
    however i dont know the correct terminology for the solution i am seeking.

    Am I right in thinking you want to evaluate the line
    integral?
    JohnIf we were talking about a continuous line, then yes, a line integral gives you the length of the line.. However, I think he wants to calculate the number of pixels that approximate the line, to display it with finite fixed pixels on the screen.
    Picture this: A straight horiz. line from (0,0) to (99,0) is 100 units long, and 100 pixels. a 45 degree angle line from (0,0) to (99,99) is 100*sqrt(2) in length (which a line integral would tell you), but still requires 100 pixels to draw, ie (0,0), (1,1), (2,2), ...... (98,98), and (99,99). Expand to 3D space, draw a line from (0,0,0) to (99,99,99), you get even longer of a line, but STILL 100 pixels..
    Since we're talking polynomials here, we can be sure that the function is 1 to 1 and continuous.. Since pixels are at a finite spot, we know that (except for a small set of straight lines) the pixels won't be on exact coordinates of the function.
    What you'll end up doing is starting at the beginning of your range, and plotting the closest pixel to that point. Now find the pixels next to the one you just plotted that is closest to the line and plot it.
    For a 2D polynomial, assuming normal cartesian coordinates, and that you're starting at the lowest x (far left), you could choose any one of 5 pixels (up, up and right, right, down and right, or down). You may have to arbitarily pick one if you get a situation where 2 pixels are equidistant to the function. Plot that point, and repeat until finished.
    If you expand method this to 3D space, you'll have to choose the pixel in a 2D plane that (depending on your perspective) makes the pixel LOOK like it's at that 3D point. Ie, a straight line sticking straight towards you could be any length, but appear as one pixel, since they're all kind of on top of each other in your 2D view. The number of pixels now depends on your position, so you'd need that info to determine for 3D.
    So, in response to your post, you dont have enough information to solve the problem in 3D space, and for 2D, you have to plot it like I said above, put a counter in there, and you'll know how many pixels when you're finished. I can't think of a way to determine before you plot.

  • Health app not measuring walking distance

    The health application is working perfectly for step counting,but does not measure correctly the waking distance.The problem began at 11 or 12 of March,I think after the iOS 8.2 update.Before this date it worked absolutely fine.So everyday I have an average of 5.500 steps and of 0.17km

    nappin,
    Mine seems to be working much better now. I find that there is often a lag of up to 15 minutes between the data being taken and the time it shows up in the app.
    I one instance, it shows that I climbed a flight of stairs at 10:03, but it was not added to the health app until 10:15. For other data the two times match.
    I don't know why your data does not display on the dashboard. Perhaps you can find an answer in some of the other threads on this topic.

  • Screen caliper for Linux (gCaliper)

    Hi ARCH'ers,
    i've created a screen caliper / ruler for Linux to measure pixel distances with variable rotation, written in C#, using GtkSharp2. I was inspired by a proprietary windows product, and i found no equivalent application for Linux (most of them are only simple rulers), so i decided to implement one for Linux. gCaliper is 100% open source, of course.
    Even if it seems that this is a simple application, it takes several days to implement this app, because using GTK was absolutely new for me. I do not use WinForms, because it needs WIN32 api calls to create shaped forms.
    Maybe someone could help me to create a DEB and RPM package. And i need to know where to place/register the app icon for the application launcher. (/usr/share/icons/...?)
    Suggestions are very welcome!
    By the way: The theme is customizable without recompiling the source.
    https://aur.archlinux.org/packages/gcaliper/
    https://github.com/Arakis/gcaliper
    Last edited by Arakis (2014-06-21 21:28:09)

    Arakis wrote:Maybe someone could help me to create a DEB and RPM package.
    I'm really not qualified - but I've received lots of help on the same question.
    You may want to see the following threads + wiki page:
    https://bbs.archlinux.org/viewtopic.php?id=175409
    https://bbs.archlinux.org/viewtopic.php?id=182198
    https://wiki.archlinux.org/index.php/Us … tributions

  • Set reference point in objects and measure distance

    1) How can I set the reference point in objects?
      for example:  
            a) exactly in the center of a pad or a via
            b) exactly in any corner of the board outline
    2) How can I measure the distance of two points with the maximum accuracy?
      for example:
            a) measure the distance between two pads or via
            b) measure the lenght of a line

    dear Semaphore, thanx for your response.
    I already use the ways that you refer me, but like this I can't measure with accuracy, or setting the zero reference is not guarantee that I set it exactly in the center of via or pad.
    With grid seted in smallest option is difficult to target the center of a pad, and also is difficult to target the point in the edje of a line with accuracy. With ruler I also have the same problem, I cant be sure that the ruler is pointing exactly to the center of a via or pad.
    That I need is a kind of a snap option to attach the mouse-cursor exactly in the center of an object, that can help me to target exactly in the center and have an accurate measurement or accurate set the zero reference without mistake.
    Any other suggestion for accurate measurements?

  • [Help] Webcam Image distance measurement?

    Hello, 
    I got a project which i have to finish by friday , but i m stuck and i dunno how to do it ?
    i have a A4tech webcam and i want to capture images from that camera to labview and then measure the distance of things shown in the image from the webcam. any help would be appreciated .. if u dunno how to measure distance can u tell me something other than that which is closer , like how much each colour is there in the picture , actually i want to demonstrate a webcam and some measuring stuff.
    Any help will be appreciated.
    Thanks in advance

    Hehe, good luck with your project
    M3rcY wrote:
    ... if i want to measure the amount of colours in the snap how to do it ? for example, i took of photo of mine , i have black hairs , so how to measure how much black colour is in the snap in total ? 
    For this, I would recommend 'IMAQ ColorMatch'
    You can find it here:
    Vision & Motion >> Image Processing >> Color Processing >> IMAQ ColorMatch
    It takes an input of an image, and a color (along with other things)
    and outputs a "score", where a score is 0, no match, to 1000, perfect match
    Message Edited by Cory K on 04-02-2009 11:46 AM
    Cory K

  • How can i measure distance ?

    i am making afire fighting robot that us camera to detect the fire i made the vi which find the fire through match pattern but now i want to measure the distance between the camera (which on th robot ) and the fire (which located in the image using match pattern) so how can i measure this distance?
    khaledyr 

    Ok... this is sad, I should be asleep now instead I'm here thinking about this problem.
    I've worked out how to do the distance caluclation with no extra H/W and only 1 camera - as Henrik said, the standard solution is triangulation, but you just want to measure distance, so I'm going to assume you're already pointing in the right direction.
    Assumptions:
    1) It is usual to use triangulation to to measure intenisity, this is because light will have 2 different distances to travel from source to sink.
    2) It is possible to use 1 sink if you use mirrors to increase the path of the light so you can have 2 seperate source -> sink distances.
    3) having 2 cameras (sinks) next to each other, one covered with a physical filter would have the same effect as the amount of light reaching the 2 sinks from the source will be different.
    ... following on from 3, it can be assumed that taking 1 image and applying 2 levels of filtering to it before processing will give the same result as if we had 2 different images. Careful setting of the software filter level will then allow it to remain contstant and then the system can be calibrated just as any other system would be calibrated:
    Measure the intensity of the source from sink A at distance X
    Measure the intensity of the source from sink B at distance X
    Measure the intensity of the source from sink A at distance Y
    Measure the intensity of the source from sink B at distance Y
    If Y=2X the calibration calulation is easy....
    Hope this provides more food for thought.
    James
    P.S. Lynn - currently a firefighter and worked for the emergency services ehh? Always good to see your posts when you have something to add. (Firefighter / Software programmer - what's the difference?)
    Message Edited by James W on 04-22-2010 10:56 PM
    Message Edited by James W on 04-22-2010 10:56 PM

  • Why pixels are not corresponding to the size I want?

    Hello,
    Recently I've detected a problem in my Adobe Illustrator CS6.
    I open the software, define the art board area in pixels (I checked it at Preferences > Units), but when I export my images they become bigger than they are.
    Example:
    This is an image 10x10 pixels, exported at Photoshop (everything is ok here):
    This is an image 10x10 pixels, exported at Illustrator.... much bigger!
    Here it is the options chosen at preferences:
    And what appears in work area:
    Does anyone knows what is going on? What can I do to solve this?
    Please tell me something. This way is hard to work...
    Thanks in advance.
    Best regards,
    Inês Guilherme

    Maybe, just guessing here, the resolution set for the photoshop doc was 72 and the one for illustrator 300?
    No, no, no. There is no "resolution" setting for a native Illlustrator file like that for a raster image.
    When uisng a program like Illustrator, FORGET PROGRAMS LIKE PHOTOSHOP. They are entirely different things and you're just confusing yourself.
    Inês,
    In a program like Illustrator, the page rulers refer to real-world units of measure when the document is printed. A pixel is NOT a real-world unit of measure. Ask yourself 'How big is a pixel?' or 'How many pixels is it from Earth to its moon?' Those are nonsensical questions. A pixel can be any size, because a pixel is nothing but a color value. Thinking of pixels as distance is like thinking of colors as distance. How many colors is it from where you live to New York City?
    When you work in a program like Photoshop, you are basically working within a SINGLE RASTER IMAGE. That single raster image has a fixed number of pixels. That's why Photoshop's rulers can make sense when they are set to pixels; they are not using pixels as a measure of distance; they are using pixels as a COUNT of pixels.
    But when you work in a program like Illustrator, you are NOT working in a single raster image. You are working within a model of a region of physical measure (a page) which can contain vector-based paths (which have no pixels), vector-based text (which has no pixels) and any number of MULTIPLE raster images.
    Each of those MULTIPLE raster images on the page has its own independent number of pixels, and its own independent scale, AND its own independent position (which doesn't even have to correspond to any whole increment of the rulers; the sides of those raster images on the page may be positioned BETWEEN the "pixels" indicated on the rulers).
    So in a program like Illustrator, you can have an image which contains 225 pixels across (or any other number, and another image which contains 25 pixels across (or any other number). Both of those images may be scaled on the page to the same UNIT OF MEASURE dimension. For example, both of those images may be scaled to one inch in width. The rulers, if set to "Pixels" would indicate that they both "measure" 72 "Pixels" across. But they would still contain different numbers of pixels, regardless of how many "Pixels" Illustrator's rulers indicate they "measure".
    Now given those very basic differences between what you're actually doing in a program like Photoshop and what you're doing in a program like Illustrator, what can the page rulers in Illustrator possibly mean when they are set to "Pixels"? Illustrator's rulers ALWAYS refer to a real unit of MEASURE, not to a mere COUNT of "Pixels." So when Illustrator's rulers are labeled "Pixels" they still have to ACTUALLY correspond to some unit of real-world measure.
    And they do: When you set Illustrator's rulers to "Pixels" you are really setting them to "Points". A point is 1/72 of an inch.
    So when you have your rulers in Illustrator set to "Pixels" and you draw your 10 x 10 "pixel" square, you are really drawing a 10 x 10 POINT square. And assuming you drew it as a path, it has no pixels whatsoever. It doesn't become rasterized until you either invoke the Rasterize command, or until you export it to a raster format. When you export it as a raster image, the only way the resulting image will actually contain 10 x 10 pixels is if you export it at a resolution of 72 pixels per inch.
    In other words, because Illustrator's rulers ALWAYS assume a scale of 72 pixels per inch when it uses "Pixels" as a bogus unit of measure, then you have to specify 72 PPI at the time of export if you want the number of pixels in the resulting raster image to correspond to the bogus "number of pixels" indicated by Illustrator's rulers.
    JET

  • Video pulse(width and count) train measurements

    We need to measure the sync pulse's width in a video signal to first determine the occurrence of the vertical sync pulse in each field, and then we need to count the successive horizontal sync pulse edges in order to arrive at a specific video line.
    Are there better suggestions on how to arrive at a particular video line in the video signal?

    Do you want to do image acqusition and acquire the image from your camera for display/analysis purposes or do you just want to measure the distances between pulses. If you do want to acquire your images from the camera, you won't need to worry about measuring the distances, the driver will take care of all these details and just return the pixel values to you that occured during the active time of VSYNC and HSYNC on the edge of the clock.
    If you do want to measure the timing of your HSYNC/VSYNC/pixel clock, etc. I would recommend a 6602 counter timer board. The DAQ people can give you more info on this.
    Hope this helps,
    Brad Buchanan
    Image Acquisition
    National Instruments

  • X-Y pixel location of cursor

    How do you see the X-Y pixel location of the cursor in Lightroom 3.4?

    Chuck,
    Did you ever consider using a tape measure and measuring the distance?
    If you don't have access to the installation a kitchen counter is 36" high. This is the standard. I think you can extrapolate from there.
    Most vents will require about 30 to 36" to reach the attic space.
    Print the photo on plain paper so the distance from floor to ceillng is 8". This will give you someting to measure.
    My Pop was a carpenter and a lot rubbed off.
    Rich

  • Pixel coordinate​s along a ROI (line)

    Hi
    Problem: Calculating distance using "distance formula" for all the pixel points along a line on an image.
    I am grabbing images using a camera and then using "ROI line.vi" , to define a line as region of interest.For that I have to provide,initial and final coordinates of the line (pixels) , then I use ROI transform.vi to rotate this line about a point which is one of the ends of the line.This way I get a new line (ROI) and using "ROI to line" I get the pixel coordinates of two ends for the rotated line.
    Now I want to get the distance between two points on a line and for that I need the pixel cooridinates for the whole line.Does someone know how to get this ? or is there any better way of doing this?
    And yah I am using 100 pixels = 34.29 mm to convert pixel distance into mm.Is it correct ?
    Is it possible to switch on and off a bulb/electrical appliance using lab view ? Just want to try this out for fun ....
    Thanks a lot !
    Deepak
    LAB View 2010 SP1

    Hey Deepak,
    To answer your questions, I am assuming that you have the Vision Development Module installed, especially if you are using some of the Vision functions already (that you mentioned). Now, what I understand of what you are trying to do, it sounds like you already have the two endpoints of the line, and you want to get the pixel points in between to be able to make measurements on those. So if you already have the two end points of the line, then I would recommend you check out the following functions: IMAQ LineProfile.VI or IMAQ GetPixelLine.VI. The help documentation on these two will tell you more details about them, but basically you can get the values of the pixels on a line. Then once you have the other points and their values, you can do either use the IMAQ Caliper functions to measure distances on the line, or perform your own calculations using simple LabVIEW functions (like add, subtract, divide, etc.).
    You also mentioned something about converting pixel values to real world values. You can use the Calibration VI's in order to calibrate your image, and also use some of the other functions like IMAQ Convert Pixel to Real World.VI. If you don't want to use the Calibration functions, then you can perform your own conversion, again using simple LabVIEW functions.
    Last, for your question about switching on/off a light bulb or some other electrical appliance using LabVIEW, I would have to mention that LabVIEW can control electrical components, but usually with the help of some kind of hardware. Some hardware that I could think of would be some kind of electrical switch hooked up to a DAQ (data acquisition) board that can do either digital or analog output. Another option would be to use some 3rd party hardware and communicate with LabVIEW via some kind of protocol, such as serial, TCP/IP, modbus, Datasocket, etc. etc.There are numerous ways you can go about having LabVIEW control things via hardware.
    I hope these answers help. Please let me know if you need any clarification on anything. Thanks, and have a great day.
    Regards,
    DJ L.

Maybe you are looking for

  • Error Transmitting the message to endpoint -Received HTTP response code 401

    Hello Experts,   I am having a SOAP to Proxy scenario. We are using HTTPS without client Authentication. Everything is running fine and well set on DEV system. After transporting to Test system, i am getting error as : Error Transmitting the message

  • JDBC to IDOC using BPM

    Hi Experts, I am doing the scenario JDBC to IDOC Note: i need a solution without stored procedures My requirement is , in sender JDBC side 1) We need to select data from 3 tables from the DB ( I think we can do this by JOIN query specified in the cha

  • JSplitPane, JScrollPane and JTree resizing

    Hi, In a JSplitPane, I have, in the left part, a JScrollPane, containing a JTree and, in the right part, I have an other panel. When I click on different nodes in the JTree, the width of the left part changes, so the JSplitPane separator moves. How t

  • Gmail labels and firefox 3.6.8

    == Issue == I have another kind of problem with Firefox == Description == Hello, When I go to apply a label to one of my gmails, I can point to the label wait till it highlights then drag it to the gmail I want to label. That's the way it's supposed

  • Is it possible to restore music and videos deleted by itunes

    as the title states is it? today i updated my ipod touch to 1.1.5. and i have jailbroken it before but the jailbrake was gone so i decided to go and back up my music on my brother's laptop which already had itunes on my account of his laptop. but whe