Conflicting libraries (YOLO comp vision)

Hi team, i seem not to be able to get YOLO working despite some step by step guidance stated on:

from mr MagicandLove. I removed libraries and replaced them to try get the error removed.
Is there a tip that can steer me in the correct direction?

I did import the required files in the locations as the site stated, the CVImage file seems to keep conflicting (i do restart pc to refresh )

help to tackle this last step would be helped

basic code from site:

import cvimage.*;
import ipcapture.*;
IPCapture cap;
//import CVImage.*;
import org.opencv.core.*;
import org.opencv.core.Core;
import org.opencv.core.Core.MinMaxLocResult;
import org.opencv.dnn.*;
import org.opencv.core.MatOfDouble;
import java.util.*;

final int CAPW = 640, CAPH = 360;
final int W = 416, H = 416;
final float THRESH = 0.85;
private Net net;
//private Capture cap;
private CVImage cv;
private String [] labels;
private ArrayList<String> names;

public void settings() {
  size(CAPW, CAPH);

public void setup() {
  //  printArray(Capture.list());
 // cap = new Capture(this, CAPW, CAPH);
 cap = new IPCapture(this, "http://DESKTOP-1QTI31N:8080/cx","","");
  cv = new CVImage(W, H);

private void getOutputsNames(Net n) {
  int [] outLayers = n.getUnconnectedOutLayers().toArray();
  ArrayList<String> layers = (ArrayList)n.getLayerNames();
  names = new ArrayList<String>(outLayers.length);
  for (int i=0; i<outLayers.length; i++) {
  for (String s : names) {

private void loadYOLO() {
  net = Dnn.readNetFromDarknet(dataPath("yolov3.cfg"), 

  String [] labelFile = loadStrings("object_detection_classes_yolov3.txt");
  labels = new String[labelFile.length];
  println("Class size: " + labelFile.length);
  for (int i=0; i<labelFile.length; i++) {
    labels[i] = trim(labelFile[i]);

public void draw() {
  if (cap.available()) {
  cv.copy(cap, 0, 0, cap.width, cap.height, 
    0, 0, cv.width, cv.height);
  image(cap, 0, 0);
  Mat blob = Dnn.blobFromImage(cv.getBGR(), 1.0f/255.0f, 
    new Size(cv.width, cv.height), 
    new Scalar(0, 0, 0), true, false);

  Mat result = net.forward(names.get(0));

  for (int i=0; i<result.rows(); i++) {
    Mat scores = result.row(i).colRange(5, result.cols());
    MinMaxLocResult mm = Core.minMaxLoc(scores);
    Point classIdPoint = mm.maxLoc;
    double confidence = mm.maxVal;
    if (confidence > THRESH) {
      int idx = (int)classIdPoint.x;
      int x = (int)(result.get(i, 0)[0]*cap.width);
      int y = (int)(result.get(i, 1)[0]*cap.height);
      int w = (int)(result.get(i, 2)[0]*cap.width);
      int h = (int)(result.get(i, 3)[0]*cap.height);
      stroke(255, 0, 0);
      rect(x-w/2.0, y-h/2.0, w, h);
      fill(255, 0, 0, 200);
      rect(x-w/2.0, y-h/2.0, w, 18);
      fill(255, 255, 255);
      text(labels[idx], x+5-w/2.0, y+12-h/2.0);



The little popup box error seems to be telling you what you need. You have two library folders installed that both provide opencv – one is libraries/CVImage, the other is libraries\opencv_processing. It looks like you need to uninstall one of them – e.g. move one of those folders out of your libraries path – so that when you import org.opencv, there is only one match, not two matches.


thank you for taking time. I indeed removed one of them, in different orders and variants. each time restarting pc. no positive result, i do a new testround tomorrow , toady the pc beat me though, getting energy to fight it again and get it solved :slight_smile:

You should not need to restart your PC – and skipping that step will greatly speed up your testing. I’d suggest removing them both and restarting PDE. The sketch should fail with library not found. If it doesn’t you have a bigger problem.

Also note that you need to completely remove those folders from your library path. You can’t just rename them or put them in a subfolder – they will still be found and your problem won’t go away.

Thank you for pointing out only all P3 windows needs to be closed, not restarting helps indeed :slightly_smiling_face:
I completely removed one (in a few variants), it gets me in an error which marks

net = Dnn.readNetFromDarknet(dataPath("yolov3.cfg"),

also refers to a library still: No library found for org.opencv.core.Core

and gives the message that is above my understanding:

i am diving in the matter to see if i can make baby steps, if there is an obvious tip though, it would make my sunday real good.

I was able to reproduce your problem and then I fixed it. I guess you forgot to download files into data folder as written in readme

But be careful, 1st cfg file and 3rd txt files are not direct link to raw files, so you need to follow the link and then download raw files from Github. The 2nd weight file is a direct link.


Micuat, very grateful you point out that the yolov3.cfg was the issue, i indeed placed the file wrongly in the datafolder, putting a copied raw as replacement fixed that part.

it is running, very slow, now trying to get it to run smooth and correct, helped a lot


Hello, I have the same problem, but I don’t know how to solve it. Can you tell me how to solve it? T