Image Registration mainly includes the following aspects:
1. Open the image
2. Registration
3. Image Storage/storage
1. The code for opening an image has been written before.
2. Registration
The igeoreference interface is used for registration.
In addition, activeview is used for Coordinate Transformation to convert the mouse clicking position in mapcontrol
Coordinates of the MAP and the image.
The following describes the igeoreference interface.
First, rasterlayer implements this interface.
Cangeoref checks whether the layer can be registered
Pointstransform converts the cursor position to the relative coordinates of the raster file.
Rectify saves the corrected result as a new grid file, which is equivalent to saving
The world file and the grid file are saved in the same directory.
The Reset is canceled and corrected, but the operations before register cannot be restored.
The most important thing is the following three
Shift Correction Means translation.
Twopointsadjust two-point registration must be scaled.
Warp three or more Registration
Note:
1. Each register is a symbolic stage
During each registration, all the configuration on-time data since the last register must be used.
For example:
First, register
Then 1. A little translation is used.
2. Next I accept another point. At this point, we need to use two-point registration.
3. Next, we accept another point. At this point, we need to use three-point registration.
2. Registration generally has an additional feature
It allows users to save each registration process and provide the accuracy of each registration process. This should be supplemented by yourself.
3. warehouse receiving/pyramid
Code directly:
- Irasterprops props = (irasterprops) This. prasterlayer. Raster;
- M_rasenv = props. extent;
- Ibasicrastersdeconnection pbasic = new basicrastersdeloader ();
- // Provide connection information
- Pbasic. servername = & quot; service period name & quot ;;
- Pbasic. instance = & quot; port number & quot ;;
- Pbasic. Username = & quot; username & quot ;;
- Pbasic. Password = & quot; password & quot ;;
- // Provide an image
- Pbasic. Raster = This. prasterlayer. Raster;
- // Name
- Pbasic. sderastername = rasternameindb;
- Irastersdeserveroperation pro = (irastersdeserveroperation) pbasic;
- // Import data
- Try
- {
- Pro. Create ();
- Pro. computestatistics ();
- }
- Catch (exception ex)
- {
- System. Windows. Forms. MessageBox. Show (& quot; image data import failed! & Quot; + ex. Message );
- Return;
- }
- // Create a pyramid
- Irastersdestorage2 PRS = (irastersdestorage2) Pro;
- PRS. pyramidoption = esrirastersdepyramidoptenum. esrirastersdepyramidbuildskipfirstlevel;
- PRS. pyramidresampletype = rstresamplingtypes. rsp_bilinearinterpolation;
- Pro. buildpyramids ();
Copy code
This image is now in the database.
Note:
Generally, you need to create an original data table about the image. It is used to record the images that belong to you. There is also a problem of name conversion, because Chinese names are not allowed.
From: http://www.sharpgis.com/forum.php? MoD = viewthread & tid = 220 & page = 1