Zoom : adding 'no aspect ratio change' in general settings | Page 6

Discussion in 'Improvement Suggestions' started by miljbee, August 4, 2006.

?

Would you like to be able to set up the zoom modes you want to use ?

  1. Yes, because there is some zoom modes that I never use

    99.7%
  2. No thanks, I am actually using all the available zoom modes

    0.3%
  1. jawbroken

    jawbroken Portal Pro

    Joined:
    August 13, 2005
    Messages:
    706
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Afghanistan Afghanistan
    I was mainly making the point that this thread had a simpler, more achievable focus in mind, not that your suggestion should never be implemented. Also, if ALL 16:9 TVs on the planet implement this feature already, isn't it possible for people who want this to use their TVs aspect ratio correction as a sort of workaround in the mean time? I see the simpler aspect ratio options as a more important as far as usability and feasibility go, is all.

     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. ziphnor
    • Premium Supporter

    ziphnor Retired Team Member

    Joined:
    August 4, 2005
    Messages:
    755
    Likes Received:
    13
    Location:
    Copenhagen
    Ratings:
    +13 / 0
    Home Country:
    Denmark Denmark
    Not at all, its an embarrasingly simple approach. First of i rely on the assumption that logos will be either to left or top right and define an interval on the x-axis where i dont expect to find logos. In that interval i choose a number of random x values which are my samples points. I then start scanning from the bottom up. For each line y, i calculate the average R,G,B values of the samples points, and then sum over the sample points deviation from the average. This gives an indications of how different the image is at the sample points, so it will find consider any non-uniform line as image content. This catches most things, but not uniform white for example, so another check is added considering the max of any color component(R,G,B) seen by a sample point, if that is high enough it is also considered as content(would capture any kind of at least somewhat bright uniform background). The reason i dont just use the last method alone, is that very dark images will have low color components, but still have a variation i dark colors which will yield a variance from the average not seen in the black edges. Noise on analogue signals might confuse it though(i use DVB-C) since it can add 'snow' to the black edges.

    In order to avoid considering VBI data or whatever that whiteblack line is in some of my screenshots as content, a line is only considered image content if the next line also fullfills this criteria.

    For the above i think i used 20 sample points, meaning i sample 20*576 pixels in total. I havent optimized it yet, the annoying lookahead mentioned above causes some double-work right now(easily fixed). I could also reduce the scanned lines by ~50% by scanning bottom up, and then top down instead of going right through the image. Furthermore i have considered trying a binary search style scan, which i think would make it capable of running in real-time. I havent timed it as such yet, but will do.

    Right now, i would howevever prefer to get an idea of how to add it to mediaportal. I have no idea where to look in the code, so some assistance would be appreciated.

    As for 4:3 in 16:9, ie black bars on the side, this could easily be added by scanning sideways as long as one has an idea where the logos will be encountered.

    Btw, it would be nice if i could get some more screenshots(or better yet, direct frame grabs from the video) to try out. If you have some you can email them to ziphnor@gmail.com (Dont worry its a spam email address anyway :) Just put [Screenshot] in the subject so i can find them.
     
  4. jawbroken

    jawbroken Portal Pro

    Joined:
    August 13, 2005
    Messages:
    706
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Afghanistan Afghanistan
    I might play around with this a little as well, if you don't mind. If you wouldn't mind sharing your test images with me I would appreciate it. I will PM you my email address. I think that perfecting and speed testing the algorithm should be done before you try to implement it within MediaPortal, as that will probably guide decisions as to where it is best implemented. I have the impression that a DirectShow filter would be the best place for this, though someone might be able to advise you better on that issue.
     
  5. ziphnor
    • Premium Supporter

    ziphnor Retired Team Member

    Joined:
    August 4, 2005
    Messages:
    755
    Likes Received:
    13
    Location:
    Copenhagen
    Ratings:
    +13 / 0
    Home Country:
    Denmark Denmark
    I have emailed the screens and the code to you, if you intend to work alot on it, we should sync so we avoid repeating work.

    I see your point, but i think a DS filter would be a good idea regardless of the way it runs, at least for grabbing frames, dont know where the scaling is done currently. Im pretty sure that using a binary search style approach would make it realtime capable. Instead of scanning samples points on 576 lines, one might get away with just a few (however due to the nature of it, one would probably have to check a few lines in each iteration to make sure you dont hit a black spot in the middle of the screen :)
     
  6. jawbroken

    jawbroken Portal Pro

    Joined:
    August 13, 2005
    Messages:
    706
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Afghanistan Afghanistan
    Thank you for the code, I will need to dust off my copy of Visual Studio as I have been writing mostly Java code for uni at the moment. Your image code should be a helpful starting point to get me up to scratch. I have been thinking that the best way to find corners would be to start in, say, the top left corner and scan down diagonally, say in units of 4 pixels, then backtrack when you find interesting pixels to find the edge. Then you can figure out if it is a horizontal or vertical edge by sampling around the area. Once it has been determined to be horizontal or vertical, the edge can be followed to the corner. Then the same steps can be followed from the bottom right corner. Then it only remains to scan the subtitle area, which is best done in its own special way, I think, as it differs greatly from regular video sections.

    A few issues:
    1) Finding the corner will only work for frames with a clear contrast between the black sections and the frame. If this is running as a DS filter then this is not a big issue, as any frames not usable to find bounds can be ignored until a good frame comes along.
    2) Ignoring subtitle sections and logos when the diagonal scan is being done. This test can probably be incorporated into the test to find out if it is a horizontal or vertical edge. So a Region of Interest can be a horizontal edge, a vertical edge or neither (neither being a logo or subtitle).
    3) Some stuff I probably haven't even considered yet (special cases, etc).

    I think that this method, while being much more specialised and sectionalised than your approach, could yield a significant decrease in pixel tests.

    Any input/ideas or an entirely different approach that is more efficient would be welcome.
     
  7. ziphnor
    • Premium Supporter

    ziphnor Retired Team Member

    Joined:
    August 4, 2005
    Messages:
    755
    Likes Received:
    13
    Location:
    Copenhagen
    Ratings:
    +13 / 0
    Home Country:
    Denmark Denmark
    Just want to add two comments to this thread:

    1. Moving subtitles
    You guys were joking about doing this in real-time, but i actually think its possible. It isnt too hard finding a seperate bounding box for the subtitles and then its just transposing all the really bright pixels in the box into the video area.

    2. Smart Stretch
    Im not going to work on that but i think that there might exist seperatly developed smart strech filters that can be used. For example i noticed that on my computer i have a DMO Video Effect called smart stretch. Not sure what it does though :)
    If such a filter exists, it would be very easy to add it to MP(based on my newbie knowledge of DirectShow), so if you like to see it added, go and google for such a filter.
     
  8. jawbroken

    jawbroken Portal Pro

    Joined:
    August 13, 2005
    Messages:
    706
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Afghanistan Afghanistan
    I have thought about this and it is fairly easy if the subtitles are totally in the black area, next to impossible if they overlap the frame slightly. You don't even really need to do any tests for bright pixels and only transpose them, just overlay the image with a blend mode that only really copies the bright pixels (additive mode?) and perhaps increase the contrast and decrease the brightness a little to cut down on the noise for analogue tuners.
     
  9. miljbee

    miljbee Portal Pro

    Joined:
    November 11, 2005
    Messages:
    91
    Likes Received:
    0
    Location:
    Orléans, France
    Ratings:
    +0 / 0
    Home Country:
    France France
    I don't think that real time detection is really important.

    If the user could select "auto detect frame size" from the osd, zoom modes, or menu, it could do the trick as a start point.

    If the algo shows to be really strong, fast and error free, then this could be added later in a filter to continuously detect and adapt the display frame.

    Anyway, i am very happy to see that there is some real progress about Zoom modes. Thank you very much for all your contributions.
     
  10. miljbee

    miljbee Portal Pro

    Joined:
    November 11, 2005
    Messages:
    91
    Likes Received:
    0
    Location:
    Orléans, France
    Ratings:
    +0 / 0
    Home Country:
    France France
    I definitively agree with this, and that's why i think these 2 parameters should be implemented right now to define the "smart zoom" feature. Perhaps the name "smart zoom" is a bit ambitious, but this mode could be improved in the future to integrate progressive stretch/expand and black area auto detection.

    I see no reason why this couldn't be added in a zoom section into the general settings of the mp configuration program. Sorry, in fact the reason is that i am not skilled enough to do it myself ...
     
  11. Jimi

    Jimi Portal Member

    Joined:
    October 16, 2006
    Messages:
    23
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Is this going to get implemented or has it been already?
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!