Forums > MaxMSP

I know nothing (jit.dx.grab resolution issue)

December 5, 2012 | 3:58 pm

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.

`

– Pasted Max Patch, click to expand. –

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.



dtr
December 5, 2012 | 6:45 pm

try [jit.dx.grab @dim 1024 768] (or whatever resolution your webcam runs at)


December 6, 2012 | 11:35 am

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.



dtr
December 6, 2012 | 3:37 pm

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.


December 6, 2012 | 3:56 pm

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.



dtr
December 6, 2012 | 4:56 pm

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.


December 6, 2012 | 5:40 pm

Ok, thanks, I’ll give it a try.


Viewing 7 posts - 1 through 7 (of 7 total)