android - No rule to make target ....third_party/opencv/jni/OpenCV.mk stop -
i working on facelandmarkdetection using opencv. can't troubleshoot error make: *** no rule make target d:/dipak/opencv/facelandmarkdetection/app/src/main/third_party/opencv/jni/opencv.mk'. stop.
how can fix it. have no third_party folder in app/src/main following cpp code
#include "aquil_facelandmarkdetection_nativeclass.h" #include "dlib/geometry/rectangle.h" jniexport jstring jnicall java_aquil_facelandmarkdetection_nativeclass_getmessage(jnienv *env, jclass) { env->newstringutf("jni message"); } jniexport void jnicall java_aquil_facelandmarkdetection_nativeclass_landmarkdetection (jnienv *env, jclass thiz, jlong addrinput, jlong addroutput) { mat& image = *(mat*)addrinput; mat& dst = *(mat*)addroutput; facedetectiondlib(image,dst); } void facedetectiondlib(mat& img, mat& dst){ try{ frontal_face_detector detector = get_frontal_face_detector(); shape_predictor pose_model; deserialize("/storage/emulated/0/download/shape_predictor_68_face_landmarks")>>pose_model; cv_image<bgr_pixel> cimg(img); //detect faces using dlib std::vector<dlib::rectangle> faces = detector(cimg); //find pose of each face using dlib std::vector<full_object_detection> shapes; for(unsigned long i=0;i<faces.size();++i) shapes.push_back(pose_model(cimg,faces[i])); //render mat dst = img.clone(); rendertomat(shapes,dst); } catch(serialization_error& e){ cout<<endl<<e.what()<<endl; } } void rendertomat(std::vector<full_object_detection>& dets, mat& dst){ scalar color; int sz=3; color = scalar(0,255,0); for(unsigned long idx=0; idx<dets.size(); idx++){ for(unsigned long i=1;i<=16;++i){ cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } //for line of nose for(unsigned long i=28;i<=30;++i){ cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } //for left eyebrow for(unsigned long i=18;i<=21;++i){ cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } //for right eyebrow for(unsigned long i=23;i<=26;++i){ cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } //for bottome nose for(unsigned long i=31;i<=35;++i){ cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } //whole line on nose cv::line(dst,point(dets[idx].part(30).x(),dets[idx].part(30).y()),point(dets[idx].part(35).x(),dets[idx].part(35).y()),color,sz); //left eye for(unsigned long i=37;i<=41;++i) { cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } cv::line(dst,point(dets[idx].part(36).x(),dets[idx].part(36).y()),point(dets[idx].part(41).x(),dets[idx].part(41).y()),color,sz); //right eye for(unsigned long i=43;i<=47;++i) { cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } cv::line(dst,point(dets[idx].part(42).x(),dets[idx].part(42).y()),point(dets[idx].part(47).x(),dets[idx].part(47).y()),color,sz); //lips out part for(unsigned long i=49;i<=59;++i) { cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } cv::line(dst,point(dets[idx].part(48).x(),dets[idx].part(48).y()),point(dets[idx].part(59).x(),dets[idx].part(59).y()),color,sz); //lips out part for(unsigned long i=61;i<=67;++i) { cv::line(dst,point(dets[idx].part(i).x(),dets[idx].part(i).y()),point(dets[idx].part(i-1).x(),dets[idx].part(i-1).y()),color,sz); } cv::line(dst,point(dets[idx].part(60).x(),dets[idx].part(60).y()),point(dets[idx].part(67).x(),dets[idx].part(67).y()),color,sz); } }
and android.mk file is
local_path := $(call my-dir) include $(clear_vars) local_module := dlib local_c_includes := $(local_path)/dlib local_src_files += \ ../$(local_path)/dlib/dlib/threads/threads_kernel_shared.cpp\ ../$(local_path)/dlib/dlib/entropy_decoder/entropy_decoder_kernel_2.cpp\ ../$(local_path)/dlib/dlib/base64/base64_kernel_1.cpp\ ../$(local_path)/dlib/dlib/threads/threads_kernel_1.cpp\ ../$(local_path)/dlib/dlib/threads/threads_kernel_2.cpp local_export_c_includes := $(local_c_includes) include $(build_static_library) #opencv top_level_path := $(abspath $(local_path)/..) $(info top level path: $(top_level_path)) ext_install_path = $(top_level_path)/third_party opencv_path = $(ext_install_path)/opencv/jni opencv_include_dir = $(opencv_path)/include include $(clear_vars) opencv_install_modules := on opencv_camera_modules := on opencv_lib_type :=static include $(opencv_path)/opencv.mk local_module := mylibs local_c_includes += \$(opencv_include_dir) local_src_files :=aquil_facelandmarkdetection_nativeclass.cpp local_ldlibs += -lm -llog -ldl -lz -ljnigraphics local_cppflags += -fexceptions -frtti -std=c++11 #import dlib local_static_liabraries += dlib include $(build_shared_library) enter code here [enter image description here][1] [1]: https://i.stack.imgur.com/9dlbp.png
Comments
Post a Comment