I am new to OpenCv and StackOverflow, and almost new to Android programming, so please excuse me if my question is stupid.
I am trying to match the image received from the camera with some image files to see which image file looks more like the camera image. So I use DescriptorExtractor.compute to get the key points of the file image and the camera image using SURF (I also tried SIFT) to match them, but ... the method applied to the file image always returns an empty list of key points, whereas if I use it on the camera image, I always get a non-empty list (an average of one hundred points). What bothers me most is that even when using the image itself downloaded from the camera first and then from the file, I get this behavior.
Could you help me figure out what I'm doing wrong? Here are some test codes (only for part of the file, but I use the same getKp method to extract key points from the camera).
public class HelloOpenCvActivity extends Activity { private static final int FILE_REQUEST = 400; ImageView img; TextView txt; Bitmap logo; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); img = (ImageView) findViewById(R.id.image); txt = (TextView) findViewById(R.id.kp); img.setOnClickListener(new OnClickListener() { public void onClick(View v) { chooseFile(); } }); } private void chooseFile(){ Intent fileIntent = new Intent(Intent.ACTION_GET_CONTENT); fileIntent.addCategory(Intent.CATEGORY_OPENABLE); fileIntent.setType("image/*"); startActivityForResult(Intent.createChooser(fileIntent,"prova"), FILE_REQUEST); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == FILE_REQUEST) {
Many thanks.
Ale
source share