Layer::MakePixelProfile
MakePixelProfile
Description
It computes a one pixel of the image or matrix, including, possibly, averaging over neignboring pixels, and the standard deviation of the neighborhood.
Syntax
int MakePixelProfile( int row, int col, OImageMakePixelProfileParams * pstParams, vector & vectOut, vector & vectOutAux = NULL )
Parameters
- row
- [input] the ros index of the pixel
- col
- [input] the column index of the pixel
- pstParams
- [input] additional information about how the profile determination ought to proceed:
- OImageMakePixelProfileParams::radius = the size of the radius around the pixel for averaging, etc. If 0, only the value at the pixel is returned.
- vectOut
- [output] the value for each frame at the pixel.
- vectOutAux
- [output] the standard deviation for each frame at the pixel.
Return
0 if success, otherwise FALSE.
Examples
EX1
void test_pixel_profile(int row , int col, double radius = 2.)
{
ImageLayer imglayer = Project.ActiveLayer();
if (!imglayer.IsValid())
{
out_str("Inavlid Active Window!");
}
WorksheetPage wkpg;
wkpg.Create("Origin.otwu");
wkpg.SetName("PixelProfile");
Worksheet wks = wkpg.Layers(0);
wks.SetSize(wks.GetNumRows(), 2); // two columns
Column colMain(wks, 0);
Column colAux(wks, 1);
colMain.SetLongName("Main");
colAux.SetLongName("Auxiliary");
Dataset dsMain(colMain);
Dataset dsAux(colAux);
OImageMakePixelProfileParams params;
params.radius = radius;
int nRet = imglayer.MakePixelProfile(row, col, ¶ms, dsMain, dsAux);
out_int("nRet = ", nRet);
return;
}
Remark
See Also
Layer::MakeLineProfile
header to Include
origin.h
|