{"@attributes":{"version":"2.0"},"channel":{"title":"Documentation \u2013 Image processing","link":"https:\/\/docs.aspose.cloud\/ocr\/process-image\/","description":"Recent content in Image processing on Documentation","generator":"Hugo -- gohugo.io","lastBuildDate":"Mon, 27 Nov 2023 00:00:00 +0000","item":[{"title":"Developer-Reference: Skew correction","link":"https:\/\/docs.aspose.cloud\/ocr\/deskew-image\/","pubDate":"Mon, 27 Nov 2023 00:00:00 +0000","guid":"https:\/\/docs.aspose.cloud\/ocr\/deskew-image\/","description":"\n        \n        \n        <style>\n\tbutton {\n\t\tcursor: pointer;\n\t\tmargin-right: 20px;\n\t\tpadding: 7px 15px;\n\t\tborder: none;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #1a89d0;\n\t\tfont-weight: 700;\n\t\tfont-size: 15px;\n\t\tcolor: #ffffff;\n\t}\n\n\tbutton:hover {\n\t\tbackground-color: #3071a9;\n\t}\n\n\tbutton:focus {\n\t\toutline: none;\n\t}\n\n\t.code-sample {\n\t\tdisplay: flex;\n\t}\n\n\t.code-sample > div {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tpadding: 5px 10px;\n\t\tborder-radius: 5px;\n\t\twhite-space: nowrap;\n\t\tbackground-color: rgba(0,0,0,5%);\n\t\tfont-size: 16px;\n\t\tfont-weight: 700;\n\t}\n\n\t.unseen {\n\t\tdisplay: none !important;\n\t}\n\n\t.duo {\n\t\tposition: relative;\n\t\twidth: 800px;\n\t\theight: 474px;\n\t}\n\n\t.duo > img {\n\t\tposition: absolute;\n\t}\n<\/style>\n<p>When a page is fed to a flatbed scanner (mechanically or manually) or photographed with a smartphone, it is nearly impossible to achieve perfect alignment. As a result, a slight skew (tilt) inevitably occurs in scanned images or photographs.<\/p>\n<p>Skew angle detection and image straightening is critical to the OCR process as it directly affects the reliability and efficiency of segmentation and text extraction. Aspose.OCR Cloud offers automated processing algorithms to correct image tilt (deskew).<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\nAutomatic deskew works for images rotated 15 degrees or less. If the image is rotated by a larger degree or upside down, you must manually specify the rotation angle in recognition settings.\n<\/div>\n\n<div class=\"duo\">\n\t<img src=\"skew-origin.png\" alt=\"Skewed image\" \/>\n\t<img src=\"deskew.png\" alt=\"Deskewed image\" style=\"display: none;\" \/>\n<\/div>\n<button onclick=\"triggerSkew(this)\">Automatically deskew image<\/button>\n<script>\n\tfunction triggerSkew(obj)\n\t{\n\t\tlet images = $(\".duo > img\");\n\t\tlet skewed = images.eq(0).is(\":visible\");\n\t\tif(skewed)\n\t\t{\n\t\t\timages.eq(1).show(200);\n\t\t\timages.eq(0).hide(200);\n\t\t\t$(obj).text(\"View original image\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\timages.eq(0).show(200);\n\t\t\timages.eq(1).hide(200);\n\t\t\t$(obj).text(\"Automatically deskew image\");\n\t\t}\n\t}\n<\/script>\n<h2 id=\"manual-skew-correction\">Manual skew correction<\/h2>\n<p>When the image is rotated by a significant angle or upside down, automatic skew correction may fail to detect the correct angle.<\/p>\n<p>To deal with such situations, you can manually specify the image rotation angle using the <code>rotate<\/code> recognition setting, which is available for all image recognition methods.<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\n<ul>\n<li>Manual image rotation can be combined with automatic deskew for best results.<\/li>\n<li>You cannot get the rotated image as a file.<\/li>\n<\/ul>\n\n<\/div>\n\n<h3 id=\"curl-example\">cURL example<\/h3>\n\n\n\n\n\n<nav>\n  <div class=\"book-tabs nav nav-tabs\" id=\"nav-tab\" role=\"tablist\">\n      <input type=\"radio\" class=\"toggle\" name=\"tabs-1\" id=\"tabs-1-1\" checked=\"checked\" \/>\n      <label for=\"tabs-1-1\">Request<\/label>\n      <div class=\"book-tabs-content markdown-inner\"><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">curl --request POST --location <span class=\"s1\">&#39;https:\/\/api.aspose.cloud\/v5.0\/ocr\/RecognizeImage&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--header <span class=\"s1\">&#39;Accept: text\/plain&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--header <span class=\"s1\">&#39;Content-Type: application\/json&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--header <span class=\"s1\">&#39;Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...HaRYOxBcCRCPLnrFCVXpw7UA&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--data-raw <span class=\"s1\">&#39;{\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">  &#34;image&#34;: &#34;iVBORw0KGgoAAAANSUh...d1iEAAAAASUVORK5CYII=&#34;,\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">  &#34;settings&#34;: {\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">    &#34;language&#34;: &#34;English&#34;,\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">    &#34;rotate&#34;: 90,\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">    &#34;resultType&#34;: &#34;Text&#34;\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">  }\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">}&#39;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><\/div>\n      <input type=\"radio\" class=\"toggle\" name=\"tabs-1\" id=\"tabs-1-2\"  \/>\n      <label for=\"tabs-1-2\">Response<\/label>\n      <div class=\"book-tabs-content markdown-inner\"><pre tabindex=\"0\"><code>a197aade-bba9-4c7a-92c7-46851b3dceaa\n<\/code><\/pre><\/div><\/div>\n<\/nav>\n\n<h2 id=\"usage-scenarios\">Usage scenarios<\/h2>\n<ul>\n<li>Straightening skewed images.<\/li>\n<li>Turning flipped images.<\/li>\n<\/ul>\n\n      "},{"title":"Developer-Reference: Dewarping","link":"https:\/\/docs.aspose.cloud\/ocr\/dewarp-image\/","pubDate":"Mon, 27 Nov 2023 00:00:00 +0000","guid":"https:\/\/docs.aspose.cloud\/ocr\/dewarp-image\/","description":"\n        \n        \n        <style>\n\tbutton {\n\t\tcursor: pointer;\n\t\tmargin-right: 20px;\n\t\tmargin-bottom: 20px;\n\t\tpadding: 7px 15px;\n\t\tborder: none;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #1a89d0;\n\t\tfont-weight: 700;\n\t\tfont-size: 15px;\n\t\tcolor: #ffffff;\n\t}\n\n\tbutton:hover {\n\t\tbackground-color: #3071a9;\n\t}\n\n\tbutton:focus {\n\t\toutline: none;\n\t}\n\n\t.duo {\n\t\tposition: relative;\n\t\twidth: 500px;\n\t\theight: 454px;\n\t\tmargin-bottom: 20px;\n\t}\n\n\t.duo > img {\n\t\tposition: absolute;\n\t}\n<\/style>\n<p>Geometric distortions is a very common case when dealing with photos of books, magazines, multi-page documents, and similar content. They can be caused by physical page curvature or camera lens distortion (ultra-wide and fisheye lenses, as well as entry-level smartphone lenses).<\/p>\n<p>Warped images are very hard to be processed by most OCR algorithms. Thus, image straightening and distortion removal is critical to the recognition process as it directly affects the reliability and efficiency of segmentation and text extraction. Aspose.OCR Cloud has a preprocessing filter for automated correction of geometric image distortions.<\/p>\n<div class=\"duo\">\n\t<img src=\"warped-page.png\" alt=\"Curved page photo\" \/>\n\t<img src=\"dewarped-page.png\" alt=\"Dewarped image\" style=\"display: none;\" \/>\n<\/div>\n<button onclick=\"triggerSkew(this)\">Dewarp image<\/button>\n<script>\n\tfunction triggerSkew(obj)\n\t{\n\t\tlet images = $(\".duo > img\");\n\t\tlet skewed = images.eq(0).is(\":visible\");\n\t\tif(skewed)\n\t\t{\n\t\t\timages.eq(1).show(200);\n\t\t\timages.eq(0).hide(200);\n\t\t\t$(obj).text(\"View original image\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\timages.eq(0).show(200);\n\t\t\timages.eq(1).hide(200);\n\t\t\t$(obj).text(\"Automatically dewarp image\");\n\t\t}\n\t}\n<\/script>\n<h2 id=\"usage-scenarios\">Usage scenarios<\/h2>\n<ul>\n<li>Straightening lines in curved pages.<\/li>\n<li>Fixing geometric distortions on ultra-wide or fisheye photos.<\/li>\n<\/ul>\n\n      "},{"title":"Developer-Reference: Upsampling","link":"https:\/\/docs.aspose.cloud\/ocr\/upsample-image\/","pubDate":"Mon, 27 Nov 2023 00:00:00 +0000","guid":"https:\/\/docs.aspose.cloud\/ocr\/upsample-image\/","description":"\n        \n        \n        <style>\n\tbutton {\n\t\tcursor: pointer;\n\t\tmargin-right: 20px;\n\t\tmargin-bottom: 20px;\n\t\tpadding: 7px 15px;\n\t\tborder: none;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #1a89d0;\n\t\tfont-weight: 700;\n\t\tfont-size: 15px;\n\t\tcolor: #ffffff;\n\t}\n\n\tbutton:hover {\n\t\tbackground-color: #3071a9;\n\t}\n\n\tbutton:focus {\n\t\toutline: none;\n\t}\n\n\t.duo {\n\t\tposition: relative;\n\t\twidth: 500px;\n\t\theight: 419px;\n\t\tmargin-bottom: 20px;\n\t}\n\n\t.duo > img {\n\t\tposition: absolute;\n\t}\n<\/style>\n<p>The Aspose.OCR Cloud recognition engine can work with images of any size. However, when recognizing very small images, it may ignore some font detail or incorrectly separate dense lines. Straightforward resizing will not help in these situations, as it will mechanically increase the width and height of the image without actually improving the detail.<\/p>\n<p>Aspose.OCR Cloud offers a smart upsampling algorithm that can increase image resolution and enhance the contrast of text details, greatly improving recognition accuracy.<\/p>\n<div class=\"duo\">\n\t<img src=\"small-image.png\" alt=\"Small image\" \/>\n\t<img src=\"upsampled-image.png\" alt=\"Smart upsampling\" style=\"display: none;\" \/>\n<\/div>\n<button onclick=\"triggerSkew(this)\">Upsample image<\/button>\n<script>\n\tfunction triggerSkew(obj)\n\t{\n\t\tlet images = $(\".duo > img\");\n\t\tlet skewed = images.eq(0).is(\":visible\");\n\t\tif(skewed)\n\t\t{\n\t\t\timages.eq(1).show(200);\n\t\t\timages.eq(0).hide(200);\n\t\t\t$(obj).text(\"View original image\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\timages.eq(0).show(200);\n\t\t\timages.eq(1).hide(200);\n\t\t\t$(obj).text(\"Upsample image\");\n\t\t}\n\t}\n<\/script>\n<h2 id=\"usage-scenarios\">Usage scenarios<\/h2>\n<ul>\n<li>Increasing text size on medication guides or food labels.<\/li>\n<li>Improving readability of small images or photos.<\/li>\n<\/ul>\n\n      "},{"title":"Developer-Reference: Binarization","link":"https:\/\/docs.aspose.cloud\/ocr\/binarize-image\/","pubDate":"Mon, 27 Nov 2023 00:00:00 +0000","guid":"https:\/\/docs.aspose.cloud\/ocr\/binarize-image\/","description":"\n        \n        \n        <style>\n\tbutton {\n\t\tcursor: pointer;\n\t\tmargin-right: 20px;\n\t\tmargin-bottom: 20px;\n\t\tpadding: 7px 15px;\n\t\tborder: none;\n\t\tborder-radius: 5px;\n\t\tbackground-color: #1a89d0;\n\t\tfont-weight: 700;\n\t\tfont-size: 15px;\n\t\tcolor: #ffffff;\n\t}\n\n\tbutton:hover {\n\t\tbackground-color: #3071a9;\n\t}\n\n\tbutton:focus {\n\t\toutline: none;\n\t}\n\n\t.duo {\n\t\tposition: relative;\n\t\twidth: 600px;\n\t\theight: 324px;\n\t\tmargin-bottom: 20px;\n\t}\n\n\t.duo > img {\n\t\tposition: absolute;\n\t}\n<\/style>\n<p>Although you can extract text from color scans or photographs, text recognition and area detection gives better results with black and white images. The conversion to black and white is called <em>binarization<\/em>.<\/p>\n<p>Aspose.OCR Cloud can automatically convert images to black and white without losing the details required for recognition. Moreover, it can intellectually remove text background, color noise, and other unnecessary data.<\/p>\n<div class=\"duo\">\n\t<img src=\"color-image.png\" alt=\"Colored image\" \/>\n\t<img src=\"binarized-image.png\" alt=\"Monochrome image\" style=\"display: none;\" \/>\n<\/div>\n<button onclick=\"triggerSkew(this)\">Binarize image<\/button>\n<script>\n\tfunction triggerSkew(obj)\n\t{\n\t\tlet images = $(\".duo > img\");\n\t\tlet skewed = images.eq(0).is(\":visible\");\n\t\tif(skewed)\n\t\t{\n\t\t\timages.eq(1).show(200);\n\t\t\timages.eq(0).hide(200);\n\t\t\t$(obj).text(\"View original image\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\timages.eq(0).show(200);\n\t\t\timages.eq(1).hide(200);\n\t\t\t$(obj).text(\"Binarize image\");\n\t\t}\n\t}\n<\/script>\n<h2 id=\"usage-scenarios\">Usage scenarios<\/h2>\n<ul>\n<li>Increase the contrast of photographed texts.<\/li>\n<li>Significantly reduce the size of color images.<\/li>\n<\/ul>\n\n      "},{"title":"Developer-Reference: Contrast correction","link":"https:\/\/docs.aspose.cloud\/ocr\/correct-image-contrast\/","pubDate":"Mon, 27 Nov 2023 00:00:00 +0000","guid":"https:\/\/docs.aspose.cloud\/ocr\/correct-image-contrast\/","description":"\n        \n        \n        <p>Low contrast and blurring are the most typical distortions when text is photographed with a smartphone camera, especially in low light conditions. They make it difficult for the OCR algorithms to operate successfully, significantly reducing the recognition accuracy.<\/p>\n<p>Aspose.OCR Cloud can automatically increase the contrast of images before proceeding to recognition. Set the <code>makeContrastCorrection<\/code> recognition setting to <code>true<\/code> to enable the automatic contrast adjustment. This setting is available for all image recognition methods.<\/p>\n\n\n<div class=\"alert alert-primary\" role=\"alert\">\n\nYou cannot get the preprocessed image as a file.\n<\/div>\n\n<h2 id=\"curl-example\">cURL example<\/h2>\n\n\n\n\n\n<nav>\n  <div class=\"book-tabs nav nav-tabs\" id=\"nav-tab\" role=\"tablist\">\n      <input type=\"radio\" class=\"toggle\" name=\"tabs-1\" id=\"tabs-1-1\" checked=\"checked\" \/>\n      <label for=\"tabs-1-1\">Request<\/label>\n      <div class=\"book-tabs-content markdown-inner\"><div class=\"highlight\"><pre tabindex=\"0\" class=\"chroma\"><code class=\"language-bash\" data-lang=\"bash\"><span class=\"line\"><span class=\"cl\">curl --request POST --location <span class=\"s1\">&#39;https:\/\/api.aspose.cloud\/v5.0\/ocr\/RecognizeImage&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--header <span class=\"s1\">&#39;Accept: text\/plain&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--header <span class=\"s1\">&#39;Content-Type: application\/json&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--header <span class=\"s1\">&#39;Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...HaRYOxBcCRCPLnrFCVXpw7UA&#39;<\/span> <span class=\"se\">\\\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"se\"><\/span>--data-raw <span class=\"s1\">&#39;{\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">  &#34;image&#34;: &#34;iVBORw0KGgoAAAANSUh...d1iEAAAAASUVORK5CYII=&#34;,\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">  &#34;settings&#34;: {\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">    &#34;language&#34;: &#34;English&#34;,\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">    &#34;makeContrastCorrection&#34;: true,\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">    &#34;resultType&#34;: &#34;Text&#34;\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">  }\n<\/span><\/span><\/span><span class=\"line\"><span class=\"cl\"><span class=\"s1\">}&#39;<\/span>\n<\/span><\/span><\/code><\/pre><\/div><\/div>\n      <input type=\"radio\" class=\"toggle\" name=\"tabs-1\" id=\"tabs-1-2\"  \/>\n      <label for=\"tabs-1-2\">Response<\/label>\n      <div class=\"book-tabs-content markdown-inner\"><pre tabindex=\"0\"><code>a197aade-bba9-4c7a-92c7-46851b3dceaa\n<\/code><\/pre><\/div><\/div>\n<\/nav>\n\n\n      "}]}}