Providing you install the same Python Modules for both Raspberry Pi and Windows, an OpenCV application can swap between two platforms easily. But instead, use special functions to keep GPIO statements confined and organised. It is probably good practice not to spread GPIO access statements across the entire program. I will use dummy data or print statements to attempt to simulate GPIO input and output where possible.
I will usually debug as much code as I can on the PC before transferring to the Raspberry Pi. However, unless I need access to GPIO connected devices, I write, run and debug the code on the PC first before any FTP transfer. Therefore, I use a text editor on my Windows PC and then transfer the code file via FTP to the Raspberry Pi. I generally don’t write new code directly on the Raspberry Pi in case of unrecoverable failure of the SD Card.
Additionally, I recommend the Geany text editor which I recently discovered. Therefore I go through the install process of the Python programming language, and I also include installing OpenCV. Ideally, to save the Raspberry Pi SD Card, we can debug the bulk of the Python code on our much faster laptop or PC instead.