我做了一个使用 Tess-two 的项目,我想使用该方法pixConvertRGBToLuminance
,但它总是错误:
No implementation found for native Lcom/googlecode/leptonica/android/Pix;.nativePixConvertRGBToLuminance:(I)I.
我的代码Java是:
public static Pix pixConvertRGBToLuminance(Pix pixs){
if (pixs == null)
throw new IllegalArgumentException("Source pix must be non-null");
int nativePixd = nativePixConvertRGBToLuminance(pixs.getNativePix());
return new Pix(nativePixd);
}
我的代码 .cpp 是:
jint Java_com_googlecode_letonica_android_Pix_nativePixConvertRGBToLuminance(JNIEnv *env,
jclass clazz, jint nativePixs){
PIX *pixs = (PIX *)nativePixs;
LOGE("------------------>Failed to find native pixConvertRGBToLuminance File");
PIX *pixd = pixConvertRGBToLuminance(pixs);
return (jint) pixd;
}
Leptonica 的原始代码是:
PIX * pixConvertRGBToLuminance(PIX *pixs)
{
return pixConvertRGBToGray(pixs, 0.0, 0.0, 0.0);
}`
那为什么我总是有错?谢谢。