Slowness of color pattern matching vi

Hi,
We're trying to implement a SLAM (simultaneous localization and mapping) algorithm in Labview based on kinect. In order to do so, the mapping robot should spot landmarks in real-time from the kinect image. We found the color pattern matching VI which does exactly what we need but the problem is that it's very slow (about 1.5 seconds for each image and total of 3 images each iteration). Is this the normal time for detecting landmarks in a kinect image? The robot can't map accurately when the iteration is so slow.
Thanks,
Rap Master
Attachments:
detect landmarks.vi ‏61 KB

Given that the pattern matching VI is an IMAQ (Image Acquisition) VI, this question will be best served by posting in our Machine Vision forums.
Blake C.
Applications Engineer
National Instruments
www.ni.com/support

Similar Messages

  • Color pattern matching is very slow

    Hi
    I tried this code creating one vi application.
    After the testing with USB webcam I have realized that the color pattern matching is very slow. How to increase the speed and to work smoothly in real time.
    Thank you

    Hello tiho,
    the color pattern matching is not as fast as 8-bit matching, but should still be fast.
    For example, I am attaching a VI for color pattern matching where you load the image, create the template and search do the matching.
    In my example I tried color pattern matching on color image of size 4288x2848 pixels and the matching is performed in ~140 ms (~7Hz). So, for a smaller image, I think the real-time processing is quite achievable (I consider real-time 20 Hz or more). The only problem is the template learning, which in my case takes around 10 seconds. But you should learn the template only once in the initialization stage.
    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."
    Attachments:
    color matching.zip ‏49 KB

  • Color pattern match in consumer producer architecture

    The way I currently have my code is as follows:
    If the number of matches in a color pattern match is greater than 0, it sends the information to the consumer loop.
    If it is not greater than 0, it doesn't send anything.
    What I was wondering is, if it finds a match the first time and it sends the information to the consumer loop, will the number of matches in the color pattern match return to 0 or will it be greater than 0 after the first match? If the number of matches in the color pattern match will be greater than 0 after the first match, and it will still be greater than 0, even though it doesn't find a match in the following scenarios, how can I make the number of matches in the color pattern match return to 0?

    Fernan1988 wrote:
    ... will the number of matches in the color pattern match return to 0 or will it be greater than 0 after the first match?...
    it's hard to say unless you can post your code....have you tried probing tool,retain wire value,highlight execution,single stepping into and out, breakpoints?

  • Problem while using color pattern matching

    Currently we are doing projects on real time object tracking where we found one doubt that irrespective of the object size whether this color pattern match works or not . My questions are as follows:
    1. Whether it is applicable for objects moving far . Because as it moves far, the size of the object decreases such that the color pattern matching is not working what will be solution since we must use color image
    2. What is the difference in using scale and  rotate invarient in color pattern matching
    3. How we can effectively decrease the ROI depending upon the object position as per below attached screen shots .
    we have removed boundary box values of X and Y coordinates at the four corner but we can't track as the object moves far away or we can't decrease the ROI as the object moves far.
    4. whether it is possible to see the value of particular pixel  in LABVIEW vision development module as we seen only the coordinate position . whether it is applicable to see particular pixel value. Guide us
    please, see the below screen shots and provide the solution how effectively decrease or increase  the ROI depending on objects position using color pattern match
    Attachments:
    problem in matching while object moves far.png ‏515 KB

    Hello,
    I have not been using the color pattern matching a lot (especially not in real-time). But since the pattern matching considers only small scale changes, you could try updating the color template every n-th iteration (depending on your setup and requirements). The major problem is the template size, since the color pattern matching tends to take quite a lot of time in learning the template. You would of course need to come up with some idea on how to change the subimage size, where the new template will be learned.
    This is the part of coarse (rough) object detection as was suggested by MoviJOHN. For example, if your object is distinctly red, you can extract the green channel from your rgb image and use threshold to roughly find the object and apply the new ROI - template.
    So:
    1. learn the template,
    2. use pattern matching with bounding rectangle (ROI) for the next couple of frames (you would need to experiment here where the detection fails -> how fast can you move the object away so that the detection fails),
    3. Before the detection fails -> rough object detection with some padded bounding rectangle (new ROI),
    4. Re-learn te template of new ROI and go back to 2.
    Again, the biggest issue is the template learning time - if you have a high resolution camera and the template is large, this won't satisfy your real-time application.
    You should set up the appropriate illumination first. The resolution is also important, since your object is moved back and forth (but the resolution will have a direct impact on the template learning time).
    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."

  • USB SNAP + colour pattern matching ( IMAQ)

    I am new to LAbView and currently  I am working on colour pattern matching with USB snap. My problem is this program keep prompt me on the IMAQ Learn Colour Pattern. I need someone to help me solve that problem.
    Another question is 'Are colour pattern matching require us to save and load file before learn a template?'
    I am using LabView 7.1 and I would appreciate anyone who help me. Thanks
    Message Edited by Chee Hou on 09-16-2009 03:46 AM
    Attachments:
    Untitled.vi ‏189 KB

    Hello Chee Hou,
    Have you tried to run the example to do color pattern matching?
    From the example, you do need to have a template picture ready when you are using the colour pattern matching.
    You need to Learn Colour Pattern and then load the pattern to do color pattern matching.
    Hope this helps.
    James
    - Meadow -
    LabVIEW 7.0 - 2011, Vision, RT, FPGA
    TestStand 3.0 - 4.5

  • Error -1074395395 occurred at IMAQ Match Color Pattern after merge programs

    Dear all
    I  have 2 separate programs that use same source image (red01a1.jpg). The first find location of color particles (color location 01.vi) and second find location of particles after threshold  color image (particle location 01.vi).  Both of them run good.  
    But when  2 programs were merged  into one program (color sorter 01i.vi), that happened error . The error message is “Error -1074395395 occurred at IMAQ Match Color Pattern”. How can I fix it ?
    Thanks  
    Solved!
    Go to Solution.
    Attachments:
    color sorter 01i.vi ‏126 KB
    Color -particle location.zip ‏86 KB
    red01a1.zip ‏86 KB

    Hi Xuan
    Check it out the attached vi
    Sasi.
    Certified LabVIEW Associate Developer
    If you can DREAM it, You can DO it - Walt Disney
    Attachments:
    color sorter 01i.vi ‏120 KB

  • Basic requirement for color histogram & pattern matching.

    I will do a student project about video & image(stored in PC) analysis using color histogram & pattern matching. I have LabVIEW6i only. What's the basic requirement for this analysis? vision module? Please suggest a simple and cheap requirement. Thanks all.

    It really depends what is the purpose of your student project. Is it about developing those routines yourself or is it about using ready made routines to research the possibilities and differences on different kind of pictures.
    In the first case you already have everything necessary as you can perfectly well develop those routines in normal LabVIEW. Otherwise you would want to look into the IMAQ Vision Toolkit from National Instruments or the IVision Toolkit from Hytek Automation http://www.hytekautomation.com/Products/IVision.html. You can download the IVision Toolkit free for evaluation it just will regularly show a nag screen to remember you that this is not a licensed version.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • SLOW pattern matching in VB, FAST in VisionBuil​der?????

    I've built several vision aquisition and analysis apps with VB and CWIMAQ. Now, I'd like to do a pattern matching application, however, I can't seem to get the same functionality and speed with the VB component as I can using VisionBuilder! Attached is a grayscale image of a microtiterplate, and a "pattern" of a well or "hole". Using pattern matching in visionbuilder there are about 96 matches, which is perfect, dang near a match for every well. However, if I try to reverse engineer the VB "FeatureFind" example and use the attached picture and pattern, the "Correlation" takes a VERY long time (14 seconds for VB featurefind app, instant for VisionBuilder), and it doesn't even match!
    Even though I can't use
    visionbuilder in my final application, it works almost perfectly when I use the attached image and pattern while setting the minimum score to 50. I wish I could implement the same thing in VB, that is, if NatInst could tell me the CWIMAQ components function calls used to implement it :-0)
    Any Ideas? Thanks
    Attachments:
    bw.tif ‏301 KB
    test_patt.png ‏57 KB

    I am not familiar with the VB commands you want to use since I use LabVIEW. However, I think you might be using the wrong function. It sounds like the example you tried to modify uses correlation, which is different from pattern matching. As you have seen, pattern matching is much faster and gives better results.
    I would assume that the manual for CWIMAQ would give you the information you need.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Vision assistant steps to be followed for pattern matching

    I am acquiring color images of hands movement using web camera of laptop.
    I want to process the acquired images to use for pattern matching.
    What are the steps to be followed to achieve the above mentioned task.

    In the following we proceed to function block search pattern extracted in the previous process (the parameters as rotation angle and minimum score is inserted into SETTINGS control), extract the output of the search function to get the position values indicators that will be displayed on the front panel)
    Atom
    Certified LabVIEW Associate Developer

  • Regular expression and pattern matching/replacing

    I have a list of key words. It has around 1000 key word now but can grow to 5000 keywords.
    My web application displays lot of texts which are stored in the database. My requirement is to scan each text for the occurance of any of the above keywords. If any keyword is present I have to replace that with some custom values, before showing it to the user.
    I was thinking of using using regular expression for replacing the keyword in the text using matcher.replaceAll method as follows:
    Pattern pattern = Pattern.compile(patternStr);
    Matcher matcher = pattern.matcher(inputStr);
    String output = matcher.replaceAll(replacementStr);
    But My pattern string will have around 5000 keywords with the 'OR' Logical Operator like- keyword1| keyword2 I keyword3 | ..........
    Will such a big pattern string adversly affect the performance? What can I do to speed up the performance? (Since my keyword list is not static i would prefer to do the replacement just before showing the text to the user)
    Any suggestions are most welcome.

    I don't think a pure regex approach would be that slow, but it would be a maintenance nightmare. I think a combined regex/table-lookup approach would be best: use a regex to identify potential keywords, then look them up in the table to confirm. For instance, to find all Java keywords you could use the regex "\\b[a-z]{2,12}+\\b" to filter out anything that can't possibility be a keyword.
    What are you going to replace the keywords with? Will it vary depending on which keyword is found? If so, you'll have to use a table--and you won't be able to use the replaceAll method, because it can't handle dynamically generated replacement values. You would have to use the lower-level appendReplacement and appendTail method instead.

  • Error imaq color pattern

    hi, I'm trying to do a draft color pattern recognition, but labview gives me this error, I hope you can help me, let the files, thank you very much
    Error -1074395384 occurred at IMAQ Match Color Pattern
    Possible reason(s):
    IMAQ Vision: Invalid color template image.
    Attachments:
    pastillas1.png ‏55 KB
    pastillas2.jpg ‏42 KB
    Parámetros de Búsqueda Color.vi ‏78 KB

    Hello,
    the general idea is:
    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."

  • Pattern matching using Regular expression

    Hi,
    I am working on pattern matching using regular expression. I the table, I have 2 columns A and B
    A has value 'A499BPAU4A32A386KBCZ4C13C41D20E'
    B has value like '*CZ4*M11*7NQ+RDR+RSM-R9A-R9B'
    the requirement is that I have to match the columns of B in A. If there is a value with * sign, this must be present in A like 'CZ4' should exit in string A.
    The issue I am facing is that there are 2 values with * sign. The code works fine for first match (CZ4) but it does not look further as M11 does not exist in A.
    I used the condition
    AND instr(A,substr(REGEXP_SUBSTR(B, '*[^*]{3}'),2) ,1)=0
    First of all, is this possible to match multiple patterns in one condition?
    If yes, please suggest.
    Thanks

    user2544469 wrote:
    Thanks a lot Frank. This query worked wonderful for the test data I have provided however I have some concerns:
    - query doesnot include the column BOOK which is a mandatory check.Sorry, that was my mistake. It was a very easy mistake to make, since you posted sample data where it didn't matter. Instead of doing a cross-join between vn and got_must_have_cnt, do an inner join, using book. That means book will have to be in got_must_have_cnt, and all the sub-queries from which it descends. Look for comments that say "March 22".
    If you want to treat '+' in test_cat.codes as '*', then the simplest thing is probably just to use REPLACE, so that when the table has '+', you use '*' instead.
    WITH     got_token_cnt     AS
         SELECT     cat
         ,     book                                        -- Added March 22
         ,     REPLACE (codes, '+', '*') AS codes                    -- If desired.  Changed March 22
         ,     LENGTH (codes) - LENGTH ( TRANSLATE ( codes
                                                       , 'x*+-'
                                      , 'x'
                             ) AS token_cnt
         FROM    test_cat
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     (  SELECT  MAX (token_cnt)     AS max_token_cnt
                 FROM        got_token_cnt
         CONNECT BY     LEVEL     <= max_token_cnt
    ,     got_tokens     AS
         SELECT     t.cat
         ,     t.book                                        -- Added March 22
         ,     REGEXP_SUBSTR ( t.codes
                         , '[*+-]'
                         , 1
                         , c.n
                         )          AS token_type
         ,     SUBSTR ( REGEXP_SUBSTR ( t.codes
                                       , '[*+-][^*+-]*'
                               , 1
                               , c.n
                   , 2
                   )          AS token
         FROM     got_token_cnt     t
         JOIN     cntr          c  ON     c.n     <= t.token_cnt
    ,     got_must_have_cnt     AS
         SELECT       cat, book                                   -- Changed March 22
         ,       COUNT (CASE WHEN token_type = '*' THEN 1 END) AS must_have_cnt
         FROM       got_tokens
         GROUP BY  cat, book                                   -- Changed March 22
    SELECT       mh.cat
    ,       vn.vn_no
    FROM       got_must_have_cnt     mh
    JOIN                    vn  ON  mh.book     = vn.book               -- Changed March 22
    LEFT OUTER JOIN      got_tokens     gt  ON     mh.cat                  = gt.cat
                                     AND INSTR (vn.codes, gt.token) > 1
    GROUP BY  mh.cat
    ,            mh.must_have_cnt
    ,            vn.vn_no
    HAVING       COUNT (CASE WHEN gt.token_type = '*' THEN 1 END)     = mh.must_have_cnt
    AND       COUNT (CASE WHEN gt.token_type = '-' THEN 1 END)     = 0
    ORDER BY  mh.cat
    - query is very slow with 60000 records in vn table. Cost is somewhere around 36000.See these threads:
    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting
    Relational databases were designed to have (at most) one piece of information in each column. If you decide to have multiple items in the same column (as you have a variable number of tokens in the codes column), don't be surprised if that makes things slower and more complicated. Most of the query I posted, and perhaps most of the time needed, is jsut to normalize the data. If you stored the data in a narmalized form, perhaps something like got_tokens, then you wouldn't need the first 3 sub-queries that I posted.
    Edited by: Frank Kulash on Mar 22, 2011 12:04 PM

  • How to use Colour pattern matching with a webcam

    Hi,
    I have a web cam which I am able to use successfully in labview (i.e.. Get images)
    I have looked at the colour pattern matching examples and tried to modify them, so that I can detect a red spot, that can be seen through the webcam, but have been unsuccessful. 
    In essence I'm trying to do real time colour pattern matching
    Can anyone steer me in the right direction? Or help me out?
    Thanks 
    Solved!
    Go to Solution.

    Hi kr121,
    I'm trying to work on color myself right now.
    What have you tried so far?  What type of web camera are you using?  I'm using a Microsoft Life Camera with LV 2011 on Windows 7.
    I started here:  http://zone.ni.com/devzone/cda/epd/p/id/5030
    If you are not using an NI camera I was able to get this to work using the cmd prompt and extracting the files manually to at least run the NI-IMAQ for USB: Snap and Save Image with USB Camera and NI-IMAQ for USB: Grab and Save Image with USB Camera examples.
    The command prompt command is:
     ni_imaq_usb_installer_86.exe /x
    Don't know if this is 100% correct but it at least allowed me to capture images and avi's.
    Regards,
    -SS

  • How do I set multiple pattern matching Vi's and make overlappin​g pattern matches to count as one?

    Hello! I'm a student and I'm currently making a project using pattern matching.
    My patterns are from chick foot/feet.
    I'm  created multiple pattern matching VI's to detect all the feet because I find it difficult/impossible to match all the feet with a single pattern/template.
    However, when using multiple pattern matching VI's some pattern matches detect the same foot, hence overlapping.
    So how can I make the overlaping pattern matches to be counted as one?
    Thank you in advance

    Thank you for replying Sir Zwired1.
    I'm still a newbie in using LabVIEW so pardon me if I can't understand fully
    The objective of my project is to detect all the feet through pattern matching and count the pattern matches made.
    "Keep a 2D array of counts, initialized to zero and the same size as your array of possible locations, and increment the value every time you get a match. If multiple pattern matching attempts result in a match a given location in your count array might be "3" but all you care about is if the number is greater than zero."
    I'm sorry, but how do you do this? BTW, I'm using vision assistant.

  • Trouble using a pattern match in the GO URL when the value starts with %

    Hi guys,
    We are trying to use a Go URL as follows:
    [http://hostname.com:9704/analytics/saw.dll?Go&Path=/users/administrator/Test/TestReport&Action=Navigate&col1=TestReport.SUBJECT&op1=like&val1="%25D8D8%25"|http://hostname.com:9704/analytics/saw.dll?Go&Path=/users/administrator/Test/TestReport&Action=Navigate&col1=TestReport.SUBJECT&op1=like&val1="%25D8D8%25"]
    Basically, we want to send the filter : SUBJECT like '%D8D8%' in the GoURL. However, the report that opens up does not fetch any rows because BI somehow messes up the clause by not recognizing the leading %25 (which is an escaped % character). Instead it resolves the %25D8D8%25 into something like �D8% .
    As you can see, the %25 at the end however gets resolved correctly but somehow the one at the beginning gets clubbed with the leading D8 to give �.
    Any idea, how to get BI to accept a leading escaped % character when doing a pattern match in the Go URL?

    I'm heading to the Apple Store in Danbury CT tomorrow to test out a MacBook Pro. I'll happily post what I like and dislike here.
    Waiting for a MacBook Pro...   Other OS  

Maybe you are looking for

  • Multiple World clock issues

    I travel from the U.S. to Tokyo and other Asian cities on a regular basis. Thus, have set a number major cities clocks. Problem is, They were entered in a random fashion as I visted each location. I would like to arrange them in a time zone sequence(

  • Constructing Calculated Measures in MDX for different measures using same columns in a fact table

    Hello, i have a fact table with 2 columns corresponding to dimensions Dim1, Dim2. In the same table i have 4 other columns Value_Type(int), INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string). There are a number of measures which are identified by

  • How does FYI work with AME

    Using AME - Approvals Management Business Analyst responsibility on R12.1.1, I enabled FYI under configuration variables => Allow for your information notification = yes; for the transaction type specific value Payables invoice approval. I set up a r

  • Are any "planned" enterprises/economies running SAP?

    If so, I'd be curious to know (not sure if social security/health care systems count in this category.) When the US defense sector first started considering SAP ten years ago, one question on everybody's mind was whether an ERP system could work if i

  • Is it possible to stream a video to an appletv and it's audio to an airport express?

    i have a hi-def tv with an apple tv connected to it. i also have an old (but good) receiver with 2 big speakers, they are connected to an airport express and i stream my music to them. does anybody know if i can use them as the speakers for the apple