1

私の英語は下手です)私はopencv v2.4.2を使用しています

Bitmap bitmap = BitmapFactory.decodeFile(mDefaultPath + name_s + type);
Bitmap mBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, false); 

Mat s_image = new Mat(); 
Utils.bitmapToMat(mBitmap,s_image);
Mat rgb0 = new Mat();
Mat o_image = new Mat();
MatOfKeyPoint points = new MatOfKeyPoint();

FeatureDetector surf0 = FeatureDetector.create(FeatureDetector.ORB);
surf0.detect(s_image, points);

Log.d(TAG, "Sum of keypoints "+points.toList().size());

Imgproc.cvtColor(s_image, rgb0, Imgproc.COLOR_RGBA2RGB);
Features2d.drawKeypoints(rgb0, points, rgb0);

Imgproc.cvtColor(rgb0, o_image, Imgproc.COLOR_RGB2RGBA);

Utils.matToBitmap(o_image, mBitmap);
Highgui.imwrite(mDefaultPath + name_o + type, o_image);

この操作の後、(ImageView で) 画面に通常の画像が表示されますが、sdcard のファイルでは青色効果のある画像が表示されます。

手伝って頂けますか?

4

1 に答える 1

4

imwrite関数は、渡された画像のチャネルの BGR 順序を想定しています。

于 2013-03-01T12:20:30.453 に答える