Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in code of face recognition #1

Closed
Anurag1201 opened this issue Feb 12, 2017 · 13 comments
Closed

Issue in code of face recognition #1

Anurag1201 opened this issue Feb 12, 2017 · 13 comments

Comments

@Anurag1201
Copy link

i have followed your instructions in the given video but still it is giving error in Core.Nativelibrary

@ruturp
Copy link

ruturp commented Mar 26, 2017

I have followed your instruction in given video but still it is giving error is below:
import org.opencv.highgui.Highgui;
import org.opencv.highgui.VideoCapture; this two package is exsist.
and Core.rectangle(frame, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height),
cannot find rectangle symbol

@tahaemara
Copy link
Owner

tahaemara commented Mar 26, 2017

in opencv3.0, there is no highgui module in java.
To migrating from OpenCV 2.x to 3.0.0 (Java)

Highgui.imread(fileName, Highgui.CV_LOAD_IMAGE_GRAYSCALE) becomes Imgcodecs.imread(fileName, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE)

And Highgui.imread(fileName) becomes Imgcodecs.imread(fileName)

also , drawing functions such as:

Core.circle(..), Core.line(..) become Imgproc.circle(..), Imgproc.line(..)
Core.rectangle(frame, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height) becomes Imgproc.rectangle(frame, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height);

@catapulveda
Copy link

Hi, Taha! You should publish the facial recognition source code in java. Thank you.

@alciomarhollanda
Copy link

Hi,

In openCV 3.2 don't work Imgcodecs.imread(".bmp", frame, mem);

image

@Ayush0601
Copy link

if (webSource.grab()) {

        System.out.println("err");                     

try
{

                      webSource = new VideoCapture(0);  
                      webSource.retrieve(frame);

                       Graphics g = jPanel1.getGraphics();

                        faceDetector.detectMultiScale(frame, faceDetections);

                        for (Rect rect : faceDetections.toArray())

{

                            Imgproc.rectangle(frame, new Point(rect.x, rect.y), new Point(rect.x + rect.width, rect.y + rect.height),   new Scalar(0, 255,0));

error in this part of code

@tahaemara
Copy link
Owner

Post the error message here, so, I can check it.

@tahaemara
Copy link
Owner

tahaemara commented Oct 6, 2017

@alciomarhollanda
Keep in mind that function Imgcodecs.imread takes a parameter represent the path of the image
Mat image = Imgcodecs.imread(getClass().getResource("/lena.png").getPath());

@livingstone90
Copy link

I am facing this error

OpenCV Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\objdetect\src\cascadedetect.cpp, line 1698
Error

@tahaemara
Copy link
Owner

tahaemara commented Oct 24, 2017

@livingstone90
Try to use the absolute path to the cascade file, in other words, try to replace this line
CascadeClassifier faceDetector = new CascadeClassifier(FaceDetection.class.getResource("haarcascade_frontalface_alt.xml").getPath().substring(1));
with
CascadeClassifier faceDetector = new CascadeClassifier("/path/to/haarcascade_frontalface_alt.xml");

@livingstone90
Copy link

Hi,How can i reduce the size frame of the video capture section..I dont want it to be long from left to right but I want it to align only on left side

@tahaemara
Copy link
Owner

@livingstone90 use these lines to change the size of the frames
capture.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, WIDTH); capture.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, HEIGHT);

@jimiking
Copy link

jimiking commented Nov 6, 2017

hi taha.
i want make java app similar your app.
capture (webcam and ip camera) thin detect face with name .
please
please
please
please

@tahaemara
Copy link
Owner

@jimiking search google about "eigenfaces algorithm with java" you will see a lot of results.

Repository owner locked and limited conversation to collaborators Nov 6, 2017
Repository owner unlocked this conversation Nov 6, 2017
Repository owner locked and limited conversation to collaborators Nov 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants