Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OpenCV Computer Vision with Java
  • Table Of Contents Toc
OpenCV Computer Vision with Java

OpenCV Computer Vision with Java

By : Daniel Lelis Baggio
3.4 (5)
close
close
OpenCV Computer Vision with Java

OpenCV Computer Vision with Java

3.4 (5)
By: Daniel Lelis Baggio

Overview of this book

If you are a Java developer, student, researcher, or hobbyist wanting to create computer vision applications in Java then this book is for you. If you are an experienced C/C++ developer who is used to working with OpenCV, you will also find this book very useful for migrating your applications to Java. All you need is basic knowledge of Java, with no prior understanding of computer vision required, as this book will give you clear explanations and examples of the basics.
Table of Contents (9 chapters)
close
close
8
Index

Detection


OpenCV already comes with several previously-trained cascades that are ready to be used. Among them, we can find front and profile face detectors as well as eye, body, mouth, nose, lower-body, and upper-body detectors. In this section, we will cover how to use them. The complete source can be found in the project cascade in this chapter.

The following code shows how to load a trained cascade:

private void loadCascade() {
  String cascadePath = "src/main/resources/cascades/lbpcascade_frontalface.xml";
  faceDetector = new CascadeClassifier(cascadePath);
}

Most of the action happens in the class CascadeClassifier, from the objdetect package. This class wraps cascade loading and object detection. The constructor with strings already loads the cascade from the given path. In case you want to postpone the cascade name, you can use the empty constructor and the load method.

The runMainLoop method, which is not shown here, will simply grab an image from the webcam and pass it to detectAndDrawFace...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OpenCV Computer Vision with Java
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon