D1firehail / AdeptiScanner-GI

OCR-based inventory scanner for Genshin Impact
50 stars 18 forks source link

Unable to read artifact stats (Genshin V4.5) #21

Closed SDoubleDash closed 2 months ago

SDoubleDash commented 2 months ago
  1. I continuously get window header not found even though my window is taking up the majority of my screen.
  2. When I try to read stats, the artifact set name gets cut off somehow and the whole piece is treated as invalid
  3. For some artifacts when I try to read the stats it errors out with the following details:
    
    just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.IndexOutOfRangeException: Index was outside the bounds of the array. at AdeptiScanner_GI.ImageProcessing.getArtifacts(Bitmap img, Int32[] rows, Boolean saveImages, TesseractEngine tessEngine, Boolean locked, Int32 rarity, Rectangle typeMainArea, Rectangle levelArea, Rectangle subArea, Rectangle setArea, Rectangle charArea) in E:\Github\AdeptiScanner GI\AdeptiScanner GI\ImageProcessing.cs:line 895 at AdeptiScanner_GI.ScannerForm.btn_OCR_Click(Object sender, EventArgs e) in E:\Github\AdeptiScanner GI\AdeptiScanner GI\Form1.cs:line 1140 at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies ** System.Private.CoreLib Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Private.CoreLib.dll

AdeptiScanner GI Assembly Version: 0.0.0.0 Win32 Version: 0.0.0.0 CodeBase: file:///D:/Documents/AdeptiScanner/AdeptiScanner.V2.1.0/AdeptiScanner%20GI.dll

System.Runtime Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.dll

System.Windows.Forms Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11602 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/System.Windows.Forms.dll

System.Windows.Forms.Primitives Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11602 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/System.Windows.Forms.Primitives.dll

System.ComponentModel.Primitives Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.ComponentModel.Primitives.dll

System.Runtime.InteropServices Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.InteropServices.dll

System.Drawing.Primitives Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Drawing.Primitives.dll

System.Collections.Specialized Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Collections.Specialized.dll

System.Drawing.Common Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/System.Drawing.Common.dll

System.Collections Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Collections.dll

Newtonsoft.Json Assembly Version: 13.0.0.0 Win32 Version: 13.0.3.27908 CodeBase: file:///D:/Documents/AdeptiScanner/AdeptiScanner.V2.1.0/Newtonsoft.Json.dll

System.Linq.Expressions Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Linq.Expressions.dll

System.ComponentModel.TypeConverter Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.ComponentModel.TypeConverter.dll

System.ObjectModel Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.ObjectModel.dll

System.Runtime.Serialization.Formatters Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.Serialization.Formatters.dll

System.Collections.Concurrent Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Collections.Concurrent.dll

System.Diagnostics.TraceSource Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Diagnostics.TraceSource.dll

System.Runtime.Numerics Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.Numerics.dll

System.Private.Uri Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Private.Uri.dll

System.Linq Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Linq.dll

System.Runtime.Serialization.Primitives Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.Serialization.Primitives.dll

System.Data.Common Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Data.Common.dll

System.Xml.ReaderWriter Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Xml.ReaderWriter.dll

System.Private.Xml Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Private.Xml.dll

System.ComponentModel Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.ComponentModel.dll

System.Reflection.Emit.ILGeneration Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Reflection.Emit.ILGeneration.dll

System.Reflection.Emit.Lightweight Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Reflection.Emit.Lightweight.dll

System.Reflection.Primitives Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Reflection.Primitives.dll

System.Threading Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Threading.dll

Tesseract Assembly Version: 5.2.0.0 Win32 Version: 5.2.0 CodeBase: file:///D:/Documents/AdeptiScanner/AdeptiScanner.V2.1.0/Tesseract.dll

netstandard Assembly Version: 2.1.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/netstandard.dll

Microsoft.Win32.Primitives Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/Microsoft.Win32.Primitives.dll

System.ComponentModel.EventBasedAsync Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.ComponentModel.EventBasedAsync.dll

System.Threading.Thread Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Threading.Thread.dll

System.Memory Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Memory.dll

System.Numerics.Vectors Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Numerics.Vectors.dll

Accessibility Assembly Version: 4.0.0.0 Win32 Version: 7.0.1724.11602 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/Accessibility.dll

InputSimulatorEx Assembly Version: 2.1.1.0 Win32 Version: 2.1.1.0 CodeBase: file:///D:/Documents/AdeptiScanner/AdeptiScanner.V2.1.0/InputSimulatorEx.dll

Microsoft.Win32.SystemEvents Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/Microsoft.Win32.SystemEvents.dll

System.Security.Principal.Windows Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Security.Principal.Windows.dll

System.Security.Claims Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Security.Claims.dll

System.Reflection.Emit Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Reflection.Emit.dll

InteropRuntimeImplementer.LeptonicaApiSignaturesInstance Assembly Version: 0.0.0.0 Win32 Version: n/a CodeBase:

InteropRuntimeImplementer.TessApiSignaturesInstance Assembly Version: 0.0.0.0 Win32 Version: n/a CodeBase:

System.Net.Http Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Net.Http.dll

System.Collections.NonGeneric Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Collections.NonGeneric.dll

Microsoft.Win32.Registry Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/Microsoft.Win32.Registry.dll

PresentationCore Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11610 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/PresentationCore.dll

WindowsBase Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11610 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/WindowsBase.dll

DirectWriteForwarder Assembly Version: 7.0.0.0 Win32 Version: 7,0,1724,11610 @Commit: 6b9b816bff16a1b507019fe6313b6baecb83b580 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/DirectWriteForwarder.dll

System.Runtime.Extensions Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.Extensions.dll

System.Diagnostics.Debug Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Diagnostics.Debug.dll

System.Runtime.CompilerServices.VisualC Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.CompilerServices.VisualC.dll

UIAutomationTypes Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11610 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/UIAutomationTypes.dll

System.Configuration.ConfigurationManager Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/7.0.17/System.Configuration.ConfigurationManager.dll

System.Net.WebClient Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Net.WebClient.dll

System.Text.Encoding.Extensions Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Text.Encoding.Extensions.dll

System.Diagnostics.Process Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Diagnostics.Process.dll

System.Diagnostics.StackTrace Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Diagnostics.StackTrace.dll

System.Reflection.Metadata Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Reflection.Metadata.dll

System.Collections.Immutable Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Collections.Immutable.dll

System.IO.MemoryMappedFiles Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.IO.MemoryMappedFiles.dll

System.Text.RegularExpressions Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Text.RegularExpressions.dll

Tesseract.Drawing Assembly Version: 5.2.0.0 Win32 Version: 5.2.0 CodeBase: file:///D:/Documents/AdeptiScanner/AdeptiScanner.V2.1.0/Tesseract.Drawing.dll

System.Runtime.Loader Assembly Version: 7.0.0.0 Win32 Version: 7.0.1724.11508 CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/7.0.17/System.Runtime.Loader.dll

** JIT Debugging **



1. ![image](https://github.com/D1firehail/AdeptiScanner-GI/assets/103538404/32b91449-201d-41e8-9960-a08dcc1df31a)
2. ![image](https://github.com/D1firehail/AdeptiScanner-GI/assets/103538404/4a9e4f07-c96b-4d19-92d1-ee3de0059816)
3a. ![image](https://github.com/D1firehail/AdeptiScanner-GI/assets/103538404/c232c6d1-a3d8-4cd5-8dfc-ddbd94fa7f4f)
3b. ![image](https://github.com/D1firehail/AdeptiScanner-GI/assets/103538404/ec81d04f-8f49-4a57-bc8e-37adb5f18f19)
D1firehail commented 2 months ago

1

Window header, the row at the very top of each window that has the minimize/fullscreen/close buttons. Without Process Handle Features enabled, it's required to identify where the game window stops and starts.

The message you're seeing says it couldn't find the header, so it's assuming the game is running in full screen and treats the entire primary screen as the game window.

my window is taking up the majority of my screen

So it's not in full-screen, the detection of the header is failing, and you're not using Process Handle Features. I'd need a screenshot of the whole screen to see if it's a proper issue or if you have it set up slightly wrong.


2

The scan process relies on detecting the different parts of the image, so the appropriate colour filters can be used to find the text. There's some artifacts in the images that makes me suspect you're using a sharpening filter (usually within Radeon Software) that screws with this step.


3

Most likely caused by 2.

SDoubleDash commented 2 months ago
  1. Full screen photo: image

  2. Ah, you nailed it. Turning off Radeon image sharpening was able to resolve the stat reading. Perhaps this note can be added to the README's Warnings and important notes.

  3. Makes sense, did not encounter again after turning off the sharpening

Thanks :D

D1firehail commented 2 months ago

Image looks like it should be fine at a glance, it's only a notification so if it works that's good enough for me.

I'll leave this issue open as a reminder to update the README

D1firehail commented 2 months ago

Readme now updated