Find defects in a 3D image

Hello,
i'm working on a machine that uses a laser scanner to measure gears.
I acquire a XYZ points cloud for each tooth of the gear and i compare them with a "reference" point cloud that is my template, the result of this comparison is an image that represent the Z difference between source and template points cloud. The difference image has a dynamic of 0.3mm in Z using 256 gray levels, 128 grey if the difference is 0, values < 128 are "defects\hole" values > 128 are "defets\peack".
Now i have to develop the final part of the algorithm that discriminates real defects against noise (coming from measure error of gear itself).
I tried using threshold methods but doesn't work in a reliable way.
Attached a couple difference images that have defects
Thanks for any suggestion
Alessandro Ricco
ILVG.it - Italian LabVIEW user Group, ADMIN & LabVIEW Champion
Attachments:
diff.png ‏55 KB
diff11.png ‏56 KB

Hello Alessandro,
by seeding the values I meant that the segmentation procedure (GrabCut for example) needs an input labeled mask.
The options are:
1. Obvious background
2. Obvious foreground
3. Possible background
4. Possible foreground
For more information, you can check the OpenCV's GrabCut arguments explanation here:
http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#grabcut
You basically need to provide some information of the underlying pixels before running the algorithm. Same goes for example with GrowCut segmentation. I know there is a GrowCut segmentation algorithm written in Matlab, but not sure for OpenCV.
Here is a working .dll implementation of OpenCV's GrabCut algorithm in Labview:
https://decibel.ni.com/content/blogs/kl3m3n/2013/07/30/color-histogram-matching-and-grabcut-segmenta...
It uses a ROI rectangle, where all pixels outside the rectangle are considered as a positive background pixels.
Regarding the difference in the depth direction, you would need to display the 3D pointcloud after the ICP alignment and extract the Zbuffer  value from both pointclouds using the same viewpoint. You would basically just need to snap the depth image from the active viewpoint. PCL (point cloud library) has this option I think. This should be much faster than your approach.
See: http://pointclouds.org/documentation/tutorials/range_image_creation.php
This should work after aligning both pointclouds and using a proper sensor position. First, get the depth image of one pointcloud and then the other using the same parameters of the sensor orientation. Then you just calculate the difference.
I have not tried this, but I think it should work. If you are interested, I can try to (when I get the chance) build a .dll which can be called in Labview? That is if you don't beat me to it!
Hope this helps a bit.
Best regards,
K
https://decibel.ni.com/content/blogs/kl3m3n
"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."

Similar Messages

  • JS CS3 How can I find -and delete- anchored empty images frames

    I have a script that works fine with text,
    I need the same function, but find and remove anchored empty image frames
    thx
    var myDoc = app.activeDocument
    for(var myCounter = myDoc.textFrames.length-1; myCounter>=0; myCounter--)
    var myFrames = myDoc.textFrames[myCounter]
    if (myDoc.textFrames[myCounter].contents == ""){
    myDoc.textFrames[myCounter].remove()

    I'd do it this way:
    1. Grab the document's allPageItems.
    2. Iterate over it, ignoring text frames.
    3. Check to see: (a) if the parent is a character and (b) if the graphics collection of the page item is empty. If so, delete it.
    Dave

  • I am using a MacBook Pro.  I simply cannot find a way to attach images adjusted in Lightroom as attachments and/or without massive degradation in quality.  I follow the LR attach email process as specified by LR, the photos appear in the email seemingly e

    I am using a MacBook Pro.  I simply cannot find a way to attach images adjusted in Lightroom as attachments and/or without massive degradation in quality.  I follow the LR attach email process as specified by LR, the photos appear in the email seemingly embedded and the recipients of the email cannot save the attachment.

    You are welcome.  Just finished a chat session with an Apple support rep and confirmed the matte option no longer available.  Seems lots has changed since I bought my 17” 19 months back:).  They did say that there were after market screen films available from places like amazon
    Have never used anything like that though.  My wife has a 2008 MBP 15” with gloss and I can say it is a nice screen finish, you just have to be careful of lighting from behind you.  All my iMacs were glossy and I did learn to compensate for the added brilliance the screen brought to the photos.  The new soft proofing feature of LR5 seems to better estimate the level of brightness of the printed work, compared to past versions of the s/ware.
    In any case, in my opinion you really can’t go wrong with the apple product.  I bought my first iMac in mid 1999 and have never looked back.  I donated that machine to a pre-school in 2008, it was running OSX version 2 or 3 I think.  I did run Photoshop 7.0 on an IBM laptop for a time (windows XP).  I think I had one of the very first versions of Adobe Camera Raw on that machine.  I digress, sorry.
    The chat representative did confirm that the 17” is out of production and I’m guessing Apple found the market for the big laptop just wasn’t there.  They did mention that 17” MBP’s show up as “certified refurbished” units from time to time.  Suggest you might explore that option with a local Apple store in the UK, assuming  Apple has store front operations off this continent of course.
    Please feel free to contact me with further questions if you wish.
    Take care, Gordy

  • Deleting photos than don't display in finder - just an icon not image

    Hi
    I have plugged in an old hard drive today I have not used for a while to get some old photos from.  There are thousands on the drive, but I notice in finder than many of them display as .jpg icons in finder and not with an image of the photo.  To no surprise, they don't open either.  I think it might have been a problem with the drive they came from, but do have copies so not concerned.
    Is there any quick way of deleting these thousands of non-working images from my hard drive to clear out the debris so I am only left with working photos.
    Thanks in advance.
    Matt

    Rob Cole wrote:
    I whole-heartedly agree that although the big print giveth, sometimes the small print taketh away, DNG-wise.
    I certainly would not convert my raw files to dng then throw away the originals. If Adobe provided a "revert from DNG" function, I'd recommend people give DNG a try (and not toss the originals), but as it stands:
    (Adobe-converted) DNGs: great for limited, known, (usually Adobe-only) environments, but not for wholesale conversion of raws, not yet anyway (unless you don't mind locking yourself into an Adobe-only (or Adobe-mostly) software environment, in order to support "the cause").
    PS - In my opinion, you may be going a little too far with this one:
    BarryLevine wrote:
    This is fraud.
    but still - point taken.
    Rob
    "Adobe-only environments". Nope, sorry; that doesn't exist. Adobe makes software that runs on OSX and Windows.
    I will bet $50 that buried in the OSX Lightroom code is reliance upon Quicktime. Adobe could rectify this. It's a lack of will, not technology.
    I can be angry and upset but I will still use Lightroom because, in spite of this setback, LR produces DNGs that are smaller than TIFF and lossless PNG and produces better photos easier than other apps (including Aperture).
    ...and yes, I still believe Adobe's marketing is either fraudulent or just doesn't understand the technology.

  • Find dpi & Align center of Image

    Hi All,
    I have new request but struggling in the below points:
    1. Find less than 300 dpi image in the active document
    2. Create text frame and fix center of the image vertically and horizotally.
    Hope I completed the script by 90%
    Completed Script:
    var myGraphics = app.activeDocument.allGraphics;
    var targetResolution = 300;
    for (var i = 0; i < myGraphics.length; i++) {
        try
        if (myGraphics[i].effectivePpi[0] < 300) {
            var myPPI = myGraphics[i].effectivePpi[0] + " dpi"             //please ensure this line should be correct
            var myName = myGraphics[i].itemLink.name;
            var myPage = myGraphics[i].parentPage;
            var myCaption = myPage.textFrames.add();
            myCaption.textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN;
            myCaption.contents = "FPO\r" + myName + "\r" + "Low Res " + myPPI;
            var bnds = myGraphics[i].parent.visibleBounds;
            myCaption.visibleBounds = [bnds[2] + 3, bnds[1], bnds[2] + 6, bnds[3]];
            myCaption.fit(FitOptions.FRAME_TO_CONTENT);
            try {
                var myPStyle = app.activeDocument.paragraphStyles.add({name: "Caption_lowres", justification: Justification.CENTER_ALIGN});
            } catch (myError) {
                  myCaption.parentStory.appliedParagraphStyle = app.activeDocument.paragraphStyles.item("Caption_lowres");
            myPage.groups.add([myCaption, myGraphics[i].parent]);
    catch(myError)
    REQUIRED OUTPUT
    But Current Output using above script
    Thanks
    Beginner_X

    Hi Mr.Dave,
    Thank you for your response...
    I trying your code but I am not able to get the output.
    Could you help to get the output for me.
    var myGraphics = app.activeDocument.allGraphics;
    var targetResolution = 300;
    for (var i = 0; i < myGraphics.length; i++) {
        try
        if (myGraphics[i].effectivePpi[0] < 300) {
           var myPPI = myGraphics[i].effectivePpi[0] + " dpi"
            var myName = myGraphics[i].itemLink.name;
            var myPage = myGraphics[i].parentPage;
            var myCaption = myPage.textFrames.add();
            myCaption.textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN;
            myCaption.contents = "FPO\r" + myName + "\r" + "Low Res " + myPPI;
            var bnds = myGraphics[i].parent.visibleBounds;
            myCaption.visibleBounds = [bnds[2] + 3, bnds[1], bnds[2] + 6, bnds[3]];
            var center = {x : (bnds[1] + bnds[3])/2, y : (bnds[0] + bnds[2])/2}
            var capCenter = {x : (capbnds[1] + capbnds[3])/2, y : (capbnds[0] + capbnds[2])/2}
            myCaption.move(undefined, [center.x - capCenter.x, center.y - capCenter.y]);
             myCaption.fit(FitOptions.FRAME_TO_CONTENT);
            try {
                var myPStyle = app.activeDocument.paragraphStyles.add({name: "Caption_lowres", justification: Justification.CENTER_ALIGN});
            } catch (myError) {
                  myCaption.parentStory.appliedParagraphStyle = app.activeDocument.paragraphStyles.item("Caption_lowres");
            myPage.groups.add([myCaption, myGraphics[i].parent]);
    catch(myError)
    Help me to get output as per attached screenshot
    Thanks
    Beginner

  • Find text and replace with image - Help needed

    Hi,<br /><br />We need to place the images as inline in the appropriate places.<br /><br />texttexttext<<test1.eps>>texttexttexttexttexttext<<test2.eps>>texttexttexttexttexttext< <test3.eps>>texttexttexttexttexttext<<test4.eps>>texttexttexttexttexttext<<test5.eps>>text texttext<br /><br />This code is helpful for placing a single image at a time, we are unable to place all the images in one shot, can anyone help me out.<br /><br />I am not a programmer.<br /><br />-----------<br />var myDoc = app.activeDocument; <br />app.findPreferences = app.changePreferences = null; <br />var math=document.search("test.eps"); <br />for (i=math.length-1; i >=0; i--)<br />{ myDir = Folder.selectDialog(); <br />AllGraphics = Folder(myDir).getFiles('test.eps') <br />for (i=0; i<math.length; i++) { app.select(anil1[i]); <br />     myDoc.place(AllGraphics[i],false); } }<br />-----------<br /><br />Note: I have taken this code from forum and we have made some changes on this.<br /><br />Kavya

    Jongware,<br /><br />I try running it but gives errors:<br /><br />Error Number: 55<br />Error String: Object does not support the property or method 'changePreferences'<br />Line: 24<br />Source: app.findPreferences = app.changePreferences = null;<br /><br />This is the code I used<br /><br />// Find text and replace with image for InDesign CS3 <br />// http://www.adobeforums.com/webx?128@@.3bbf275d.59b6f012<br />var heyItsAnArray = new Array ( <br /><br />   "it contains this line!", <br /><br />   "as well as this one", <br /><br />   "or even more!", <br /><br />   "test.eps" ); <br /><br />for (arrayCount=0; arrayCount<heyItsAnArray.length; arrayCount++) <br /><br />{ <br /><br />   replaceImg (heyItsAnArray[arrayCount]); <br /><br /> } <br /><br />function replaceImg (name) <br /><br />{ var myDoc = app.activeDocument;  <br />     app.findPreferences = app.changePreferences = null;  <br />     var math=document.search(name); <br />     for (i=math.length-1; i >=0; i--)  <br />     { myDir = Folder.selectDialog();  <br />          AllGraphics = Folder(myDir).getFiles(name)  <br />          for (i=0; i<math.length; i++) { app.select(anil1[i]); <br />               myDoc.place(AllGraphics[i],false); <br /><br />               } <br /><br />          } <br /><br />     }<br /><br />Michael

  • Find fill colour frames in images

    Hi All,
    I am trying to find fill colour frames in images, my code is giving error as Object does not support the property or method "allPageItem"
    could anyone solve this please.
    var COLOR_NAME="color name string";
         var currentPageItem;
         for (var currentPageItem=0;currentPageItem<app.activeDocument.allPageItems.length;currentPageItem) {
              currentPageItem=app.activeDocument.allPageItem[currentPageItem];
              if ((currentPageItem instanceof Rectangle || currentPageItem instanceof Polygon)
                        && currentPageItem.contentType==ContentType.GRAPHIC_TYPE
                        && currentPageItem.fillColor==COLOR_NAME) { // do what you want
                    app.activeDocument.selection=currentPageItem;
                   alert("This box has fill color!!");
    Thanks in advance
    Steve

    Hi Chinna,
    Thanks for your reply, the code is working with your idea like
    var COLOR_NAME="Red";
    //~ var COLOR_NAME=app.activeDocument.swatches;
         var currentPageItem;
         for (var currentPageItem=0;currentPageItem<app.activeDocument.allPageItems.length;currentPageItem) {
             currentPageItem=app.activeDocument.allPageItems[currentPageItem++]
              if ((currentPageItem instanceof Rectangle || currentPageItem instanceof Polygon)
                        && currentPageItem.contentType==ContentType.GRAPHIC_TYPE
                        && currentPageItem.fillColor==app.activeDocument.colors.item(COLOR_NAME)) { // do what you want
                    app.activeDocument.selection=currentPageItem;
                   alert("This box has fill color!!");
    Now, how can I find a fill colour in images (all colours which applied in images), could you change it please.
    Thanks in advance
    Steve

  • Why does finder open up to all images

    Why does the finder window always shows all images?

    You can define which folder a new Finder window opens in Finder > Preferences > General tab > New Finder windows show:
    Regards,
    Captfred

  • How to find, select and delete duplicate images fro LR catalog?

    I'm on a MacPro, Leopard, LR v1.4.1
    How do you FIND duplicate files and remove them from the catalog?
    I had 12 images outside of a subfolder on a job. When I did a "synchronize folder" action it added those same 12 files to the catalog. I then physically moved the files into the correct folder - replacing the ones of the same name inside. Now I have 2 images of the same name in the catalog. I know I an choose them one at a time & Remove, but I can see this happening on a larger scale where I would want to Find All Dupes, then remove them.
    Same thing would happen if you imported from a folder or card that hadn't be formatted & forgot to check the "don't import suspected dupes" box.
    thanks!

    "I then physically moved the files into the correct folder"
    Precisely how? You didn't use Explorer/Finder, did you? Once images are in Lightroom, use Lightroom for moving files between folders. The best way to remove duplicates is to avoid having them in the first place.
    To get rid of existing ones, one way is to select those folders and save the XMP (Metadata > Save....) and then remove those folders from LR. Then import them again. Alternatively sort them by capture time and go through eyeballing them - use the reject flag to identify duplicates and then the delete rejects command.
    John

  • Finding Defects in Colored pixels

    Using NI Vision, I am trying to isolate and count and black and bright spots in the colored pixels
    Problem 1)
    I am current locating the pixels using shape dectection and using a mask smaller than the pixel size.  However, I would like to use the entire shape found(colored pixel) to mask the colored pixel.  Is it possible to mask the colored pixels based on the coordinates of the shape detection?
    Problem 2)
    If I mask the entire colored pixel the black/bright spots are difficult to find when thresolding the image because the center of the colored pixels are so much brighter than corners. If colored pixels are not uniform is there still a way to detect the defects?  Do I need to try extracting a different plane then threshold the image?
    Any comments or suggestions would be greatly appreciated,
    E
    Attachments:
    Find 4 Pixels3.vascr ‏6 KB
    1.PNG ‏386 KB

    Hi E,
    1) I saw you posted a Vision Assistant script. Are you using Vision Assistant in conjunction with LabVIEW? If so, the easiest option for you is going to be to detect those pixel rectangles using Vision Assistant, and then you can use those rectangles to create ROIs with IMAQ VIs in LabVIEW. At that point, you can either do your processing in LabVIEW with those ROIs, or use them to create smaller images from your original image which you can then feed into a second Vision Assistant VI, which could accomplish what you want. I've attached an example of creating ROIs from those squares.
    2) You could try extracting different planes. such as the HSV luminance plane. Also try applying different lookup tables, to see if that has any effect.
    Best,
    Dan N
    Applications Engineer
    National Instruments 
    Attachments:
    testROI.vi ‏118 KB

  • How do I find the dpi of an image in a pdf?

    I have created a pdf and have opened it with Adobe Reader XI. My book printer (prepress operator) tells me the images are coming out 100 dpi or less. I'm creating the pdf in a different way the second time. I need to check the dpi of images before I send to the book printer again. How do I do that?

    Is there any way to find the image dpi in a free or low cost program?

  • How to find out resolution of an image?

    Hi, all
    Most common image formats (DIB, JPEG, PNG, TIFF and perhaps others) store the resolution of the image in pixels per inch (or other, similar units). I haven't found a way to find out this information using the Java libraries. Neither the AWT image classes nor the snazzy JAI classes seem to read & store this information, let alone make it public.
    Is there a way to determine the resolution, short of poking through the header of the image data myself?
    Thanks
    - rick

    Here's the solution (hopefully no one else ever has to track it down - the documentation is very well hidden by Sun).
                             ImageInputStream imageInput = ImageIO.createImageInputStream( fil );
                             Iterator it = ImageIO.getImageReaders(imageInput);
                             ImageReader reader = null;
                             while (it.hasNext()) {
                                  reader = (ImageReader) it.next();
                                  System.out.println(reader.toString());
                             reader.setInput(imageInput);
                             ImageReadParam param = reader.getDefaultReadParam();
                             BufferedImage bimg = reader.read(0, param);
                             IIOMetadata meta = reader.getImageMetadata(0);
                             org.w3c.dom.Node n = meta.getAsTree( "javax_imageio_1.0" );
                             n = n.getFirstChild();
                             while (n != null){
                                  if( n.getNodeName().equals( "Dimension")){
                                       org.w3c.dom.Node n2 = n.getFirstChild();
                                       String s1, s2;
                                       while (n2 != null){
                                            if(n2.getNodeName().equals("HorizontalPixelSize")){
                                                 org.w3c.dom.NamedNodeMap nnm = n2.getAttributes();
                                                 org.w3c.dom.Node n3 = nnm.item( 0 );
                                                 float hps = Float.parseFloat( n3.getNodeValue() );
                                                 xDPI = Math.round (25.4f / hps);
                                            if(n2.getNodeName().equals("VerticalPixelSize")){
                                                 org.w3c.dom.NamedNodeMap nnm = n2.getAttributes();
                                                 org.w3c.dom.Node n3 = nnm.item( 0 );
                                                 float vps = Float.parseFloat( n3.getNodeValue() );
                                                 yDPI = Math.round (25.4f / vps);
                                            n2 = n2.getNextSibling();
                                  n = n.getNextSibling();
                             }

  • Erase option on find my iphone deletes whatsapp images and data

    Hi,
    i lost my iphone 4s on ios7. I had some personal images in whatsapp gallery . I used find my iphone app to erase the phone. i want o know will it erase all the whatsapp gallery chat images also. its very urgentas i need to delete those personal images

    All your data will be deleted, if you push the button to erase your iPhone.

  • Find a region in an image

    hi everybody
    i need to find a red region in an image . but i don't have any idea to do this as fast as possible . can u give any advices. i just need to find the beginning and the ending points of a red painted region in an image (there is only one red region)
    thanks

    i wanted to mean the "fastest method" while writing " as fast as" :)

  • How do I make image icons in finder window previews of the image?

    The image icons in my finder window are just generic jpeg icons (they are set to open automatically in Preview). How do I make them previews of the images themselves? When I "get info" on the icon, there is a very nice preview of the image - I would like to see the same quality preview in the icons themselves.
    Thank you very much for your help.
    Sam
    Powerbook   Mac OS X (10.4.6)  

    Hi Sam,
    From your Finder "View" menu (without a Finder window open) >> "Show view options" >> do you have "show icon preview" check marked? And with the Finder window open "show icons" and "show preview icons" checkmarked?
    EDIT: I may have misunderstood your question. If you're talking about the small file icons, not in the preview frame if you have PhotoShop it should do it with a save as PS file. Otherwise you may be able to paste the image but I'm not sure.
    -mj
    [email protected]
    Message was edited by: macjack

Maybe you are looking for

  • Mail Server Polling

    Hi In my senario Mail Adapter is Sender not a Reciever.... How do mail sever knows which mail has to send.... how to test my senario?

  • Won't print color

    1) I was given this printer as a gift about four years ago. The first time I got the "Low Ink"message,  I replaced fhe cartridges. Now it always tells me I'm low on ink, even after I've installed new cartidges. 2) Just installed a new set of cartridg

  • How can I know my Mac is not "hacked" by malware

    Opening a Safari window recently I got a message from an unknown source that somebodu wanted to become my sexbuddy. I was supposed to OK it which of course I didn't . Meanwhile all my functions in Safari were frozen. The only thing that worked was a

  • Unable to Backup iPhone - Disconnection Error

    I'm using 2.1 firmware on my iPhone 3G and iTunes 8. I have no problems syncing all my data to and from my iPhone. The only thing is I can't seem to get iTunes to back up my files!! Everytime I try to run a backup, iTunes tells me that my iPhone has

  • Embeding images from the foto album

    Hi I uploaded several gif-images in a teaming foto-album folder and tried to embed them in a landing page layout. I don't like to attach them becouse the html-code should be usable in other teaming locations to. So I tried to paste the permalink to t