I know nothing (jit.dx.grab resolution issue)
Ok, I’ve been trying to make something that captures an image from a webcam combined with a template and then to save that image to my drive. With some help I’ve been able to get a patch that captures a still from my webcam. But the problem is the image quality is kinda crap, the resolution seems to be a bit off. I’ve fiddled around with the settings and I’ve been able to improve the image quality by quite a bit, but not enough. I was wondering if someone might know what could solve this.
----------begin_max5_patcher---------- 814.3ocyX9saaBCEF+5To9NXg1kYHrw7Guq1dNlppHfK0cfMCbVSW0d2G1Nj QVIT2TBzJUYwAB9iebNG+Yd95qV4rQri13.9B36fUqdtMxJcLUjUcAV4TlrK sHoQegNb5ihMO3rd+4jzcRc7ePe5PvpDY58Ld9s0zTo41i8ItdqAPerZHf3F rFf7b8.2z8i3aKY7BpTOMd8hJ1J6Bi6BemfK4IkT8T+sZVRwgI2b4xmpnlY1 gwkNqGZ3eyMKSeiZev9LJzo+jzv9s99.gtAj.Xbj9b+45qTisCqe2fqgVzRI fOxF70BN+1+v3VFFohLBCQCyPz4vvMI7bE1FlYAyLxjfMfMigKDFZvUnZvjy MBofW.RoGGjVX3v3B45M4jpplVQ4YfZZR1X.ymfzjJTipXz4AL34.rSTFFMe PptUST.cWknVxJSxo1PJec4GzKZFysNcEHBOe35Alz8mR2RwuXTvWSxRpj.n EHC66qQFxeFQVqXusLQVy1MB7t.EjJHU8HimIdzFzPL8qh8zCPxYyl2PNCLx YxyMREa4RZMvCPrX4LjoybzqkPDL8tA59+j9.fnoOonj1zzu8xAr0q2C3SPW vCUzbfmMDLbeMUrI+4sZFXB6XCIyrK.UIlozFbmP.vfz6SpAPBxqssbrmE9C 78z9Cfggev5HEFegX4Iy.SKDMiutWW26.M4HKd9V7LVeJZMQMJbPHia.c+r8 VCVR3DN8vQJxyKnVTUQN3d7c4gbvN2Cand5WGqjJqEsMFrYSFHc2if3ya6Xv ydSFC6kYd8AlsyMuNwl8hgP5gvOZl+r16m4W6Tv3u3SlnepUm3+vXiXacZmX 1uQYPuG7LZijwSjLAu2Eobdz+ptmkkQ4G8UQJYYUh15g8BAbyoe4Zs1Te3iW WbAKh1hshauUo4iQlOCkImLv6vQShnCuLh1GZjI4HQSlHQigWDUOIZyJoEFu LZCYE2HKSosMZCuLuTQ1kvEsLhCai3PKj3hrRbKyqU6.2xHMEQfSO2PgApdw vXiSPiA3iOBC0Gg8z8vwlsHLEK0Da0iDdYZMRtL8sw3X8Zejf9qDpN5ExVEn c3u.4lN78. -----------end_max5_patcher-----------
If this issue has been covered in another topic I do appologize, but I’m not very familiar with MAX and I havent been able to do a very extensive search.
try [jit.dx.grab @dim 1024 768] (or whatever resolution your webcam runs at)
Oops, my bad. I had already done that, but not in this version of the file. While it does seem the number of pixels increases, the quality remains quite low. Not to mention the image gets stretched from a 4:3 ratio to a 16:9 ratio.
EDIT: I’m trying to do it at a resolution of 1920 x 1080 . I’ve changed numerous of the references to lower resolutions, doesnt seem to do much.
Well yes, your webcam probably operates at 1024×768 or another 4:3 ratio and you have Max coerce it in 1920×1080/16:9 format, which means stretching it up. Did you check your webcam’s specs? If it doesn’t do 1920×1080 natively there has to be some scaling up to bring it up to that size. Some filtering can cover up a bit of the lower resolution artifacts but it’s never going to be crispy clear. Though you can scale up 1024×768 to 1920×1080 without overstretching horizontally by cropping some pixels at top and bottom.
Btw, have you tested your webcam with another application to compare the image quality? Maybe it has poor quality to start with.
My webcam operates at 1920×1080 normally. The image quality it normally does is pretty good I think. Definitely better than this, although the image quality might be just as good if I can get it to work at the proper resolution. It’s a Logitech C920 for reference.
EDIT: Just tried it on a different computer with a different webcam (built-in screen webcam thingy) which also has a standard resolution of 16:9 and it does the same thing.
Sounds like 1 of the objects in your patch is defaulting to 320×240. Check it step by step to see at which step it occurs. Start by checking the output of your grab object by sending it straight to a [jit.window @size 1920 1080] and work your way down the line. Perhaps it’s your webcam driver that needs to be told to output at 1920×1080. Dunno for sure, I’m on Mac.
Ok, thanks, I’ll give it a try.
Forums > MaxMSP