The polimago classify function is error

Hi everyall,
I have a question in Teach Bench.
when I use the classify function in C# polimago libaray,the program crashes.
the error pictrue as below:

Through debugging, it was found that the reason for the classify function was
classifyResult[i] = classify.Classify(img, pos_xy);
I want to know how to avoid the error. If I encounter this problem, can I exit the program by passing the return value?

can you tell me a godd advise. Thanks a lot!

Hi @JieZhao,

I am sorry, but I do not yet fully understand. Does the uncaught exception occur in TeachBench or in a program of your own?

  • If it is in TeachBench, is this issue related to Why I cannot create a polimago search project? and does it still persist now that this issue seems to have been resolved?
  • If it is a program of yours: The Classify() function does a check what positions may or be classified inside an image. Generally speaking, a classifier has an extent (property FeatureWindowExtent) and when using a classifier for classifying a location in an image, it is necessary to restrict that evaluation to locations in the image where all required data is available.
    Example: Suppose your classifier has an extent of Left = 5 and Top = 5, then using it on the location (1, 2) would violate the above requirement because we lack four pixel columns left of that location and 3 pixel lines above it.
    Unlike the C API, CVB.Net uses exceptions to communicate faulty calls and if such an exception goes uncaught then a message like the one you posted would be the result.

Hi @illusive
Thanks for you value advise.
I’ve learned where the problem is.
The main problem is that the location crosses the image boundary.
I have correct it.
Thanks a lot.

1 Like