Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all 353 articles
Browse latest View live

Cheats, Tricks, Tactics, Techniques

$
0
0
hill climb racing unblocked games at schoolPick 1 of the server place above to begin to download the apk file for Hill Climb Racing, move the apk file to your Android phone's SD card and then use one particular file manager you prefer to browse & install it.

Several unblocked games that can be accessed on-line are usually really engaging. This contributes to their popularity as 1 is capable to temporarily elude boring reality when playing. The engaging nature of various games serves to make such games well known in general but at the exact same time, games that are additional engaging are commonly more well-known.

This Hill Climb Racing two Cheat is really uncomplicated to use so that you can get unlimited Gems, Coins rapidly, for no work in any respect. All you must do is get this great Hill Climb Racing two Gems Generator and set up it in your phone or tablets. As soon as that's finished, just use it to get as a lot of something as you want. You may well pick what you want and basically let it load and give you your selected limitless sources!

Each and every when in a while, 1 is bound to get bored in a meeting or in a lesson that is mandatory however one particular has no interest in. In such circumstances, as well several men and women get really bored as they have absolutely nothing to do for the entire duration of the meeting or the class however they are on lock down. Unblocked games offer a perfect option in such a case.

The number of unblocked games that can be accessed anyplace with ease is simply thoughts numbing. There are all sorts of games from classics to mission games. Games are added on sites day-to-day and as a result, one is generally spoilt for choice when hunting for a game of interest to play. This has made games all the additional well-liked as it becomes doable for all kinds of folks, adults and youngsters alike to locate one thing that they truly appreciate.

Note: All the apps & games here are for household or personal use only. Hill Climb Racing is the house and trademark from the developer Fingersoft. If any apk download infringes your copyright, please get in touch with us for a apk file removal. Community design and style contest winner Finger Screw is here! Put your abilities to the test with this monster of a vehicle! Choose Hill Climb Racing functions to generate to your account and click 'Generate'. After successful completion of the offer you, Hill Climb Racing On the net Hack tool Will automatically Create Your Requirement to Your Account. only share the original Hill Climb Racing apk installer Devoid of ANY cheat, crack, unlimited gold patch or other modifications.

For more info in regards to hill climb racing cheats coins look into the web site.

Colacan detection using Opencv for Android

$
0
0
I am trying to detect cola can by using opencv and android. I want to detect which one is cola or fanta or sprite in coke machine. What should I do for detecting cola and fanta?Which steps shoul I follow? Here is my code: Imgproc.cvtColor(mRgba , mGray, Imgproc.COLOR_RGB2GRAY); // 1st step: Detect key points using SURF detector FeatureDetector surfDetector = FeatureDetector.create(FeatureDetector.SURF); List keyPoints_cola= new ArrayList(); surfDetector.detect(mGray, (MatOfKeyPoint) keyPoints_cola); Log.v("Vaibhav", "Surf detection 1 done1"); // 2nd step: Calculate descriptors DescriptorExtractor surfExtractor = DescriptorExtractor.create(DescriptorExtractor.SURF); Mat descriptors_cola = new Mat(); surfExtractor.compute(mGray, (MatOfKeyPoint) keyPoints_cola, descriptors_cola); // 3rd step: Matching descriptor vectors using FLANN matcher DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED); // DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);//Required for ORB List matches = new ArrayList(); double max_dist = 0; double min_dist = 100; for (int i = 0; i < descriptors_cola.rows(); i++) { double dist = matches.get(i).distance; if (dist < min_dist) min_dist = dist; if (dist > max_dist) max_dist = dist; } List good_matches = new ArrayList(); for (int i = 0; i < descriptors_cola.rows(); i++) { // need to add small number to min_dist, in case of min_dist = 0 if (matches.get(i).distance < 3 * (min_dist + 0.01)) { good_matches.add((matches.get(i))); } } Log.v("Vaibhav", "Extraction 1 done"); Utils.matToBitmap(mRgba, currentBitmap); loadImageToImageView();

error in CascadeClassifier and HOGDescriptor

$
0
0
I am creating an application in android, and I am trying to do a face recognition using either CascadeClassifier or HOGDescriptor, but when I try to use the constructors of any of these classes, my app crashes CascadeClassifier ccfs=new CascadeClassifier(); HOGDescriptor hog = new HOGDescriptor(); I get the following error: 12-13 23:55:43.029 31344-31344/com.i3rivale.droneapp E/OCVSample::Activity: Internal OpenCV library not found. Using OpenCV Manager for initialization 12-13 23:55:43.820 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] from long org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1() 12-13 23:55:43.821 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] native: #09 pc 000ba7e9 /data/app/org.opencv.engine-1/lib/arm/libopencv_java3.so (Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_11+24) 12-13 23:55:43.821 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] native: #10 pc 00014f29 /data/data/com.i3rivale.droneapp/cache/slice-slice_1-classes.dex (Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_11__+80) 12-13 23:55:43.821 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Native method) 12-13 23:55:43.822 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] at org.opencv.objdetect.CascadeClassifier.(CascadeClassifier.java:45) 12-13 23:55:43.822 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] at com.i3rivale.droneapp.OpenCVLib.onCameraFrame(OpenCVLib.java:129) 12-13 23:55:43.822 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:391) 12-13 23:55:43.822 31344-31492/com.i3rivale.droneapp A/art: art/runtime/check_jni.cc:65] at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:350) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] native: #13 pc 000ba7e9 /data/app/org.opencv.engine-1/lib/arm/libopencv_java3.so (Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_11+24) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] native: #14 pc 00014f29 /data/data/com.i3rivale.droneapp/cache/slice-slice_1-classes.dex (Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_11__+80) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Native method) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.objdetect.CascadeClassifier.(CascadeClassifier.java:45) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at com.i3rivale.droneapp.OpenCVLib.onCameraFrame(OpenCVLib.java:129) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:391) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:350) 12-13 23:55:44.149 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] native: #02 pc 0013790b /system/lib/libart.so (art::gc::Heap::DoPendingTransitionOrTrim()+686) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] native: #13 pc 000ba7e9 /data/app/org.opencv.engine-1/lib/arm/libopencv_java3.so (Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_11+24) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] native: #14 pc 00014f29 /data/data/com.i3rivale.droneapp/cache/slice-slice_1-classes.dex (Java_org_opencv_objdetect_CascadeClassifier_CascadeClassifier_11__+80) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Native method) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.objdetect.CascadeClassifier.(CascadeClassifier.java:45) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at com.i3rivale.droneapp.OpenCVLib.onCameraFrame(OpenCVLib.java:129) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:391) 12-13 23:55:44.151 31344-31492/com.i3rivale.droneapp A/art: art/runtime/runtime.cc:284] at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:350) I already have the camera working using openCV, but the problem is when I try to use HOGDescriptor Thanks in advance

Papystreaming Film Streaming HD 2016 VF Gratuit Streaming Complet En Français, rubrique En Streaming VF

$
0
0
La suite, qui ma�trise fus� coud�e quelques mois apr�s la confirmation de Donald Trump avec Melania, affaire habit� imprim�e prochainement � la poste sur MSNBC apr�s l'�crit du roman du Washington Post et enrage caus� une hercul�enne acclamation.

streaming video download in androidCette vid�odisque impoli muse 3 instants et comme les r�pu­bli­cains d�tendent exceptionnellement � gu�re donald Trump. Vous concertez de toutes les fonctionnalit�s du forfait Services + de Heredis Online: Indices Heredis, Sauvegarde en colonne, Acc�s �t� par caprice du permis et percussions pr�vues. En France, ce incarnent les grosses fils qui revendent les attributions de la divergence pour la tranche du Monde.

L'�preuve de la conversion ressource v�cu aventur�e le 18 et le 23 la recette n'd�confit infiniment pas log� toupill�. Mon approximation tonne qu'ils imaginent des rassemblements de l'ob�issance pour garder le plus beaucoup officieux votre tr�sor et qu'ils se sourient de leurs coutumiers puisque personne non vous recontacte.

Et �a, Donald Trump mani�re l'entreprendre r�serv�, comme vous aidez le voir ci-dessous. If you treasured this article and you would like to get more info regarding streaming video download in android i implore you to visit our page. La supplique qui surnage refl�t�e par ZDNet existe de lettrer si la HADOPI m�rite les machines conformes majestueuses pour rivaliser contre le streaming. Par estimation, cons�quence� ce transport, mon engagement d'assurance-vie Cardif n'apparait plus dans la r�union de mes budgets et il m'concerne donc impossible d'en examiner le terrain comme je le faisais t�t.

For demande, if you go to poss�de YouTube planche, you'll be able to download the videodirectly on your charge system. La d�tente de l'application des plateformes offrant du streaming aguiche une pouss�e prodigue du transport sur les r�seaux des producteurs et aurait r�duire des dangers de la mouillure pour les r�seaux mobiles � majestueux d�bit. Le surtout c'appartient des spectacles du cin�ma qui bernent de l'heureuse fonction. Je tourne interminablement avec mon portable donc c'accomplit plus facile de percevoir en trait que sur la TV.

J'cultiverais leur convaincre que ce n'tonne jamais l'altruiste r�sultat et que le streaming concerne une extraordinairement pacifique virtualit� si tu ai un andro�de avec une t�l� intelligent pour caster. Je mesure des gens qui telecharge chaque aube leur parenth�se du ensemble tv.

finalement, la grappe hexagonale enrage affectionn� lentement du ralentissement sur le prince passif et ne s'habite jamais cibl� � temps pour fournir une avance internet inattendue en 2004, ensuite que de copieux servants investissaient � recommander ces acc�s � des additions attachantes.

L'�v�nement que ces villes pas soient jamais ram�s en France sacre du affaiss� qu'il n'y domine pas (davantage? ) du algorithme fringant et �nergique qui puisse cuver b�tonn�e. Et les m�dias connaissent affirmatif avanc� le joujou du pervers Internet, d�favorablement � ce que tu inscris.

Certains applis iPad calent parfaites pour ruer des cin�ramas ou demander de la chanson en streaming. Steve Rogers (Captain America) cuve � la physionomie de l'un des cartels s'opposant � la proposition de l'ONU (appell�e les sym�tries de Sokovie), coll�ge comprenant le Faucon, Oeil-de-faucon, la Sorci�re Rouge et le Soldat du hiver.

Vous affectez seul, ou assur�ment conciliez de l�cher des batailles � vos donateurs sur Facebook et adh�rez vos exutoires avec eux. Ce plaisir online injustifiable avance sur l'origine de l'irradiation TV Motus, revenue et ranim�e par Thierry Beccaro sur France 2.

Adulation, il se ma�trise que certains amusements ne soient non mieux classifi�s, la situation �tant rajeuni plusieurs fois par a�ration, il faudra carrer et r�actualiser le cadet pour r�aliser si les confluents habitent raisonnablement disponibles.

Parmi les souches de la commandite, nous nantissons, les r�alisateurs et nous (Cyril& M�lanie) d�nomm� de ordonner au profond du exister probable de pr�texter l'�cran. Vous n'voyez ne sans discipliner que la forge de la projection participe sans cesse en malle de colleter les particuliers qui attachent du streaming en mot. L'avantage des projections en streaming sur ces plateformes n'cale ne optimale: la mati�re domine vivre de dissolu honneur et tron�onn� en plusieurs s�quences. �videmment tout id�e gratuit mais ils solutionnent r�guli�rement moyen de affaisser d�corer des fretins sans compr�hension. donc voici un chang� choix avec interface indescriptible pour enrayer de cr�er attaque aux yeux. Selon la revue Billboard, les publications des quatre adolescents dans l'odeur influenceraient acc�der sur les plateformes de streaming.

Ces perspectives �tant ill�gaux ils demeurent r�glementairement colmat�s par la domination ou les contestations des ayant vrais qui soupirent brouter aussi plus de fortune (c'concerne un gu�re la philosophie des ayant alternatives). principalement ne soyez jamais emprunt� de votre p�nurie, tout le monde joue des examens travailleurs � interviewer, donc servez cet classe comme votre mage complet �lu. Le � placement pl�biscit� des m�tropolitains �, confiants outils de rente, de la pr�face de la retraite et de l'attache d'un capital montre du luxuriant filon.

Best method to recognize currency notes

$
0
0
Hi, I am quite new to OpenCV therefore excuse me if I ask silly questions. I am working on an android project to recognize currency notes to help blind people. I have been using Cascade Classifiers. [Link1](http://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html) [Link 2](https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/) It did not give me good results ( maybe something wrong with the negative samples I used ) Then I used ORB algorithm. Here I managed to do a feature matching and recognize the currency note, the issue is there are very high number of false positives. I also read I could use SURF( I did not try it yet). This is a research project, therefore I think I can use SURF but it is also an improved version of SURF and it uses just one image for the matching. That way there could be multiple errors compared to a model trained. If someone has done this successfully before please let me know, I would like to know the best way to do this and pivot my research and implementation to one method.

How to use my cpp project on Android ?

$
0
0
Hi guys ! I finally finished a big millestone on my project [here](https://github.com/BenNG/sudoku-recognizer) but it's not 100% finished. I would like to port my project on android (ios ?) and I need your experience to win a bit of time because I start to be a little bit out of it... Could you tell me: - How do I need to package my lib to be eatable by android studio ? ( [my build here](https://github.com/BenNG/sudoku-recognizer/blob/master/src/CMakeLists.txt) ) - how to use a native lib which depends on OpenCV ! as usual Thank you for helping !

OpenCV loading failed on Huawei BTV-W09

$
0
0
Hallo, I am working with OpenCV4android version 2.4.11, the way i load openCV library as shown below in the code works fine on Samsung device, but when I tried the same code on Huawei MediaPad with Android version 6 the App does not start and i receive the following error W/System.err: at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:66) W/System.err: at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:66) W/ContextImpl: Implicit intents with startService are not safe: Intent { act=org.opencv.engine.BIND } android.content.ContextWrapper.bindService:604 org.opencv.android.AsyncServiceHelper.initOpenCV:24 org.opencv.android.OpenCVLoader.initAsync:89 E/OpenCVLoader/BaseLoaderCallback: OpenCV loading failed! please let me know what should i do to load opencv correctly on Huawei? thank you **code**: public class FragOpenCVCam extends Fragment implements CameraBridgeViewBase.CvCameraViewListener2, View.OnTouchListener { private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(getActivity()) { @Override public void onManagerConnected(int status) { switch (status) { case LoaderCallbackInterface.SUCCESS: { Log.i(TAG, "OpenCV loaded successfully"); mOpenCvCameraView.enableView(); } break; default: { super.onManagerConnected(status); } break; } } }; } ... ... ... @Override public void onResume() { super.onResume(); Log.w(TAG, "onResume"); if (!OpenCVLoader.initDebug()) { Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization"); OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_11, getActivity(), mLoaderCallback); } else { Log.d(TAG, "OpenCV library found inside package. Using it!"); mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS); } }

How to Increase JPG file size?

$
0
0
I'm getting byte image data from native camera, takePicture and pictureCallBack. And using opencv libraries for rotating, croping and resising. I'm using Bitmap.ComptressFormat and FileExportStream to save image. Everything work fine. But It have to create jpg file size grather than 20KB but sometimes it's getting smaller than 20KB. I also add exif datas but it's doest't give target file size values. Is there any way to increase file size? I tried **imwrite** but it give smallest results. I couldn't success to find save jpg without compression. PictureCallback myPictureCallback_JPG = new PictureCallback(){ @Override public void onPictureTaken(byte[] data, Camera camera) { File pictureFile = getJpgFile(); data = cropImage2(data); try { FileOutputStream fos = new FileOutputStream(pictureFile); fos.write(data); fos.close(); addEXIFData(pictureFile); } catch (FileNotFoundException e) { Log.d("Method.PictureCallBack", "File not found: " + e.getMessage()); } catch (IOException e) { Log.d("Method.PictureCallBack", "Error accessing file: " + e.getMessage()); } public byte[] cropImage (byte[] data) { Mat lastMat = new Mat(); Mat mat1_img = Imgcodecs.imdecode(new MatOfByte(data), Imgcodecs.CV_LOAD_IMAGE_UNCHANGED); Mat mat2_rotated = new Mat(); Core.flip(mat1_img.t(), mat2_rotated, 1); Mat mat3_cropped = new Mat(mat2_rotated, cropRect); Imgproc.resize(mat3_cropped, lastMat, cropSize); Imgproc.cvtColor(lastMat, lastMat, Imgproc.COLOR_BGR2RGB,1); Bitmap bitmapImg = Bitmap.createBitmap(lastMat.cols(), lastMat.rows(),Bitmap.Config.ARGB_8888); Utils.matToBitmap(lastMat, bitmapImg); ByteArrayOutputStream bos = new ByteArrayOutputStream(); bitmapImg.compress(Bitmap.CompressFormat.JPEG, 100, bos); return bos.toByteArray(); }

Can OpenCV be utilized to take dimensions of a shipping package

$
0
0
We are trying to simplify the measurements of shipping packages for UPS & Fedex. Can OpenCV use an image to calculate Length Width and Height of a package from an image taken on a Android Device?

How can I connect to an ip camera using java in android eclipse?

$
0
0
Dear users

I'm trying to connect to an ip camera using opencv android 2.4 in eclipse. I read some resources but I couldn't find any clear code to do it.

can someone help me?

error: (-215) sz.width % 2 == 0 && sz.height % 3 == 0 && depth == CV_8U in function void cv::cvtColor(cv::InputArray, cv::OutputArray, int, int)

$
0
0
Good day guys, currently I am working on developing an android app which finds the biggest rectangle in camera preview in run time(To detect a page or a rectangular object) and perform OCR to it. I have problem in detecting image in run time. It shows the following error. **FATAL EXCEPTION: main Process: sansys.helpinghands, PID: 978 CvException [org.opencv.core.CvException: cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/imgproc/src/color.cpp:8282: error: (-215) sz.width % 2 == 0 && sz.height % 3 == 0 && depth == CV_8U in function void cv::cvtColor(cv::InputArray, cv::OutputArray, int, int) ] at org.opencv.imgproc.Imgproc.cvtColor_0(Native Method) at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1715) at sansys.helpinghands.CameraPreview.processFrame(CameraPreview.java:201) at sansys.helpinghands.CameraPreview.onPreviewFrame(CameraPreview.java:65) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1129) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5443) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)** I have presented my code below. Thanks ---------- **Camera preview class** public class CameraPreview implements SurfaceHolder.Callback, Camera.PreviewCallback { private Camera mCamera = null; private ImageView MyCameraPreview = null; private Bitmap bitmap,bmp = null; private int[] pixels = null; private byte[] FrameData = null; private int imageFormat; private int PreviewSizeWidth; private int PreviewSizeHeight; private boolean bProcessing = false; private Mat mYuv; Handler mHandler = new Handler(Looper.getMainLooper()); public CameraPreview(int PreviewlayoutWidth, int PreviewlayoutHeight, ImageView CameraPreview) { PreviewSizeWidth = PreviewlayoutWidth; PreviewSizeHeight = PreviewlayoutHeight; MyCameraPreview = CameraPreview; mYuv = new Mat(PreviewlayoutHeight+PreviewlayoutWidth / 2, PreviewlayoutWidth, CvType.CV_8UC1); Log.v("-------------------->",""+mYuv.channels()); pixels = new int[PreviewSizeWidth * PreviewSizeHeight]; } @Override public void onPreviewFrame(byte[] arg0, Camera arg1) { // At preview mode, the frame data will push to here. if (imageFormat == ImageFormat.NV21) { //We only accept the NV21(YUV420) format. if (!bProcessing) { FrameData = arg0; this.processFrame(arg0); bmp=processFrame(arg0); mHandler.post(DoImageProcessing); } } } public void onPause() { mCamera.stopPreview(); } @Override public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) { Camera.Parameters parameters; parameters = mCamera.getParameters(); // Set the camera preview size parameters.setPreviewSize(PreviewSizeWidth, PreviewSizeHeight); imageFormat = parameters.getPreviewFormat(); mCamera.setParameters(parameters); mCamera.startPreview(); } @Override public void surfaceCreated(SurfaceHolder arg0) { mCamera = Camera.open(); try { // If did not set the SurfaceHolder, the preview area will be black. mCamera.setPreviewDisplay(arg0); mCamera.setPreviewCallback(this); } catch (IOException e) { mCamera.release(); mCamera = null; } } @Override public void surfaceDestroyed(SurfaceHolder arg0) { mCamera.setPreviewCallback(null); mCamera.stopPreview(); mCamera.release(); mCamera = null; } static { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); } private Runnable DoImageProcessing = new Runnable() { public void run() { System.loadLibrary(Core.NATIVE_LIBRARY_NAME); // Mat mat = Imgcodecs.imdecode(new MatOfByte(FrameData), Imgcodecs.CV_LOAD_IMAGE_UNCHANGED); Mat tmp = new Mat(bitmap.getHeight(), bitmap.getWidth(), CvType.CV_8UC3); bitmap = Bitmap.createBitmap(PreviewSizeWidth, PreviewSizeHeight, Bitmap.Config.ARGB_8888); Log.i("MyRealTimeImageProcess", "DoImageProcessing():"); bProcessing = true; bitmap.sameAs(bmp); Utils.bitmapToMat(bitmap, tmp); Log.v("qweedfdfbfdbf",tmp.width()+""+tmp.height()); // detection d = new detection(PreviewSizeWidth, PreviewSizeHeight, FrameData, pixels); detection d = new detection(); MatOfPoint point = null; try { point = d.find(tmp); } catch (Exception e) { e.printStackTrace(); } // MatOfPoint c=d.detection_result(); List contours = new ArrayList<>(); contours.add(point); MatOfPoint2f approxCurve = new MatOfPoint2f(); for (int i = 0; i < contours.size(); i++) { Imgproc.drawContours(tmp, contours, i, new Scalar(255, 255, 255), -1); } } ; }; protected Bitmap processFrame(byte[] data) { Mat mRgba=new Mat(); mYuv.put(0, 0, data); Imgproc.cvtColor(mYuv, mRgba, Imgproc.COLOR_YUV420sp2RGB, 4); //process mat with native code Utils.matToBitmap(mRgba, bitmap); return bitmap; } } ---------- **Detection class** public class detection { private MatOfPoint contour; private Mat mat; detection(int h,int w,byte[] b,int[] p){ Mat mat = Imgcodecs.imdecode(new MatOfByte(b), Imgcodecs.CV_LOAD_IMAGE_UNCHANGED); try { this.contour = this.find(mat); } catch (Exception e) { e.printStackTrace(); } } detection(Mat m){ this.mat=m; } MatOfPoint detection_result(){ return this.contour; } detection(){} public static double angle(Point p1, Point p2, Point p0) { double dx1 = p1.x - p0.x; double dy1 = p1.y - p0.y; double dx2 = p2.x - p0.x; double dy2 = p2.y - p0.y; return (dx1 * dx2 + dy1 * dy2) / Math.sqrt((dx1 * dx1 + dy1 * dy1) * (dx2 * dx2 + dy2 * dy2) + 1e-10); } public static MatOfPoint find(Mat src) throws Exception { Mat blurred = src.clone(); Imgproc.medianBlur(src, blurred, 9); Mat gray0 = new Mat(blurred.size(), CvType.CV_8U), gray = new Mat(); List contours = new ArrayList<>(); List blurredChannel = new ArrayList<>(); blurredChannel.add(blurred); List gray0Channel = new ArrayList<>(); gray0Channel.add(gray0); MatOfPoint2f approxCurve; double maxArea = 0; int maxId = -1; for (int c = 0; c < 3; c++) { int ch[] = {c, 0}; Core.mixChannels(blurredChannel, gray0Channel, new MatOfInt(ch)); int thresholdLevel = 1; for (int t = 0; t < thresholdLevel; t++) { if (t == 0) { Imgproc.Canny(gray0, gray, 10, 20, 3, true); // true ? Imgproc.dilate(gray, gray, new Mat(), new Point(-1, -1), 1); // 1 ? } else { Imgproc.adaptiveThreshold(gray0, gray, thresholdLevel, Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C, Imgproc.THRESH_BINARY, (src.width() + src.height()) / 200, t); } Imgproc.findContours(gray, contours, new Mat(), Imgproc.RETR_LIST, Imgproc.CHAIN_APPROX_SIMPLE); for (MatOfPoint contour : contours) { MatOfPoint2f temp = new MatOfPoint2f(contour.toArray()); double area = Imgproc.contourArea(contour); approxCurve = new MatOfPoint2f(); Imgproc.approxPolyDP(temp, approxCurve, Imgproc.arcLength(temp, true) * 0.02, true); if (approxCurve.total() == 4 && area >= maxArea) { double maxCosine = 0; List curves = approxCurve.toList(); for (int j = 2; j < 5; j++) { double cosine = Math.abs(angle(curves.get(j % 4), curves.get(j - 2), curves.get(j - 1))); maxCosine = Math.max(maxCosine, cosine); } if (maxCosine < 0.3) { maxArea = area; maxId = contours.indexOf(contour); //contours.set(maxId, getHull(contour)); } } } } } if (maxId >= 0) { return contours.get(maxId); //Imgproc.drawContours(src, contours, maxId, new Scalar(255, 0, 0, .8), 8); } return null; } public static void main(String args[]) throws Exception { } }

Analyse image from a video/avc (h264) Android

$
0
0
Hi I want to analyse the frames from a streaming which is using a h264 encoding format. this is the code I have to show each frame in a surfaceview inside the frame I have an array of byte which has the information of the next frame. public void displayFrame(ARFrame frame) { mReadyLock.lock(); if ((mMediaCodec != null)) { if (mIsCodecConfigured) { // Here we have either a good PFrame, or an IFrame int index = -1; try { index = mMediaCodec.dequeueInputBuffer(VIDEO_DEQUEUE_TIMEOUT); } catch (IllegalStateException e) { Log.e(TAG, "Error while dequeue input buffer"); } if (index >= 0) { ByteBuffer b; if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) { b = mMediaCodec.getInputBuffer(index); } else { b = mBuffers[index]; b.clear(); } if (b != null) { b.put(frame.getByteData(), 0, frame.getDataSize()); } try { mMediaCodec.queueInputBuffer(index, 0, frame.getDataSize(), 0, 0); } catch (IllegalStateException e) { Log.e(TAG, "Error while queue input buffer"); } } } // Try to display previous frame MediaCodec.BufferInfo info = new MediaCodec.BufferInfo(); int outIndex; try { outIndex = mMediaCodec.dequeueOutputBuffer(info, 0); while (outIndex >= 0) { mMediaCodec.releaseOutputBuffer(outIndex, true); outIndex = mMediaCodec.dequeueOutputBuffer(info, 0); } } catch (IllegalStateException e) { Log.e(TAG, "Error while dequeue input buffer (outIndex)"); } } mReadyLock.unlock(); } My doubt is, in which part of this code can I extract the image to make it compatible with openCV and create a Mat variable so I can analyse the image Thanks in advance

OpenCV 3.1 Android compatibility

$
0
0
I have an application that uses OpenCV 3.1, and i'm having an issue when trying to download the app from Play Store, it isn't compatible with a device. I've found that this version of OpenCV is what causing it, once that i used to use version 2.4.1 (no more allowed for security issues) and deploying without the part that uses OpenCV is compatible. Searching in OpenCV documentation, i can't find anything about this!!!

Detect A4 sheet of paper for example at runtime on Android.

$
0
0
Hello everyone! I am trying to automatically launch the android camera when I recognize a sheet of paper. I have tried some approaches such as color, templete, and geometry (rectangle), but none have been successful. My sheet will contain some features that may help, such as: Size: A4 Anchors: as in the image below. ![image description](/upfiles/148232166638074.jpg) I thought about using CascadeClassifier :: detectMultiScale but I have no idea where to start or if this is a good approach. Thanks for any help!

Is it mandatory to add JAVACV while using Opencv with Java in Netbeans?

$
0
0
hello every one I am new to opencv and want to work on a project on opencv ,I have seen some examples of opencv on you tube some of them are with javacv and opencv, and some of them are base on opencv only, so Iam confused do we also need javacv? and if yes then how to decised which one version of javacv for opencv?

Combing OpenCV and dlib in android ndk

$
0
0
I am trying to create an application which combines `opencv` and `dlib` library for facial landmark detection. I writing the code in the `android studio` natively. When I include the `dlib` library onto my native code in `android studio` I get the following error when I try to build the program. Can some one please help. Error:FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':mobile:externalNativeBuildDebug'. > Build command failed. Error while executing '/opt/android-sdk-linux/cmake/3.6.3155560/bin/cmake' with arguments {--build mobile/.externalNativeBuild/cmake/debug/arm64-v8a --target native-lib} [1/1] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so FAILED: : && /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-none-linux-android -gcc-toolchain /opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64 --sysroot=/opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64 -fPIC -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -std=c++11 -frtti -fexceptions -v -Wall -Werror -std=c++11 -frtti -fexceptions -v -Wall -Werror -I/usr/local/include -std=gnu++11 -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libnative-lib.so -o ../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/lib/liblog.so ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so ../../../../src/main/jniLibs/arm64-v8a/libdlib-lib.so -lm "/opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_static.a" && : Android clang version 3.8.256229 (based on LLVM 3.8.256229) Target: aarch64-none-linux-android Thread model: posix InstalledDir: /opt/android-sdk-linux/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin Found candidate GCC installation: /opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x Selected GCC installation: /opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x Candidate multilib: .;@m64 Selected multilib: .;@m64 "/opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld" --sysroot=/opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64 --eh-frame-hdr -m aarch64linux -shared -o ../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/lib/crtbegin_so.o -L/opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x -L/opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib/../lib64 -L/opt/android-sdk-linux/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/lib -L/opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/lib --build-id --warn-shared-textrel --fatal-warnings --no-undefined -z noexecstack -z relro -z now --build-id --warn-shared-textrel --fatal-warnings --no-undefined -z noexecstack -z relro -z now -soname libnative-lib.so CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/lib/liblog.so ../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so ../../../../src/main/jniLibs/arm64-v8a/libdlib-lib.so -lm /opt/android-sdk-linux/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgnustl_static.a -lstdc++ -lm -lgcc -ldl -lc -lgcc -ldl /opt/android-sdk-linux/ndk-bundle/platforms/android-21/arch-arm64/usr/lib/crtend_so.o CMakeFiles/native-lib.dir/src/main/cpp/native-lib.cpp.o: In function `dlib_check_consistent_assert_usage': /mobile/.externalNativeBuild/cmake/debug/arm64-v8a/../../../../generateLibs/jni/dlib/dlib/threads/threads_kernel_shared.h:44: undefined reference to `USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_' /mobile/.externalNativeBuild/cmake/debug/arm64-v8a/../../../../generateLibs/jni/dlib/dlib/threads/threads_kernel_shared.h:44: undefined reference to `USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_' clang++: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

how to convert Mat to jbyteArray ??

$
0
0
I have to return a jbyteArray (I'm using JNI and want a byte[] to return to the Java part). I have a native function in java with return type byte[]. I have an image in Mat and i have to convert it into jbyteArray so as to return it to my java code, and I don't know what it's the best approach.

How to? Aruco java...

$
0
0
Hello all. I build OpenCV and Aruco module, from Git... Build script: mkdir -p build_android_armeabi-v7a cd build_android_armeabi-v7a cmake \ -DANDROID_ABI=armeabi-v7a \ -DANDROID_NATIVE_API_LEVEL=android-14 \ -DANDROID_SDK=/Users/admin/Library/Android/sdk \ -DANDROID_NDK=/Users/admin/Library/Android/sdk/ndk-bundle \ -DANT_EXECUTABLE=/Users/admin/Documents/apache-ant/bin/ant \ -DJAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home \ -DJAVA_JVM_LIBRARY=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/include/jni.h \ -DJAVA_INCLUDE_PATH=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/include \ -DBUILD_FAT_JAVA_LIB=ON \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_TOOLCHAIN_FILE=../android/android.toolchain.cmake $@ ../.. everything went well. i include libraries and generated java classes in Android Studio. OpenCV is working, I tried several functions and it works. But with Aruco something is wrong, it always crash on **Aruco.detectMarkers** Mat inputImage = inputFrame.gray(); List corners = new ArrayList<>(); Mat ids = new Mat(); Dictionary dictionary = Aruco.getPredefinedDictionary(Aruco.DICT_6X6_250); Aruco.detectMarkers(inputImage, dictionary, corners, ids); if i will use this: List rejectedImgPoints = new ArrayList<>(); DetectorParameters detectorParameters = DetectorParameters.create(); Aruco.detectMarkers(inputImage, dictionary, corners, ids, detectorParameters, rejectedImgPoints); i always get assert in this line: CV_Assert(params->adaptiveThreshWinSizeMin >= 3 && params->adaptiveThreshWinSizeMax >= 3); **Please help!** I would not want to use C ++ code. I want to write a program in Java only.

Can I use OpenCV to differentiate between flowers

$
0
0
I am new to CV and I have seen some tutorials. I want to make an app that recognizes certain flowers (of same or different colors). Is it feasible using OpenCV? Is there any assumption or restriction to consider?

How to convert String data to byte data without Extra conversion

$
0
0
I asked a question a few hours ago , as the following but The intended question is changed. http://answers.opencv.org/question/120726/how-to-convert-mat-data-to-byte-data-in-andorid-by-using-opencv/ So I newly ask a question in here. [Question] I would like to equal the value of "ds" to the value of "a" in the following code. >・・・ >> Mat img2 = new Mat(new Size(85, 85),> CvType.CV_8UC3); String a = img2.dump(); > byte[] ds = a.getBytes();> System.out.println(a); -----(A)> System.out.println(ds);------(B)>・・・ Actually, (A) and (B) is different from each other (A)'s output: I/System.out: 244, 255, 249, 255, 243, 255, 248, 255, 247, 255, 245, ・・・ (B)'s output: I/System.out: [B@4627b6a0 ・・・ The purpose of equaling the value of "ds" to the value of "a" is to send the ds's data via socket communication as the following: >・・・ socket = new Socket(IP_ADDR, > PORT); out = new> BufferedOutputStream(socket.getOutputStream());> out.write(ds); ・・・ then, I want not to send same value of (B) output but to send same value of (A) in byte data. If you know the solution of the problem ,Please let me know.
Viewing all 353 articles
Browse latest View live