Page 1 of 1

Scale the capture to the processing geometry

Posted: Tue Jul 08, 2008 4:52 pm
by alfrenovsky
Lets say you want to capture at 640x480 to use the full CCD power of your camera, but you want, processing, storage and multi monitor at 320x240.

If you have a good camera, the camera will capture at maximum resolution and then resample to your target resolution. But with cheaps cameras the capture at low resolution will be poor, with a lot of aliasing an noise.

I added the "image.Scale..." line before the Size checking in src/zm_monitor.cpp, line 2486.

Code: Select all

                image.Scale( scale=ZM_SCALE_SCALE*camera->Width()/image.Width() );
                if ( image.Size() != camera->ImageSize() )
                {
                        Error(( "Captured image does not match expected size, check width, height and colour depth" ));
                        return( -1 );
                }

This scales the image using the width to compute the scale.
I could compare first and stop scaling if the widths are the same, but scale function does this internally, at the begining. So there's no overhead.

After that, it does the size (widht*height*bytesperpixel) comparision. So if the aspect ratio or colour depth are not the expected, zoneminder still gets an error.