從sources:
function SetImage($imagedata_or_pix,$width=null,$height=null,$bytes_per_pixel=null,$bytes_per_line=null) {
switch (func_num_args()) {
case 1: TessBaseAPI_SetImage($this->_cPtr,$imagedata_or_pix); break;
case 2: TessBaseAPI_SetImage($this->_cPtr,$imagedata_or_pix,$width); break;
case 3: TessBaseAPI_SetImage($this->_cPtr,$imagedata_or_pix,$width,$height); break;
case 4: TessBaseAPI_SetImage($this->_cPtr,$imagedata_or_pix,$width,$height,$bytes_per_pixel); break;
default: TessBaseAPI_SetImage($this->_cPtr,$imagedata_or_pix,$width,$height,$bytes_per_pixel,$bytes_per_line);
}
}
希望它可以幫助...