|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: New Vision sample program
Is there a Netbeans plugin update? So far it looks like the CriteriaCollection, which is used in the Java sample code, doesn't exist.
|
|
#2
|
|||
|
|||
|
Re: New Vision sample program
Quote:
If your Netbeans isn't set to update every startup/day, go into the Plugins and Reload the updates page. |
|
#3
|
|||
|
|||
|
Re: New Vision sample program
We're doing something very similar to the sample code (thresholding, convex hull, particle analysis), and finding it takes about a second to process each image on the cRio--far too slow for automated targeting.
Has anyone else been able to get the code to work onboard, with acceptable performance? Thanks, Steve (software mentor for team 649) |
|
#4
|
|||
|
|||
|
Re: New Vision sample program
Hi,
We copied the sample code into our project and are using the sample images provided. When we run it we get zero particles found. I added some extra code to print a particle report after every image operation and find that there are particles before the final filter is run(see below). I also had a question about the following lines: Code:
cc = new CriteriaCollection();
cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_WIDTH, 30, 400, false);
cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_HEIGHT, 40, 400, false);
a) crop the entire image to the described rectangle and return particles in the cropped area. b) only return particles that fit in the size of described rectangle, so search entire image for particles that fit. Here's the code and output. I am using 10ft2.jpg in this example output. I also tried the other xxft2.jpg images and got the same result, the last filter found zero particles. Code:
BinaryImage bigObjectsImage = thresholdImage.removeSmallObjects(false, 2);
printParticleReports("bigobj", bigObjectsImage);
// fill in occluded rectangles
BinaryImage convexHullImage = bigObjectsImage.convexHull(false);
printParticleReports("convexhull", convexHullImage);
// find filled in rectangles
BinaryImage filteredImage = convexHullImage.particleFilter(cc);
printParticleReports("filtered", filteredImage);
Quote:
|
|
#5
|
|||
|
|||
|
Re: New Vision sample program
Turns out someone had changed the low R param of the RGB filter (from 25 to 40) while switching between our green light filter and sample's red light filter. I changed it back to 25 and was able to run the sample code in our robot project and find targets. Once that worked we are guessing that the criteria lines add a filter that looks for particles that are in the size range 30,40 to 400,400.
Code:
cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_WIDTH, 30, 400, false);
cc.addCriteria(MeasurementType.IMAQ_MT_BOUNDING_RECT_HEIGHT, 40, 400, false);
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|