@ZiadiMohamed: For clarity, have you tried heading to the Camera app > Tap the cog symbol > Scene Optimiser > Document Scan, to make sure the feature is toggled on. If it is, toggle it off, then on again, to see if this helps. If you have recently updated to Android 12, check for an available Camera app update by scrolling to the bottom of the Camera settings > About Camera.
I did the upgrade to
One UI: 4.1
Android Kernel version: SP1A.210812.016.A52BXXS1CVD1
But still got the same problem , any idea ?
UPDATE: the function is restored after runnning the Phone on Safe Mode then a Restart in normal mode.