IMAQ Particle Analysis Reports VI

Hello,
I have written a programme that can take an image, resize it, theshold it and generate an array of particle locations using the IMAQ particle analysis VI. The programme works fine but I was wondering if anyone can answer some questions I have regarding some of the details of how this VI works:
How does the IMAQ Particle Analysis Reports VI calculate the centre of mass of the particles? Naively I would assume it would be the same as the IMAQ Centroid VI which uses the formula x=Sum(x*PixelValue)/Sum(PixelValue), y=Sum(y*PixelValue)/Sum(PixelValue), however in this case it finds the centre of mass of the entire image and not of the individual particles. Does it therefore apply these formulas to automated regions of interest to generate the list of centroided coodinates for each particle or does it use an altogether different method?
Is this the fastest and most computationally efficient way to generate these list of centroided coodinates given that it also calculates several other parameters that I do not need?
Thanks so much! Any help would be greatly appreciated!
Justin     

Hi Justin,
I haven't been able to obtain the formula / algorithm that the VI uses but I found that the particle analysis example in CVI offers some insight into what the function is performing. I've copied the C code for your convience but I found it on this white paper http://www.ni.com/example/26517/en/  - 
Particle Analysis Examples. 
int CVICALLBACK ParticleAnalysis (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
switch (event)
case EVENT_COMMIT:
/* Make sure the user has thresholded the image */
if(!thresholdFlag) {
MessagePopup ("Image must be thresholded",
"You must threshold an image before performing the particle analysis.");
return 0;
/* This section of our code shows how to run a basic particle analysis.
imaqGetParticleInfo is used with the parameter IMAQ_BASIC_INFO to get
basic information on each particle in the image. It returns a pointer
to a structure array which contains all of the information for each
particle. Passing IMAQ_ALL_INFO instead of IMAQ_BASIC_INFO will run
a more detailed report on the particles, but will take longer to execute.
For more information on the report structure, see vision.h or the function
panel for imaqGetParticleInfo. */
/* Reset the max value for the control to (2^32)-1 so that consecutive runs
are not limited by the number of objects found in previous runs */
SetCtrlAttribute (panelHandle, PANEL_CURRENT_PARTICLE, ATTR_MAX_VALUE,
4294967295);
/* If we have already called imaqGetParticleInfo and thus created a particle report
we should dispose that report before creating a new one. */
if (particleRptExists)
imaqDispose (particleRpt_Ptr);
particleRpt_Ptr = imaqGetParticleInfo (thresholdImage, FALSE, IMAQ_BASIC_INFO, &particleCount);
particleRptExists = TRUE;
/* Simple user interface management - activate the particle report controls */
SetCtrlAttribute (panelHandle, PANEL_PARTICLE_COUNT, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_CURRENT_PARTICLE, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_AREA, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_CAL_AREA, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_TOP, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_HEIGHT, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_LEFT, ATTR_DIMMED,
FALSE);
SetCtrlAttribute (panelHandle, PANEL_WIDTH, ATTR_DIMMED,
FALSE);
SetCtrlVal (panelHandle, PANEL_PARTICLE_COUNT, particleCount);
/* Set the max value on the index control so that the user does
not try to access particle info for particles that do not exist */
SetCtrlAttribute (panelHandle, PANEL_CURRENT_PARTICLE, ATTR_MAX_VALUE,
particleCount - 1);
/* Simulate an event to immediately update report controls and reset the
report index to zero */
ViewReport (panelHandle, 0,EVENT_COMMIT,NULL,0,0);
SetCtrlVal (panelHandle, PANEL_CURRENT_PARTICLE, 0);
break;
return 0;
Kind Regards,
Lucas
Applications Engineer
National Instruments

Similar Messages

  • How to split the particle analysis report in order to extract one particular information(for eg. orientation)??)

    hi .. i need to extract the orientation and centroid information from the particle analysis report (image processing is done in NI Vision and then converted to labview vi) for further processing. However once processing is done in Vision ,after converting to labview vi the particle analysis report comes as 1D array of size 1 and thus am unable to extract one particular information from the report. Plz help!   

    duplicate

  • IMAQ Particle Analysis VI Ellipse Measurement Incorrect

    I've tested the particle analysis vi's numbers related to ellipse measurements with just a perfect circle and the numbers it produces are obviously incorrect. Is there anything wrong with this VI or something that has to be done before it works.
    I did this using the example, Particle Analysis Example and changed the following entry to display the ratio instead of the area and replaced the format into decimal into a format into float. The results are usually insanely off with ratios of 1.3+ or something while an actual circle should have a ratio of almost exactly 1. 
    I also noticed a lot of measurements even on simple shapes are wildly off target for some reason even with the example.

    I tested the equations and they are slightly misleading in the documentation the formulas do not match what the description of the solution is (pg 186).
    If you solve using the ellipse fitting results it returns the correct result but I don't know how the formula given in (pg 184) could ever solve the ellipse properly as it never results in valid numbers. (It as mentioned cannot handle the simple case of a circle having the same major/minor radius) Testing it against an actual dataset resulted in crazy numbers for things that are visably almost circular getting ratios of 1.5-2 which is non-sensical.
    If you compare this to another vision program ImageJ their measurement function for ellipse works fast and returns a valid result. I may try to use the forumla they use as it uses the calculated moments which I believe labview provides as well as I wanted to have an accurate and fast way to measure ellipse ratios but the fitting function in labview appears to take quite a bit longer than the particle measurement function.
    "In statistics, the measure that attempts to characterize some
      two-dimensional distribution of data points is the 'ellipse of
    concentration' (see Cramer, Mathematical Methods of Statistics,   Princeton Univ. Press, 945, page 283).", EllipseFitter.java
    The code they use doesn't seem to complex and it results in a ratio of 1.000 which is accurate enough.
    Attachments:
    Test.png ‏47 KB
    Test2.png ‏33 KB
    Test3.png ‏4 KB

  • How to extract X,Y-coordinates after Particle Analysis

    Hi there,
    I'd like to use Particle Analysis for a kind of motion detection. My problem is I can't get the information out...
    How do I get the X- and Y- coordinates (center of mass) of a particle (of a certain areal measurement in case there are more than one particle)?
    For example:
    Area between 100 and 150... What is X and Y
    Thanks for help

    Hello seasoo,
    Have a look at the attached vi.
    For your analysis, the IMAQ Particle Analysis Report vi will be appropriate. To get all the values you use the FOR loop except if you have a prior knowledge of the number of particles you will get. You then use the values as needed - compare to your range.
    Use the IMAQ Particle Filter 3 to isolate particles based on your criteria.
    Hope that helps.
    Attachments:
    oval 1.jpg ‏25 KB
    Untitled 1.vi ‏110 KB

  • How to select the particles after using the Particle Analysis

    Can I select the particles after the particle analysis directly, like chosing #1, #2 ..., or should I run the particle filter using the measured parameter?

    Hello Ishi,
    I now have a much better idea on what you are trying to do.  If you run the IMAQ Particle Analysis Report VI on the thresholded image that contains particles, an array of clusters will be returned that will contain specific information for each particle including the area, number of holes, bounding rectangle coordinates, center of mass, orientation, and dimensions. 
    To find out which particle is which in the image, index the Particle Reports (Pixels) output of this VI, unbundle the cluster to extract the Bounding Rectangle cluster, and then pass it to the Rectangle input of an IMAQ Overlay Rectangle VI.  This VI will overlay a bounding rectangle onto the image to show where the particle is located.  You can specify which particle you want highlighted by changing the array index of the Index Array VI that is responsible for extracting a specific cluster of particle information from the Particle Reports output of the IMAQ Particle Analysis Report VI.
    Regards,
    Mike T
    National Instruments

  • Help needed with particle analysis (getting the pixel area of each particle)

    Hello,
    I am using a camera vision system to capture particles which works fine.
    I am using particle analysis tool to get the number of particles and it also gives particle report.
    I want the area of each particle HOWEVER the problem is that currently it does it only for 3 or 4 particles which is not good, and the number of particles can vary in each frame.
    also please it currently gives pixel measurements can i change this to mm cm?
    i have attached the vi so pls help
    thank you
    Attachments:
    BarleyBreadver2.vi ‏121 KB

    hi,
    sorry my mistake - it sees all the particles but the particle analysis only gives the area of seeds in the frame. they should bea way to store the previous particle area.
    it will be clear what i am trying to do when you open the vi. i simply want the area of all the particles that pass through the camera system and put them in their appropriate size range.
    for example all the particles from 200-400 pixels. the final value can be shown in a table or just a variable.
    thankyou 

  • Purchase Analysis Report

    Hi Experts
    When I Run Purchase analysis report in SAP Business One 8.8 under individual vendor view the Open A/P Invoice (not done Payment) sowing 0.00 in the Applied amount and the purchase amount is showing negative value bacuse it is a credit memo - which is correct.
    But when I run the same report in my customer site who are running SAP B1 2005 PL 43, they are not seeing 0.00 in the applied amount instead they are seeing the same negative amount which is displayed in the purchase amount.which is not correct.
    Please assist me
    Thanks and regards,
    Vinodh
    Edited by: Paul Finneran on Oct 15, 2009 12:36 PM

    Hi Vinodh,
    You may check these threads to see if they have anything related to your question:
    Re: Purchase Analysis Report
    Purchase Analysis Report not shown.
    cant see Purchase analysis report of standard SAP B1
    Thanks,
    Gordon

  • Sales Analysis Report - Items -- blank result

    Hi,
    I'm testing a setup and running the sales analysis report. It works for the Customer version but I get no results when running on Items.
    I'm on SBO 2007A SP01 PL07. There are open and closed invoices for inventory items; no credit memos have been posted. All Item type invoices.
    When I run by Customer, I get the correct data - open and closed invoices for that customer.
    When I run by Items, I get no results. The date range is the same for both reports.
    When I run the purchase analysis on Items, I get data for the same items I am trying to see in the sales analysis.
    Any ideas what could be causing this?
    Thank you,
    Heather

    HI Gordon,
    I left the default settings: 
    - Annual Report, Invoices, Individual Display, No Totals
    - Posting Date:  whole fiscal year
    - Main selection:  left blank/default (group = all, no properties)
    I have double/triple/quadruple-check even the Secondary SElection to make sure there's nothing there.
    I have also run it on Due Date instead of Posting Date, still no results (if run on Items).
    As I mentioned, the selection criteria is what I want but for some reason that one version, Items, does not work. The other 2 tabs work with the same selection.
    Heather

  • Issue while opening the web analysis reports

    Hi,
    One of our user is not able to open a web analysis report with an error messages saying
    "Java.Lang.Exception: Unexpected HTTP status code of 500 received from server"
    "Document does not exist or no authorization to open the document"
    Other users with the same level of access are able to open the report fine and also the same user is able to access the report fine with a test id from his machine.
    What could be wrong? Any suggestions please.
    The only thing I see here, something wrong with userd ID or password.
    Thanks
    Prasad

    Hi,
    I had also faced this problem earlier. I was using HFM as data source for WA reports. After searching I found that there was some change at HFM level. Some dimensions/members had been deleted or added in HFM. And I was using those missing members in WA Grid.
    I had to recreate my reports again as I didn't get any other way to deal with this problem.
    Please shared any other alternative option, if you found while working on this issue.
    Thanks & Regards,
    Mohit Jain

  • Issue in Due date analysis report S_ALR_87012168

    Hi Friends,
    We have a strange issue regarding due date analysis report (S_ALR_87012168)...
    When i execute this report it displays different amounts in "Not Due" column under 0-30 bucket. In 0-30 bucket, under not due column it shows 10,000 and under total open items column it shows 15,000. How it is possible?
    Thanks to everyone
    Anifi

    Hi,
    This has been closed due to Local and Document currency prob...
    Thanks

  • Unable to open web analysis reports through workspace

    Hi,
    I am connecting web analysis with MSSQL server 2000 and generating reports. I am using essbase 9.3.1 version.
    But my problem now is that I can just open these reports from web analysis studio and cannot open them from workspace. In workspace, if I right click on the report and open it from web analysis studio it does open. But it does not open by double clicking the report in workspace. It just shows a blank report on just parts of the report.
    The issue is only there for the reports that are getting data from relational db (MSSQL server 2000). The other reports that are using the cube data are fine and opening from everywhere.
    Are there any other configuration settings involved in order to open a web analysis report(that uses relational db) from workspace?
    Thanks in advance,
    John

    Hi Atul,
    Try using the in built config checker:
    http://localhost:16000/WebAnalysis/config
    This has several tests you can perform to see what's running.

  • Stage Analysis Report Issue

    Hi,
    I have run a stage analysis report but it says no data inspite of open opportunities being present in the system. Could anyone kindly let me know what could be the issue?
    Regards
    Sharat

    Hi Sharat,
    Welcome you to the forum. Please close your first thread.
    Regarding your Stage Analysis Report Issue, what selection has been made? This report show closed opportunity only.
    Thanks,
    Gordon

  • Vendor master analysis report

    hi,
    what is vendor master analysis report? and how to create it?

    Hi
    This link may be useful
    http://help.sap.com/saphelp_47x200/helpdata/en/8d/b97fd2414511d188fc0000e8322f96/frameset.htm

  • Sales Analysis Report service warehouse wise

    Dear Experts,
    I've configured 4 service warehouses to an item  in SAP B1 8.8 PL:16.  And now I want to see sales analysis report of that particular item against each service warehouse. But from the Sales Analysis or purchase analysis report I can't able to see service warehouse wise sales quantity & amount.
    N.B.-Those items are created as Sales & Expense item only, no inventory.
    Plz help.
    Subrata

    Hi Subrata,
    in this case you need a customized report trough Query or through Crystal Report.
    regards,
    Fidel

  • Sales and Purchase Analysis reports by Item

    The current functionality of these reports is more like an open items list rather than an analysis report.
    If you Run a Purchase Analysis report by Item with a secondary selection of Supplier, and choose GRPO - the scenario is to find out how many of which products you have received in the date range from a specific supplier. This type on data is useful to use for negotiations on pricing etc.
    Currently, the report will only display values for GRPO that have not been drawn to AP Invoice. This is supposedly system functionality, but, the report is called analysis, so should provide data for that purpose?

    Hi,
    You may double click the column header to change the sort.
    Thanks,
    Gordon

Maybe you are looking for