regulaforensics / DocumentReader-web-csharp-client

Regula Document Reader web API c# client compatible with .NET & .NET Core
https://regulaforensics.com
8 stars 3 forks source link

Completed Authenticity Check #34

Closed ghost closed 3 years ago

ghost commented 3 years ago

The image and other important values were missing.

ghost commented 3 years ago

@hleb-albau could you please review my pull request? I need this feature. Thank you!

hleb-albau commented 3 years ago

@Flori00 working on it

ghost commented 3 years ago

Thanks you very much! sry for me being impatient.

hleb-albau commented 3 years ago

oh, not a problem it is just a confirmation, that I took a task

Seems the fields you added in this PR do not belong to all checks. Do you see child classes of AuthenticityCheckResultItem? For example https://github.com/regulaforensics/DocumentReader-web-csharp-client/blob/master/src/Regula.DocumentReader.WebClient/Model/IdentResult.cs

https://github.com/regulaforensics/DocumentReader-web-csharp-client/blob/9780111b69c916056803a05fa0fbbd05de263fb0/src/Regula.DocumentReader.NetCoreExample/Program.cs#L67 Here you can find how to obtains concrete authenticity results.

ghost commented 3 years ago

Ahh ok i will add them, thanks! Yea i already tried to get these, but in the json there are the images and in the sdk they were missing.

hleb-albau commented 3 years ago

Hello Flori00,

Could you, please, describe your problem? I can't understand, why we need to add to AuthenticityCheckResultItem these fields. AuthenticityCheckResultItem is a base class for all check results(FiberChecks, IdentChecks, ImageIdentChecks, OCRSecurityTextChecks, SecurityFeatureChecks). To get concrete check results, use next methods:

var docAuthenticity = response.Authenticity();
var docImagePattern = docAuthenticity.ImagePatternChecks();   // IdentChecks

See Autheticity class for details. https://github.com/regulaforensics/DocumentReader-web-csharp-client/blob/9780111b69c916056803a05fa0fbbd05de263fb0/src/Regula.DocumentReader.WebClient/Model/Ext/Autheticity/Autheticity.cs#L7

ghost commented 3 years ago

So ineed(API): https://postimg.cc/3ywqLQbR In the Sdk: https://postimg.cc/5HjPBq6Q The Type of the Object i need the images is from the type Regula.DocumentReader.WebClient.Model.AuthenticityCheckResultItem and there i added the new types.

If i test my version it is working fine.

hleb-albau commented 3 years ago

Oh, I see. It is another problem here. For some reason, during deserialization client creates base classes instead of concrete, is it right? Could you check in runtime what types are contained in AuthenticityChecklist.List array?

ghost commented 3 years ago

Oh this classes should have another class like IdentResult, i see has also the Images? class AuthenticityChecklist.List -> class AuthenticityCheckResult.List -> class AuthenticityCheckResultItem

hleb-albau commented 3 years ago

Also, could you share a bit more code of how you using the client?

hleb-albau commented 3 years ago

Oh this classes should have another class like IdentResult, i see has also the Images? class AuthenticityChecklist.List -> class AuthenticityCheckResult.List -> class AuthenticityCheckResultItem

Yes, here should be concrete results instead of AuthenticityCheckResultItem

ghost commented 3 years ago

API Version: Version: 5.7.134770.472



var imageBytes = File.ReadAllBytes(imgpath);
var image = new ProcessRequestImage(new ImageData(imageBytes), Light.WHITE);

var requestParams = new RecognitionParams().WithScenario(Scenario.FULL_AUTH);
requestParams.Log = true;

var request = new RecognitionRequest(requestParams, image);
var api = new DocumentReaderApi(apiBaseUrl);

var response = api.Process(request);

var status = response.Status();
var docOverallStatus = (Models.StatusResult)status.OverallStatus;
var docOpticalTextStatus = (Models.StatusResult)status.DetailsOptical.Text;

var docAuthenticity = response.Authenticity();
hleb-albau commented 3 years ago

I found the issue root, will fix it in an hour!

ghost commented 3 years ago

k thanks!

hleb-albau commented 3 years ago

@Flori00, please, checkout https://github.com/regulaforensics/DocumentReader-web-csharp-client/releases/tag/v5.7.4