|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2023-2-9 20:37:55
|
显示全部楼层
continue, please write c# code sample.
using Cognex.VisionPro;
using Cognex.VisionPro.CalibFix;
namespace WaferAlignment
{
class Program
{
static void Main(string[] args)
{
// Load the VisionPro library and create an instance of the CogAcqFifo class
CogAcqFifo cogAcqFifo = new CogAcqFifo();
// Set the image acquisition parameters
cogAcqFifo.OwnedVisionProTool = new CogAcqFifoTool();
cogAcqFifo.OwnedVisionProTool.Operator.Open(CogAcqFifoConstants.AcqFifoImageAvailableEvent);
// Acquire an image of the wafer and chuck
cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.SetAcqSize(1024, 1024);
cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.Start();
cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.OwnedLiveDisplay.Show = true;
// Process the image to determine the position of the wafer on the chuck
CogImage8Grey image = cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage;
CogPointMarker pointMarker = new CogPointMarker();
pointMarker.InputImage = image;
pointMarker.Run();
double waferX = pointMarker.Results.GetCogPoint().X;
double waferY = pointMarker.Results.GetCogPoint().Y;
// Calculate the deviation of the wafer from the desired position on the chuck
double deviationX = desiredX - waferX;
double deviationY = desiredY - waferY;
// Use the motor control system integrated with VisionPro to move the chuck
CogCalibFix calibFix = new CogCalibFix();
calibFix.InputImage = image;
calibFix.Operator.OwnedPositionerControl.Move(deviationX, deviationY);
// Verify the alignment of the wafer
cogAcqFifo.OwnedVisionProTool.Operator.OwnedImage.Start();
pointMarker.InputImage = image;
pointMarker.Run();
double newWaferX = pointMarker.Results.GetCogPoint().X;
double newWaferY = pointMarker.Results.GetCogPoint().Y;
if (newWaferX == desiredX && newWaferY == desiredY)
{
Console.WriteLine("Wafer is aligned!");
}
else
{
Console.WriteLine("Wafer is not aligned.");
}
}
}
}
Please note that this code is just a sample and may need to be modified based on the specific requirements of your application and the capabilities of your hardware. You may also need to consult the documentation and support resources provided by VisionPro to get a better understanding of how to implement these steps in your specific scenario. |
|