Errata type: Others | Page number: 44 | Errata date: 03 Aug 2011
second paragraph: "number of pixel values per rows" should be "number of pixel values per row" p. 64, 2nd paragraph: "the ROI will determined" s/b "the ROI will be determined" p. 85, 3rd para: "the concept of the concept of" s/b "the concept of" p. 94, 3rd para: "both which are" s/b "both of which are" p. 105 2nd para: "This later is" s/b "This latter is" p. 141 1st para: "theory in details here" s/b "theory in detail here" p. 141 2nd para: "Images differ from each others" s/b "Images differ from each other" p. 169 1st para: "Therefore, do not need" s/b "Therefore, you do not need"
Errata type: Others | Page number: 42 | Errata date: 26 July 2011
In the second paragraph on the third line (word number 4 on the line) the word 'remainder' is misspelt as 'reminder'.
<p><strong>Errata Type: Grammar Page No:37 </strong></p>
<p><strong></strong></p>
<p>On the second paragraph line number 4 The order of the words is inverted: "... 0 corresponds to black and corresponds 255 to white." should be "... 0 corresponds to black and 255 corresponds to white."</p>
<p><strong>Errata Type:Grammar Page No:Multiple </strong></p>
<p><strong></strong></p>
<p>p.g 30, second paragraph: "deprecate data structure" should be "deprecated data structure"</p>
<p>p.g 44, second paragraph: "number of pixel values per rows" should be "number of pixel values per row"</p>
<p>p.g 44, last code sample: "div2" should be "div / 2" p.g 48, third paragraph: "contained into a memory block" should be "contained in a memory block"</p>
<p>p.g 50, last paragraph: "specify larger step size" should be "specify a larger step size"</p>
<p>p.g 64, 2nd paragraph: "the ROI will determined" s/b "the ROI will be determined"</p>
<p>p.g 71, 2nd paragraph: "Vec3d" s/b "Vec3b"</p>
<p>p.g 85, 3rd para: "the concept of the concept of" s/b "the concept of"</p>
<p>p.g 90 1st para: "such that sum" s/b "such that the sum"</p>
<p>p.g 94, 3rd para: "both which are" s/b "both of which are"</p>
<p>p.g 95 1st code sample: "BRG" in comment s/b "BGR"</p>
<p>p.g 99 1st para: "with less than" s/b "with fewer than"</p>
<p>p.g 104 1st para: "consists in replacing" s/b "consists of replacing"</p>
<p>p.g 105 1st & 2nd para: "cv::calBackProject" s/b "cv::calcBackProject"</p>
<p>p.g 105 2nd para: "This later is" s/b "This latter is"</p>
<p>p.g 112 6th para: "proposes few" s/b "proposes a few"</p>
<p>p.g 131 1st para: "The left square is then obtained" s/b "The right square is then obtained"</p>
<p>p.g 137 2nd para: "The next recipe which presents" s/b "The next recipe presents"</p>
<p>p.g 141 1st para: "theory in details here" s/b "theory in detail here"</p>
<p>p.g 141 2nd para: "Images differ from each others" s/b "Images differ from each other"</p>
<p>p.g 153 2nd para: "variation is and it is normally computed" s/b "variation is and is normally computed"</p>
<p>p.g 156 2nd para: "since these ones are by definition" s/b "since these are by definition"</p>
<p>p.g 168 & p. 174 first argument to HoughLines should be "contours", not "test"</p>
<p>p.g 169 1st para: "Therefore, do not need" s/b "Therefore, you do not need"</p>
<p>p.g 175 2nd para: "transform adds few modifications" s/b "transform adds a few modifications"</p>
<p><strong>Errata Type:50 Page No:Code </strong></p>
<p><strong></strong></p>
<p>If you wish to start at the second row ... image.begin<cv::vec3b>()+image.rows SHOULD be ... image.begin<cv::vec3b>()+image.cols </cv::vec3b></cv::vec3b></p>
<p><strong>Errata Type: 50 Page No:</strong></p>
<p><strong></strong></p>
<p>"image.begin<cv::vec3b>()+image.rows" should be "image.begin<cv::vec3b>()+image.cols" and "end<cv::vec3b>()-image.rows" should be "end<cv::vec3b>()-image.cols" </cv::vec3b></cv::vec3b></cv::vec3b></cv::vec3b></p>
<p><strong>Errata Type: Code Page No:269</strong></p>
<p><strong></strong></p>
<p>On the 4th line from below, it appears "processor.etDelayetDelay(...", it should be "processor.setDelay(..."</p>
<p><strong>Errata Type: Typo Page No:42 </strong></p>
<p><strong></strong></p>
<p>In the second paragraph on the third line (word number 4 on the line) the word 'remainder' is misspelt as 'reminder'</p>
<p><strong>Errata Type: Code Page No: 184</strong></p>
<p>On page 184: a const_iterator is used while a regular iterator should have been used since we are calling the erase method on it. You should make that change in the corresponding source file blobs.cpp. <br /> Here the updated file: <br /> #include <iostream> <br /> #include <vector> <br /> #include <opencv2> <br /> #include <opencv2> <br /> #include <opencv2> <br /> int main() <br /> { <br /> // Read input binary image <br /> cv::Mat image= cv::imread("../binaryGroup.bmp",0); <br /> if (!image.data) <br /> return 0; <br /> cv::namedWindow("Binary Image"); <br /> cv::imshow("Binary Image",image); <br /> // Get the contours of the connected components <br /> std::vector<std::vector><cv::point>> contours; <br /> cv::findContours(image, <br /> contours, // a vector of contours <br /> CV_RETR_EXTERNAL, // retrieve the external contours <br /> CV_CHAIN_APPROX_NONE); // retrieve all pixels of each contours <br /> // Print contours' length <br /> std::cout << "Contours: " << contours.size() << std::endl; <br /> std::vector<std::vector><cv::point>>::const_iterator itContours= contours.begin(); <br /> for ( ; itContours!=contours.end(); ++itContours) { <br /> std::cout << "Size: " << itContours->size() << std::endl; <br /> } <br /> // draw black contours on white image <br /> cv::Mat result(image.size(),CV_8U,cv::Scalar(255)); <br /> cv::drawContours(result,contours, <br /> -1, // draw all contours <br /> cv::Scalar(0), // in black <br /> 2); // with a thickness of 2 <br /> cv::namedWindow("Contours"); <br /> cv::imshow("Contours",result); <br /> // Eliminate too short or too long contours <br /> int cmin= 100; // minimum contour length <br /> int cmax= 1000; // maximum contour length <br /> std::vector<std::vector><cv::point>>::iterator itc= contours.begin(); <br /> while (itc!=contours.end()) { <br /> if (itc->size() < cmin || itc->size() > cmax) <br /> itc= contours.erase(itc); <br /> else <br /> ++itc; <br /> } <br /> // draw contours on the original image <br /> cv::Mat original= cv::imread("../group.jpg"); <br /> cv::drawContours(original,contours, <br /> -1, // draw all contours <br /> cv::Scalar(255,255,255), // in white <br /> 2); // with a thickness of 2 <br /> cv::namedWindow("Contours on Animals"); <br /> cv::imshow("Contours on Animals",original); <br /> // Let's now draw black contours on white image <br /> result.setTo(cv::Scalar(255)); <br /> cv::drawContours(result,contours, <br /> -1, // draw all contours <br /> cv::Scalar(0), // in black <br /> 1); // with a thickness of 1 <br /> image= cv::imread("../binaryGroup.bmp",0); <br /> // testing the bounding box <br /> cv::Rect r0= cv::boundingRect(cv::Mat(contours[0])); <br /> cv::rectangle(result,r0,cv::Scalar(0),2); <br /> // testing the enclosing circle <br /> float radius; <br /> cv::Point2f center; <br /> cv::minEnclosingCircle(cv::Mat(contours[1]),center,radius); <br /> cv::circle(result,cv::Point(center),static_cast<int>(radius),cv::Scalar(0),2); <br /> // cv::RotatedRect rrect= cv::fitEllipse(cv::Mat(contours[1])); <br /> // cv::ellipse(result,rrect,cv::Scalar(0),2); <br /> // testing the approximate polygon <br /> std::vector<cv::point> poly; <br /> cv::approxPolyDP(cv::Mat(contours[2]),poly,5,true); <br /> std::cout << "Polygon size: " << poly.size() << std::endl; <br /> // Iterate over each segment and draw it std::vector<cv::point>::const_iterator itp= poly.begin(); <br /> while (itp!=(poly.end()-1)) { <br /> cv::line(result,*itp,*(itp+1),cv::Scalar(0),2); <br /> ++itp; <br /> } // last point linked to first point <br /> cv::line(result,*(poly.begin()),*(poly.end()-1),cv::Scalar(20),2); <br /> // testing the convex hull <br /> std::vector<cv::point> hull; <br /> cv::convexHull(cv::Mat(contours[3]),hull); <br /> // Iterate over each segment and draw it <br /> std::vector<cv::point>::const_iterator it= hull.begin(); while (it!=(hull.end()-1)) { cv::line(result,*it,*(it+1),cv::Scalar(0),2); <br /> ++it; <br /> } // last point linked to first point <br /> cv::line(result,*(hull.begin()),*(hull.end()-1),cv::Scalar(20),2); <br /> // testing the moments <br /> // iterate over all contours <br /> itc= contours.begin(); <br /> while (itc!=contours.end()) { <br /> // compute all moments <br /> cv::Moments mom= cv::moments(cv::Mat(*itc++)); <br /> // draw mass center <br /> cv::circle(result, <br /> // position of mass center converted to integer <br /> cv::Point(mom.m10/mom.m00,mom.m01/mom.m00), <br /> 2,cv::Scalar(0),2); // draw black dot <br /> } <br /> cv::namedWindow("Some Shape descriptors"); <br /> cv::imshow("Some Shape descriptors",result); <br /> // New call to findContours but with CV_RETR_LIST flag <br /> image= cv::imread("../binaryGroup.bmp",0); <br /> // Get the contours of the connected components cv::findContours(image, <br /> contours, // a vector of contours <br /> CV_RETR_LIST, // retrieve the external and internal contours <br /> CV_CHAIN_APPROX_NONE); // retrieve all pixels of each contours <br /> // draw black contours on white image <br /> result.setTo(cv::Scalar(255)); <br /> cv::drawContours(result,contours , <br /> -1, // draw all contours <br /> cv::Scalar(0), // in black <br /> 2); // with a thickness of 2 <br /> cv::namedWindow("All Contours"); <br /> cv::imshow("All Contours",result); <br /> cv::waitKey(); <br /> return 0; <br /> } </cv::point></cv::point></cv::point></cv::point></int></cv::point></std::vector></cv::point></std::vector></cv::point></std::vector></opencv2></opencv2></opencv2></vector></iostream></p>
<p><strong>Errata Type: code Chapter 4</strong></p>
<p><strong></strong></p>
<p>In Chapter 4, the class ContentFinder.h is not present in the sample code. The solution to this can be found at <a target="_Blank" href="site-url">http://www.laganiere.name/opencvCookbook/</a></p>
<p><strong>Errata type: Typo | Page number: 37</strong></p>
<p>The order of the words is inverted: "... 0 corresponds to black and corresponds 255 to white." should be "... 0 corresponds to black and 255 corresponds to white."</p>
<p> </p>
<p><span><strong>Errata type: Typo | Page number: 219 | </strong></span><strong>Second paragraph:</strong></p>
<p>This relation allows the position of the image of a 3D scene point <strong>to be predicted</strong> onto the image plane of a camera.</p>
<p><strong>should be:</strong></p>
<p>This relation allows <strong>to predict what will be</strong> the position of the image of a 3D scene point onto the image plane of a camera.</p>