Problem with the function Cvb::Image.load("adresse image.bmp")

i can load a classificationPredictor but i can’t load an image ,if you know why.
my code:
-mon header

puis dans mon main j’utilise la commande suivante :

    classeur_=Cvb::Polimago::ClassificationPredictor::Load("C:\\Users\\stagiaire1\\Desktop\\fichier de recherche bois\\defautcommun.pcc");
    chercheur_=Cvb::Polimago::SearchPredictor::Load("C:\\Users\\stagiaire1\\Desktop\\fichier de recherche bois\\defautcommun.psc");
    image_=Cvb::Image::Load("C:\\Users\\stagiaire1\\Desktop\\photos compressé\\exemple\\planche 17 partie 1 verso");

Hi enzo,
from what you’ve posted, try:

  • escaping backslashes
  • your quotation marks seem wrong. Did you copy them from somewhere or is it just pasting in the forum?
  • add the image extension
1 Like

I think the quotation marks and the escaping are ok (this was just a rendering issue here because the code wasn’t actually in a code block - I’ve corrected that).

But the missing extension on the image file name is definitely a show stopper (even if the actual files does not have an extension: :cvb: determines the load to be used by looking at the file name extension).

1 Like

I try with the extension (*.bmp) it doesn’t work i have the same problem. But thanks.

Escape the spaces as well. You should be able to load

 Cvb::ImagePtr image = Cvb::Image::Load(Cvb::InstallPath() + CVB_LIT("tutorial/ClaraRGB.bmp"));

Yes it work the load work, thank you.