* Optimize edge detection by decoding full image once
Refactors edge detection to decode the entire image at a downscaled resolution once, instead of decoding multiple regions. This improves performance by reducing repeated decoding operations and leverages direct pixel access for edge analysis. Adds a scale factor calculation to balance accuracy and speed for large images.
* Update EdgeDetector.kt
* Update EdgeDetector.kt
* Update EdgeDetector.kt