Profile Sampling¶
This code snippet shows how to set, retrieve and store the pixel values along a given line segment.
C++¶
#include <eVision/EasyImage/EasyImage.h>
using namespace eVision;
// Image constructor
EImageBW8 srcImage;
// ...
// Vector constructor
EBW8Vector profile;
// Get the image data along segment (10,510)-(500,40)
EasyImage::ImageToLineSegment(&srcImage, &profile, 10, 510, 500, 40);
// Set all these points to white (255) in the image
EasyImage::LineSegmentToImage(&srcImage, 255, 10, 510, 500, 40);
C#¶
using eVision;
// Image constructor
EImageBW8 srcImage = new EImageBW8();
// ...
// Vector constructor
EBW8Vector profile = new EBW8Vector();
// Get the image data along segment (10,512)-(500,40)
EasyImage.ImageToLineSegment(srcImage, profile, 10, 512, 500, 40);
// Set all these points to white (255) in the image
EBW8 white = new EBW8(255);
EasyImage.LineSegmentToImage(srcImage, white, 10, 512, 500, 40);
Python¶
import eVision
# Image constructor
src_image = eVision.EImageBW8()
# ...
# Vector constructor
profile = eVision.EBW8Vector()
# Get the image data along segment (10,512)-(500,40)
eVision.EasyImage.ImageToLineSegment(src_image, profile, 10, 512, 500, 40)
# Set all these points to white (255) in the image
white = eVision.EBW8(255)
eVision.EasyImage.LineSegmentToImage(src_image, white, 10, 512, 500, 40)