Watch this Author's files
This is quite cumbersome:
r=img(:,:,1); g=img(:,:,2); b=img(:,:,3);
invr=255-r; invg=255-g; invb=255-b;
img(:,:,1)=invr; img(:,:,2)=invg; img(:,:,3)=invb;
You could just write img = 255-img;
So and how do I get my vehicle in exactly the same position and the same lighting after crashing it?
Beware, this is a script, that clears your workspace! code it as function, otherwise it is useless.
Please provide a proper title for your function. "Dr., professor" is a joke!
Contact us at files@mathworks.com