2023:IP Profile (Node Type)
An IP Profile is a sequence of instructions for image processing. They are composed of IP Steps and IP Groups (which are themselves collections of IP Steps). Each IP Step contains an IP Command, which define image processing operations.
| Previous Versions |
|---|
These operations generally fall into three categories:
- Archival Adjustments - These are permanent adjustments to the exported document's image.
- Permanent image adjustments are performed when an IP Profile is executed during the Image Processing activity.
- OCR Cleanup - Image cleanup can dramatically improve OCR results.
- However, they can also drastically alter the document's image. Image adjustments are temporarily applied to a document prior to OCR when an IP Profile is executed during the Recognize activity. This is useful for non-destructive image clean up to improve OCR results, keeping the document's pages as their original image to preserve their archival images upon export.
- Layout Data Collection - This includes visual information used for data extraction purposes (such as table line locations, barcode information, OMR checkbox states) as well as image features used for Visual classification.
- Layout Data can be collected either during the Image Processing or the Recognize activities.
Permanent vs. Temporary Image Processing
The Image Processing (Activity) activity permanently alters a document's image by applying an IP Profile. However, it is possible to temporarily clean up document images and revert back to the original document image. This is done during the Recognize activity.
For example, you may have a document where table lines are getting in the way of accurate OCR. However, if you remove these lines during the Image Processing activity, they will be permanently removed, making it difficult to review the documents in Data Review and changing the archival image stored later to something that no longer looks like the original document.
Instead, you can use an OCR Profile which references an IP Profile that has a Line Removal step during Recognize. The image will be temporarily changed according to the IP Profile. Then, OCR will run on the altered image. Last, the image will revert back to its original form, retaining the OCR results from the pre-processed image as well as the original image.
- Furthermore, any image based data targeted by the IP Profile (such as the table line locations for this example) will still be saved to the Batch Page for later use.
For more information on both permanent and temporary image processing as a concept, visit the Image Processing (Concept) article.
Anatomy of the IP Profile Tab
After making an IP Profile, you will add the IP Steps to the node tree under the IP Profile. You can test the full IP Profile from either the IP Profile itself or on the IP Step.
|
|
|
By default, anytime you test on an IP Step, you will test for the whole IP Profile. There are rare situations where you might want to see what an IP Step does in isolation outside of the rest of the IP Profile.
|
|
IP Steps in the profile are listed, selected, and added in the node tree under the IP Profile object. IP Profiles are a sequential list of IP Steps, each one performing a image processing operation called an IP Command. This IP Profile is very simple. It only has one IP Step, using the Auto Deskew IP Command. IP Steps are added to the list by right-clicking on the IP Profile object, mousing-over "Add Command", then selecting the category and IP Step. Changing the order of the steps is the same process of moving objects around in Grooper: either click and drag the object to another location, or hold "Ctrl" and press the up or down key on your keyboard. |
|
Here, you can select a Test Batch to help you configure your IP Profile. All alterations to the documents in the Test Batch are done in memory when configuring an IP Profile. They will retain their original form unless the IP Profile is applied using the Image Processing activity. |
|
Each IP Command has its own set of configurable properties. Here, you can adjust them as needed to fit the demands of your document set.
|
|
The Diagnostics Panel is extremely helpful when configuring IP Command Properties and verifying steps are processing a document as intended. It contains a number of images for each IP Step related to how its IP Command is altering the image, including a before "Input Image" and after "Output Image" |
|
Last but not least is the Document Viewer. This allows you to view the document selected in the Batch Selector. This window will also show you the selected image in the Diagnostics Panel. |
How To
Create a new IP Profile
Before you create an IP Profile, you will likely want a Test Batch to verify its results. Be sure to create a Test Batch before creating an IP Profile
Add a New IP Profile
IP Profiles may be created and stored in a Content Model's Local Resources folder.
|
|
|
|
|
|
|
Before going any further, the first thing you will want to do is select a Test Batch.
|
Add IP Steps
IP Steps are the individual elements of an IP Profile. The IP Profile will execute each step, one after other, altering the image according to whatever IP Command the IP Step uses.
|
|
|
|
|
Verify the Results
|
|
|
In the "Document Viewer" window, you can see the image was de-skewed by the single IP Step in our IP Profile. Now it's nice and straight, which is both visually appealing (an Archival Adjustment) and give us better OCR results (an OCR Cleanup). Notice a couple other things happened after we hit that "Execute" button as well.
|
| ! | Pressing the "Execute" button does not actually modify the selected document.
All alterations to the documents in the Test Batch are done in memory when configuring an IP Profile. Furthermore, any time you navigate to another document the IP Profile will "execute" on the temp batch (In other words, there's no need to press the Execute button unless you want to verify the results of the IP Profile on the currently selected document. |
| FYI | If you do want to permanently apply the IP Profile to a page, you can do so in an ad hoc manner by selecting a page and pressing the "Save Processed Page" button. This will permanently apply the IP Profile's steps to the page in the Test Batch. |
Sample Configuration of an IP Profile for Permanent Image Processing
Permanent IP makes alterations to the archival version of the exported document. As permanent image processing is, after all, permanent, you must be careful about which commands you use. Most often, IP Profiles for Permanent IP are fairly small, performing only moderate adjustments to the image. More drastic alterations that improve OCR but dramatically alter the image are left for Temporary IP Profiles.
Before anything, you need a sample document set of the kinds of documents targeted by your IP Profile. Once you have these documents ready in a Test Batch, it's a good idea to evaluate them, getting an idea about the kinds of issues the document set has. Below are the documents we will be looking at and some of the issues involved with them.
The first step we will add is an "Auto Border Crop" command. This command will only crop an image if it detects a border in an established zone. So, only those documents with borders should be affected.
|
|
|
|
|
For our document, the basic settings did not alter the image. There is no "Output Image" in the Diagnostics Panel. You can also see clearly there is still a black border on the image in the Document Viewer. |
|
|
The border is quite larger than normal. Changing the "Border Region Size" to 0.75 in on all four sides will properly crop this document. The diagnostic images are useful when configuring any IP Step's properties. In the case of Auto Border Crop, you'll want to use the "Zoning" image to configure the zone where the border falls. The Border Region zone is shown by the thin red rectangle. It encapsulates some, but not all of the border (from the edge of the document to the edge of the Border Region) using the default of 0.25 in. |
|
|
Let's go ahead and change the Border Region Size.
|
|
|
By increasing the Border Region Size to 0.75 in you can see the zone now entirely encapsulates the border. |
|
|
Now, you can see the step removes (most of) the border. |
The remaining part of the border can be removed using the "Border Fill Settings" or adding an "Border Fill" step.
Next, we need to take care of the upside down image. This can be done with an "Auto Orient" step. This step will automatically detect the orientation of the image based on the text on the page. If the page is upright, Auto Orient will detect the text reads like normal and do nothing. If the command detects the text is upside down, it will re-orient the page, turning it right-side up.
|
|
|
|
|
|
Next we need to take care of the skewed text. For this, we will use the Auto Deskew command.
|
|
|
|
|
Further Decision Making
The previous three IP Commands are very commonly found in Permanent IP Profiles. Since they determine automatically if a page is skewed, has a border, or is oriented incorrectly, there is significantly less risk that these commands will negatively impact the rest of the document set (less risk, but not none!). For any other IP Commands, you have one major question to ask.
How much do you want to alter the original image?
Anything you do with a Permanent IP Profile will affect the final document you send out during export. Keep in mind, there are ways to temporarily apply an IP Profile to improve OCR Results later.
When making your choices on what other IP Commands to add to a Permanent IP Profile you should focus on altering the document for human readability without negatively impacting machine readability (i.e. OCR results).
For example, the "Brightness Contrast" Color Adjustment command can be very helpful to increase both the human and machine readability for some documents. It modifies the brightness or contrast of an image (or both).
| Increasing the Brightness property to "10" and the Contrast property to "40" cleans up the first page of this document nicely. The background has been removed while preserving the text. | |
![]() |
![]() |
However, you be sure to verify it does not negatively impact other pages.
Furthermore, the IP Profile runs on all documents in the batch. Be sure it isn't adversely affecting other documents.
For situations like this, you may need to find a happy middle ground.
The "Contrast Stretch" command is often used to help improve the image quality of documents. It works to normalize the image's contrast. It adjust the contrast so that the lightest pixels are turned pure white and darkest are turned pure black.
| It doesn't do quite as good of a job as the "Brightness Contrast" command but it does brighten up the whites and darken the black parts of the image a bit. | |
![]() |
![]() |
| And it does so without losing the handwritten text on this document. |
![]() |
Just as you need to think about how one command will adversely effect other documents in the set, you can take advantage of documents that are very different from others in the set.
| FYI | There are some ways to leverage image based information to create conditional logic around what steps to execute in an IP Profile. Visit the Conditional IP section of this article for more information. |
Make Adjustments
It's very rare when you make an IP Profile and everything works perfectly without doing some unit testing and adjusting some properties on a step or two. Take our "Auto Border Crop" step and our two documents with borders. As we configured the step, this is the results of our two transcripts.
![]() |
![]() |
Depending on what route we want to take, there's still some cleaning up on these borders we can do. The easiest thing to do at this point would be to add a "Border Fill" command to clean up the black edges on the left side of these documents.
|
|
|
|
|
|
|
|
|
If we set the method to "Inclusive" it will include borders that overlap the border zone, dropping them out.
|
|
|
But what if we start looking at these documents and don't actually want to remove the border for the transcript on the left but do want to remove the border for the right?
| Keep this border | Remove this border |
![]() |
For this document set, there's a trick we can do using the properties of "Auto Border Crop" and "Border Fill" to do this. First we will configure "Auto Border Crop" to crop the blue transcript and not the brown one. Looking at the brown transcript, that border is actually part of the document. As such, there is a sliver of white pixels around the document. We can use the "Maximum Border Weight" property to only drop out perfectly solid borders.
|
|
|
|
|
|
|
|
|
|
|
We are left with two originally bordered images, one of which was removed and one of which was not.
![]() |
![]() |
Granted, this really only worked because of how these documents came into Grooper. We got lucky in that there was a slight amount of white pixels on each edge of the brown transcript, making the "border" not perfectly solid. That being said, a lot of how you configure Grooper's properties to target certain documents and not others is based of analyzing certain aspects of the documents. We wouldn't have even known to try this approach if we hadn't noticed that border on the brown transcript wasn't a true border.
Sample Configuration of an IP Profile for Temporary Image Processing
For temporary image processing, we don't need to be concerned with how this image will look upon export. We only need to concern ourselves with cleaning up the image to improve OCR results.
The general plan is (as much as possible) get rid of anything on the page that is not text. This way non-text artifacts on the page will not interfere with the OCR Engine recognizing actual text characters. If these pixels simply are not present, the OCR engine won't have to figure out if they are part of a line, word, or character when segmenting the image. Similarly, if they aren't part of a character, once the image is segmented all the way down to an individual character, they won't confuse the OCR engine when it comes time to recognizing what text character that character segment should be.
Before anything, you need a sample document set of the kinds of documents targeted by your IP Profile. Once you have these documents ready in a Test Batch, it's a good idea to evaluate them, getting an idea about the kinds of issues the document set has. Below are the documents we will be looking at and some of the issues involved with them.
OCR absolutely must work with a black and white image. While OCR engines will turn image black and white on their own, they don't always do a great job at it. Furthermore, you have no control over how the OCR engine turns the image black and white. Grooper's image processing capabilities allow for greater configuration of how an image is turned into a black and white image before handing it to the OCR engine. The vast majority of temporary IP Profiles will contain a "Threshold" or "Binarize" step to convert color and grayscale images into true black and white.
|
Knowing this, let's use a "Threshold" command as our starting point.
|
|||
|
|||
|
This document was a grayscale image previously, and now has been turned black and white using the Auto thresholding method.
We are going to keep the default settings for this step. For more information about thresholding methods, visit the Binarize article.
|
Moving onto the next document, we can see this document was indeed turned black and white, but there's another problem we have to deal with.
This is a very common problem. Grooper's "Negative Region Removal" command is designed to address this.
|
|
|
|
|
Recall the three major reasons for image processing in Grooper: (1) Archival Adjustments (2) OCR Cleanup, and (3) Layout Data Collection. This next step will focus on getting some layout data (3), with the added benefit of helping out our OCR a little bit (2). This will also be the first step that illustrates the importance of configuring an IP Command's properties to narrow down what you do and don't want to remove from a document.
OMR stands for Optical Mark Recognition. OMR has been around for even longer than OCR. Remember back in school when you took a test and filled in bubbles on an answer sheet with a No. 2 pencil? Well, those answer sheets were graded by OMR! The answer sheet was fed into a scanner (probably a Scantron) that would detect if a bubble was filled in or not. Grooper is doing something similar here. The main difference, is first Grooper has to find the box! The "Box Removal" command first detects boxes and save their locations on the page to the LayoutData.json file attached to that page. Once it does, it will check to see if there are any marks inside the box, if any pixels are filled within the boundaries of the box. If they are, it will record that box as "checked" in the LayoutData.json file, or "unchecked" if blank. Last, it will remove the boxes from the page, clearing the way for better OCR results.
|
|
|
|
|
|
|
Based on the "Output Image" you can see the boxes on this document have been removed, such as the ones highlighted. |
|
|
If you come across a situation where Grooper is not detecting and removing the boxes, you may want to see if editing the Minimum Size Range property would help.
If we were to set this property to 7pt, Grooper would not have detected the boxes on this Closing Disclosure document. Remember that any adjustments you make affect the whole Batch and not just an individual document. If you make an adjustment to account for an issue on one document, check your other documents to make sure you are still getting the desired result. |
| ⚠ |
When adding a "Box Removal" IP Step to the temporary IP Profile, Grooper automatically detects these boxes and adds them to the layout data. You do not need to add a separate "Box Detection" step to the IP Profile. |
One of the most common temporary image processing adjustments for OCR cleanup is the "Line Removal" command. Lines are present on most documents in one way or another. They are used to create and divide tables, sections or individual fields on a document. This is great for humans reading a document! They act as visual dividers of information. They are not so great for OCR. Simply removing lines, in most cases, will greatly improve your OCR results. We will add a "Line Removal" command, and look at some common configuration issues.
Conditional IP
What happens when you have documents in your document set that just don't fit your IP Profile? Perhaps one configuration of a Box Removal command works for most of the documents, but there's one type of document that needs an entirely different configuration. What happens if most of the documents in your set perform well using the standard "Auto" thresholding method, but one works better using "Adaptive"?
In these situations, you may be able to use conditional logic via the "Should Execute" and "Next Step" expressions on IP Steps and IP Groups in an IP Profile. These expressions allow us to use snippets of .NET code to access information about the image or steps in the profile, and use them to determine if and when a step should run in an IP Profile.
Example: Should Execute Based on Classify Image
Different IP Steps, IP Groups or even entire IP Profiles can be executed based on the results of the "Classify Image" command. The "Classify Image" command compares an image against a set of sample images and classifies the image based on which sample it is most similar to. It does this by analyzing the color space of an image. For example, the RBG color space is made up of a red channel, a green channel, and a blue channel. The similarity would then be based on how similar the information in these three channels is to another image. For example, if a sample image has a high value in the red channel but a low value in the blue channel, it would not match an image that has a high blue channel but a low red channel.
For this example, we will create a conditional expression for thresholding these two documents.
![]() |
|
The blue transcript is a good candidate for using "Adaptive" thresholding over the "Auto" method.
| Auto | Adaptive |
![]() |
|
However, the brown transcript is handled better by the "Auto" thresholding method.
| Auto | Adaptive |
![]() |
|
We will use the "Classify Image" command to have one image use "Auto" and the other "Adaptive".
Add IP Steps
|
This IP Profile will have three IP Steps: One "Classify Image" and two "Threshold" commands, one of which uses the "Adaptive" method and the other which uses the "Auto" method. Here, the two "Threshold" commands have been renamed accordingly. |
Give Classify Image Sample Images
|
|
|
|
|
|
|
Select the Color Space to Analyze
|
Next, select the color space you wish to use to classify the image. There are a variety of color space options, each of which measures different channels making up a document's color. For this example we are using the HSV color space, which measures hue, saturation, and value (pixel intensity). |
|
|
Classify Image's Execution Log shows the measurements for the selected color channel and how similar they are to the sample image. All color spaces will have "Channel 1", "Channel 2", "Channel 3" and "Entropy" listed under "Source Image Features" These are the image based measurements of the selected image. The three channels correspond to the information in the three channels of the selected color space. For HSV, "Channel 1" is the hue, "Channel 2" is the saturation, and "Channel 3" is the value. "Entropy" is a measure of how "busy" the image is. The more black text on a document, the higher the entropy measure will be. The similarity score to each trained image is seen under "Results for Trained Image Classes". We only trained one image, the "Blue Transcript", which is coming in as "100%" similar. The image is assigned a classification based on how similar the three channels and the entropy are to the trained images (assuming it meets the "Minimum Similarity" score). This image is classified as "Blue Transcript". This can be verified by its "Class Name". |
|
|
We can look at the Execution Log for the brown transcript, and we see it came in at a lower similiarity of 86.51%. However, if we look at the "Class Name" it's coming in as the Blue Transcript classification. |
|
|
|
|
The Class Name for the brown transcript now shows as "None". Now that we have a benchmark that can tell one image from the other, we can use it to conditionally threshold the image. |
Set the Should Execute Expression
|
Next we need to figure out and apply our logic for thresholding these documents. If the image is classified as "Blue Transcript" we want to use the Adaptive method. Otherwise, we want to use the Auto method. The next step should be the Threshold (or Binarize) command using Adaptive thresholding.
|
|||
|
|||
|
Success! The blue transcript was turned black and white using the Adaptive method. However, the real test will be if the brown transcript skipped the "Threshold - Adaptive" step and went straight to the "Threshold - Auto" step. |
|
|
Did the step execute on the brown transcript, which was not classified as the "Blue Transcript" image? It did not! The "Threshold - Adaptive" step was skipped and the next step in the sequence, "Threshold - Auto" ran as normal. |
Example: IP Groups and the Next Step Expression
Imagine for the example above, we wanted one set of IP Commands to run on the brown transcripts and another to run on the blue transcripts. Since we already know we can classify these documents seperately and use that information to determine if a step should execute, we can use IP Groups to tell an IP Profile to execute a collection of IP Steps and conditionally based on the image classification and determine what happens next using the "Next Step Expression" property.
We will keep this example fairly simple. On the left we have a blue transcript and the right a brown one.
![]() |
|
For the blue transcript we want to execute two IP Commands: Threshold using Adaptive method and a basic "Line Removal"
For the brown transcript we want to execute two IP Commands: Threshold using Auto method and a basic "Speck Removal"
We don't want the brown transcript to run "Line Removal" and we don't want the blue transcript to run "Speck Removal". We will use the same "Classify Image" command we used in the previous example to classify the blue transcript as "Blue Transcript".
Add an IP Group
|
IP Groups are collections of IP Steps in an IP Profile. This allows you to nest a series of steps within an IP Profile. You can think of IP Groups as mini-profiles or sub-profiles that can be used as a single step in the execution sequence of an IP Profile.
|
|
|
|
|
Add the steps you wish the group to execute as if you were adding them to an IP Profile. This group will add a Threshold step using the Adaptive method and a basic Line Removal Command. The IP Group will be nested as a child of the IP Profile, with its own steps nested as children of the IP Group. |
|
|
Add the Remaining IP Steps
|
Set the Should Execute Expression
|
||
|
||
|
This will only execute the steps in this IP Group if the should submit expression evaluates to "True". In this case, if the image is classified as "Blue Transcript". However, the remainder of the IP Profile still runs for those images. Seen below, Speck Removal still executes. We want to tell the IP Profile to stop running at the end of the IP Group. |
||
|
We can change the order of operations for this profile using the Next Step Expression property.
|
||
|
The "Next Step Expression" dictates what happens next after the IP Step or IP Group executes. What we want to do is tell the IP Profile to stop running for the blue transcripts after the IP Group finishes, but continue onto the "Threshold - Auto" step for the brown transcript. The code expression to execute this logic is as follows: This follows the logic of If(condition, if condition is met, do this, otherwise do this) The condition here is that the image is classified as a "Blue Transcript" by the Classify Image command. "Nothing" here means the IP Profile will stop processing and perform no more of the IP Steps in the profile. "Steps.Threshold_Auto" means the next step to execute will be the "Threshold - Auto" step in the profile.
|
||
|






























































































































