I can not give a complete answer to your question, because I'm not familiar with Neuronal Networks, but I can give you some ideas about ORB descriptors binary representation.
When you are detecting keypoints you can't do it with FREAK. But as FREAK paper describes you should detect keypoints with FAST corner detector and then describe it with FREAK. If you want to recognize objects by ORB descriptors, you should use ORB for both, for keypoint detection and for description. Note that ORB keypoint detection is also can be based on FAST. You can change it by altering parameter of scoreType
from OpenCV documentation. As you using android, you can set this parameter as described here
About binary string descriptors. I also needed them to implement descriptor matcher with MySQL query. As Mat in OpenCV-java has only double descriptor representation, I've implemented the method to transform them to binary. For this purpose, the Mat of descriptors should be transformed to List<Double>
. And you can use my function to obtain binary representation of descriptors. The function will return the List<String>
.
Here is the code:
public static List<String> descriptorToBinary(List<Double> desc){
List<String> binary_desc = new ArrayList<String>();
String desc_bin= "";
for(int i = 0; i < desc.size(); i++){
String binary_str_tmp = Integer.toBinaryString((int)((double)desc.get(i)));
if (binary_str_tmp.length() < 16)
{
int number_of_zeros = 16 - binary_str_tmp.length();
String str_tmp = "";
for(int t = 0; t < number_of_zeros; t++){
str_tmp += "0";
}
binary_str_tmp = str_tmp + binary_str_tmp;
}
desc_bin+= binary_str_tmp;
binary_desc.add(final_binary_str);
}
return binary_desc;
}
The returned list of strings will have the same size as list of MatOfKeyPoint
if you will transform it to List<KeyPoint>
So how did I verified if these descriptors are correct:
- I've matched original Mat descriptors with Bruteforce Hamming matcher as was said in ORB paper
- I've registered the distances returned by matcher.
- Then I've calculated distances distances between String descriptors of the same image.
- Verified if opencv's Hamming distances were the same as distances between String descriptors. They were the same, so conversion from Mat to List was well performed.
So binary descriptors associated to keypoints will look like this:
Picture 1: object1
keypoint1 : 512bit binary descriptor (1s and 0s)
keypoint2 : 512bit binary descriptor
keypoint3 : 512bit binary descriptor
...
Picture 2: object2
keypoint1 : 512bit binary descriptor
keypoint2 : 512bit binary descriptor
keypoint3 : 512bit binary descriptor
...
Now about Multi-Layer Perceptron. I can not help you with it. That is why I've told at the start that my answer is incomplete. But I hope the comments that I've given will help you in future to sole your problem.