createTrackbar warns that value pointer is deprecated. But is there any other way to set trackbar's initial position?

it’s got a callback, doesn’t it? that’s the recommended way. have it call your callback, set your variable in there.

there is an outdated tutorial for this.

I’ve created an issue for someone to update both the docs and the tutorial.