spoRv
30th May 2017, 18:22
Here I am with another impossible task for our gurus! :D
There is a mainly pan&scan version of a letterboxed movie, with few open matte shots.
As this version quality is inferior to the BD, I'd like to use only open matte shots untouched, while using the BD, cropped and upscaled, to recreate the rest of the movie.
The cropped frame is included in the letterbox version; most of the time it's dead center, but often it is placed on the left or the right, in different places. No pan&scan occurs, the placement doesn't change inside a single shot.
So, my request is: given the two images C (cropped) and L (letterbox), is it possible to know where C is located inside L?
To reduce computation time, I thought it could be better, instead compare every single frame, that the script would locate first frame for every shot change, then make a comparison between C and L, and find the corresponding left and right crop values - or, at least, find the most similar to a given number of crop settings.
Result should be a list of frames (first, last) with cropping values (L would suffice, as cropped frame width is always the same), or crop setting number.
Well, if someone has read until here, he deserves an example:
https://s20.postimg.org/hgcvo6t3h/cropped_frame_location.jpg
I produced 11 crop settings (L5...L1,center,R1...R5, first row) and overlaid each to the cropped version (second row), with subtract mode (third row) and difference (fourth row); as you can see, the first frame is dead center, second is L2, while third has no correspondence, as it is an open matte shot.
I'm pretty sure there is a solution, but far from my skill...
There is a mainly pan&scan version of a letterboxed movie, with few open matte shots.
As this version quality is inferior to the BD, I'd like to use only open matte shots untouched, while using the BD, cropped and upscaled, to recreate the rest of the movie.
The cropped frame is included in the letterbox version; most of the time it's dead center, but often it is placed on the left or the right, in different places. No pan&scan occurs, the placement doesn't change inside a single shot.
So, my request is: given the two images C (cropped) and L (letterbox), is it possible to know where C is located inside L?
To reduce computation time, I thought it could be better, instead compare every single frame, that the script would locate first frame for every shot change, then make a comparison between C and L, and find the corresponding left and right crop values - or, at least, find the most similar to a given number of crop settings.
Result should be a list of frames (first, last) with cropping values (L would suffice, as cropped frame width is always the same), or crop setting number.
Well, if someone has read until here, he deserves an example:
https://s20.postimg.org/hgcvo6t3h/cropped_frame_location.jpg
I produced 11 crop settings (L5...L1,center,R1...R5, first row) and overlaid each to the cropped version (second row), with subtract mode (third row) and difference (fourth row); as you can see, the first frame is dead center, second is L2, while third has no correspondence, as it is an open matte shot.
I'm pretty sure there is a solution, but far from my skill...