From 26ba50f8ac32743a1db5efff3420d5019ed13065 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 2 May 2014 08:14:57 -0400 Subject: [PATCH 1/6] Added an FAQ for AlarmCheckMethod --- docs/faq.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index 37bf25af8..cdab3a951 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -32,3 +32,23 @@ Snapshots and Zones images are stored in the `images` directory in your webroot. Ensure that the `images` directory is writable by the user which ZoneMinder is running as. If the `images` directory is a symlink, ensure that your web server has access to that directory as well. + +How do the 3 AlarmCheckMethods interact? +======================================== + +In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, +what happens? + +1. If any of the min/max values is 0 it's ignored +2. If you have a min-alarmed area and you're below that then it quits +3. If you have a max-alarmed area and you're above that then it quits +4. If you're on filtered or blob's and have a min filtered area that you're below then it quits +5. If you're on filtered or blob's and have a max filtered area that you're above then it quits +6. If you're on blobs and have a min blob area then .... + +If AlarmedPixels is seleted, you can only enter min/max pixel threshold and +min/max alarmed area. If FilteredPixels is selected, the Blob options are +disabled. The Blob check method allows you to specify all options. Filtered +adds more checks than alarmed, and blobs adds more checks than filtered. The +final 'score' is calculated using final check method. + From 5fb17ecfb60496b28e6dc05772c37f0691dfef6b Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 2 May 2014 08:16:27 -0400 Subject: [PATCH 2/6] Change one of the FAQs from h1 to h2 --- docs/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index cdab3a951..be5c696fd 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -34,7 +34,7 @@ running as. If the `images` directory is a symlink, ensure that your web server has access to that directory as well. How do the 3 AlarmCheckMethods interact? -======================================== +---------------------------------------- In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, what happens? From 435eac5e7e5ad0184ca576e7e4045e83432d841f Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 2 May 2014 08:28:38 -0400 Subject: [PATCH 3/6] Expanded upon the AlarmCheckMethod FAQ --- docs/faq.rst | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index be5c696fd..51c4ce1dc 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -36,19 +36,26 @@ has access to that directory as well. How do the 3 AlarmCheckMethods interact? ---------------------------------------- -In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, -what happens? +In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, what happens? -1. If any of the min/max values is 0 it's ignored -2. If you have a min-alarmed area and you're below that then it quits -3. If you have a max-alarmed area and you're above that then it quits -4. If you're on filtered or blob's and have a min filtered area that you're below then it quits -5. If you're on filtered or blob's and have a max filtered area that you're above then it quits -6. If you're on blobs and have a min blob area then .... +1. If any of the min/max values is 0, the check that the value is applied to is skipped. +2. If you have a min-alarmed area and you're below that, then it quits. +3. If you have a max-alarmed area and you're above that, then it quits. +4. If you're on filtered or blob's + + 1. and have a min filtered area that you're below then it quits + 2. If you're on filtered or blob's and have a max filtered area that you're + above then it quits + +5. If you're on blobs + + 1. any blob smaller than the min blob area (if set) is discarded + 2. any blob larger than the max blob area (if set) is discarded + 3. If there are less remaining blobs than the minimum-blobs, then it quits. + 4. If there are more remaining blobs than the maximum-blobs, then it quits. If AlarmedPixels is seleted, you can only enter min/max pixel threshold and min/max alarmed area. If FilteredPixels is selected, the Blob options are disabled. The Blob check method allows you to specify all options. Filtered adds more checks than alarmed, and blobs adds more checks than filtered. The final 'score' is calculated using final check method. - From 312f378d08a92432d047236ec545d51853714b8b Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 2 May 2014 08:31:26 -0400 Subject: [PATCH 4/6] Formatting and spell check on the FAQ --- docs/faq.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 51c4ce1dc..3bc59311c 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -41,11 +41,10 @@ In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, w 1. If any of the min/max values is 0, the check that the value is applied to is skipped. 2. If you have a min-alarmed area and you're below that, then it quits. 3. If you have a max-alarmed area and you're above that, then it quits. -4. If you're on filtered or blob's +4. If you're on filtered or blobs 1. and have a min filtered area that you're below then it quits - 2. If you're on filtered or blob's and have a max filtered area that you're - above then it quits + 2. and have a max filtered area that you're above then it quits 5. If you're on blobs @@ -54,7 +53,7 @@ In example, if I set the alarm % to 5-10% and the filtered and blob to 1-100%, w 3. If there are less remaining blobs than the minimum-blobs, then it quits. 4. If there are more remaining blobs than the maximum-blobs, then it quits. -If AlarmedPixels is seleted, you can only enter min/max pixel threshold and +If AlarmedPixels is selected, you can only enter min/max pixel threshold and min/max alarmed area. If FilteredPixels is selected, the Blob options are disabled. The Blob check method allows you to specify all options. Filtered adds more checks than alarmed, and blobs adds more checks than filtered. The From e916ce22d90fd352c1120e392762b4519de506c9 Mon Sep 17 00:00:00 2001 From: aztazt <007@free.fr> Date: Sun, 4 May 2014 02:35:17 +0200 Subject: [PATCH 5/6] Update zm_jpeg.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change 0 to FALSE in order to avoid compiling error on Debian Wheezy: [ 31%] Building CXX object src/CMakeFiles/zm.dir/zm_image.cpp.o /opt/ZoneMinder/src/zm_image.cpp: In member function ‘bool Image::WriteJpeg(const char*, int) const’: /opt/ZoneMinder/src/zm_image.cpp:863:42: error: cannot convert ‘bool’ to ‘boolean’ for argument ‘3’ to ‘void jpeg_set_quality(j_compress_ptr, int, boolean)’ /opt/ZoneMinder/src/zm_image.cpp: In member function ‘bool Image::EncodeJpeg(JOCTET*, int*, int) const’: /opt/ZoneMinder/src/zm_image.cpp:1096:42: error: cannot convert ‘bool’ to ‘boolean’ for argument ‘3’ to ‘void jpeg_set_quality(j_compress_ptr, int, boolean)’ make[2]: *** [src/CMakeFiles/zm.dir/zm_image.cpp.o] Error 1 make[1]: *** [src/CMakeFiles/zm.dir/all] Error 2 make: *** [all] Error 2 --- src/zm_jpeg.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zm_jpeg.cpp b/src/zm_jpeg.cpp index 97ea47b32..92f757ca1 100644 --- a/src/zm_jpeg.cpp +++ b/src/zm_jpeg.cpp @@ -399,12 +399,12 @@ void zm_use_std_huff_tables( j_decompress_ptr cinfo ) { static const JHUFF_TBL dclumin = { { /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, - 0 + FALSE }; static const JHUFF_TBL dcchrome = { { /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, - 0 + FALSE }; static const JHUFF_TBL aclumin = { { /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }, @@ -429,7 +429,7 @@ void zm_use_std_huff_tables( j_decompress_ptr cinfo ) { 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }, - 0 + FALSE }; static const JHUFF_TBL acchrome = { { /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }, @@ -454,7 +454,7 @@ void zm_use_std_huff_tables( j_decompress_ptr cinfo ) { 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa }, - 0 + FALSE }; cinfo->dc_huff_tbl_ptrs[0] = (JHUFF_TBL*)&dclumin; From 4de46c7988131c973d2a529bf376dcb80033b340 Mon Sep 17 00:00:00 2001 From: Kfir Itzhak Date: Mon, 5 May 2014 09:26:32 +0300 Subject: [PATCH 6/6] Fix wrong values used for type boolean --- src/zm_image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_image.cpp b/src/zm_image.cpp index 6af43e83f..80a4f4c21 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -860,7 +860,7 @@ bool Image::WriteJpeg( const char *filename, int quality_override ) const } jpeg_set_defaults( cinfo ); - jpeg_set_quality( cinfo, quality, false ); + jpeg_set_quality( cinfo, quality, FALSE ); cinfo->dct_method = JDCT_FASTEST; jpeg_start_compress( cinfo, TRUE ); @@ -1093,7 +1093,7 @@ bool Image::EncodeJpeg( JOCTET *outbuffer, int *outbuffer_size, int quality_over } jpeg_set_defaults( cinfo ); - jpeg_set_quality( cinfo, quality, false ); + jpeg_set_quality( cinfo, quality, FALSE ); cinfo->dct_method = JDCT_FASTEST; jpeg_start_compress( cinfo, TRUE );