Thanks very much for the photos. They are definitely helpful.
1. The first lot of pictures i assume is you going from slouched sitting to sitting up straight. Does the pain after activity come on while slouched or when you sit up straight?
2. The second lot of pictures is very instructive. A further question would be - does the pain change (more/less/same) if you lift your leg up STRAIGHT then slouch over and put your chin on your chest? If so, it is nearly certain it is a neurological problem to do with the spinal cord having some scarring or tethering.
I don't think the muscle thing is causing the pain. I think it might merely be a victim of what is going on which is probably a mechanically sensitive nerve.
Is it possible for you to sit slouched without pain? If so, then are you able to S L O W L Y straighten your leg or lift your knee to a point where it stretches but doesn't give pain? If so, then this is probably a good exercise to do to try get the nerve moving again. If it is painful, stop doing it!!!! If it flares your symptoms up, stop it. If you are at all unsure about it, don't do it. But if it works...
Let us know how you are getting on. Please remember that the exercise just listed is not to be painful at all. Don't overdo it - just do 5 or 10 reps slowly without holding - maybe take 4 secs to go through the range up and then 4 secs to bring it back down again.
How cool would it be if you got fixed over the internet???