Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
1.50/5 (5 votes)
See more:
all details and problem about my project
my project is money recognition by mobile (android)
the mobile (client )is capture image and send it to computer (server)
in server i used open cv library (C#) the SURF algorithm
this is algorithm input to image (modelimage,observableimage) and it is searching
modelimage at observableimage
now my problem is
i have 10 image (modelimage) i want ((condition)) if first modelimage not found in observableimage return false and try with second modelimage and do this until find modelimage(any one ) in observableimage and return true
after that send number image (1,2,3.....) to mobile for say 10,50,100,.....
please noted all processes do on computer(server)
this is my code
XML
//extract features from the object image
      modelKeyPoints = surfCPU.DetectKeyPointsRaw(modelImage, null);
      Matrix<float> modelDescriptors = surfCPU.ComputeDescriptorsRaw(modelImage, null, modelKeyPoints);

      watch = Stopwatch.StartNew();

      // extract features from the observed image
      observedKeyPoints = surfCPU.DetectKeyPointsRaw(observedImage, null);
      Matrix<float> observedDescriptors = surfCPU.ComputeDescriptorsRaw(observedImage, null, observedKeyPoints);
      BruteForceMatcher<float> matcher = new BruteForceMatcher<float>(DistanceType.L2);
      matcher.Add(modelDescriptors);

      indices = new Matrix<int>(observedDescriptors.Rows, k);
      using (Matrix<float> dist = new Matrix<float>(observedDescriptors.Rows, k))
      {
         matcher.KnnMatch(observedDescriptors, indices, dist, k, null);
         mask = new Matrix<byte>(dist.Rows, 1);
         mask.SetValue(255);
         Features2DToolbox.VoteForUniqueness(dist, uniquenessThreshold, mask);
      }

      int nonZeroCount = CvInvoke.cvCountNonZero(mask);
      if (nonZeroCount >= 4)
      {
         nonZeroCount = Features2DToolbox.VoteForSizeAndOrientation(modelKeyPoints, observedKeyPoints, indices, mask, 1.5, 20);
         if (nonZeroCount >= 4)
            homography = Features2DToolbox.GetHomographyMatrixFromMatchedFeatures(modelKeyPoints, observedKeyPoints, indices, mask, 2);
      }

      watch.Stop();
   }

   //Draw the matched keypoints
   Image<Bgr, Byte> result = Features2DToolbox.DrawMatches(modelImage, modelKeyPoints, observedImage, observedKeyPoints,
      indices, new Bgr(255, 255, 255), new Bgr(255, 255, 255), mask, Features2DToolbox.KeypointDrawType.DEFAULT);

   #region draw the projected region on the image
   if (homography != null)
   {  //draw a rectangle along the projected model
      Rectangle rect = modelImage.ROI;
      PointF[] pts = new PointF[] {
         new PointF(rect.Left, rect.Bottom),
         new PointF(rect.Right, rect.Bottom),
         new PointF(rect.Right, rect.Top),
         new PointF(rect.Left, rect.Top)};
      homography.ProjectPoints(pts);

      result.DrawPolyline(Array.ConvertAll<PointF, Point>(pts, Point.Round), true, new Bgr(Color.Red), 5);
   }
   #endregion

   matchTime = watch.ElapsedMilliseconds;

   return result;
}
Posted
Updated 21-Apr-14 4:13am
v5
Comments
Member 10757783 18-Apr-14 2:26am    
i read question about money bill recognition but i did not find any thing useful for my
i use object detection not OCR
and thank you again
First of all, you need to explain what techniques or algorithms you have tried already. That would give us some idea about your problems. So, please Improve your Question and add more information.
Member 10757783 20-Apr-14 5:02am    
okI use open cv library with c#
and the algorithm name is surf for detect object
and now i stopped on one thing
tomorrow i will put here my code program and my problem and all details
thank you very much
Member 10757783 21-Apr-14 9:24am    
all details and problem about my project
my project is money recognition by mobile (android)
the mobile (client )is capture image and send it to computer (server)
in server i used open cv library (C#) the SURF algorithm
this is algorithm input to image (modelimage,observableimage) and it is searching
modelimage at observableimage
now my problem is
i have 10 image (modelimage) i want ((condition)) if first modelimage not found in observableimage return false and try with second modelimage and do this until find modelimage(any one ) in observableimage and return true
after that send number image (1,2,3.....) to mobile for say 10,50,100,.....
please noted all processes do on computer(server)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900