require(RCurl)
## Loading required package: RCurl
## Loading required package: bitops
library(knitr)
library(png)
library(grid)
- The New Shapefile Layer appears. Name it and click Add to fields list, then click OK.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture11.png")
grid.raster(img)

- In your QGIS workspace, highlight the point Shapefile you’ve just created, click Toggle Editing and click Add Feature.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture12.png")
grid.raster(img)

- Drag the mouse pointer to any point on the map of Liberia, right click and release the mouse. Add point Feature Attributes: id (example: 01) and geoRPoint (example: p1) and click ok. Do the same for at least five points and save your work.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture13.png")
grid.raster(img)

- Now that you have created your point Shapefile, go the Georeferencer plugin and click on Add Point in the toolbar.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture14.png")
grid.raster(img)

- Click a point on the map that matches one of your points in the point Shapefile. In the pop-up window, click From map canvas. Find the exact point on the map in the QGIS workspace and click it.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture15.png")
grid.raster(img)

- Similarly, add the remaining 4 GCPs from your point Shapefile. NB: The more points you have, the more accurate your image is registered to the target coordinates.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture16.png")
grid.raster(img)

- Once you have enough points, go to Settings ‣ Transformation settings.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture17.png")
grid.raster(img)

- In the Transformation settings dialog, choose the Transformation type as Thin Plate Spline. Name your output raster as Lib_LCMap_modified.tif. Choose Default CRS (EPSG:4236 – WGS 84) as the target SRS so the resulting image is in a widely compatible datum. Make sure the Load in QGIS when done option is checked. Click OK.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture18.png")
grid.raster(img)

- Back in the Georeferencer window, go to File ‣ Start georeferencing. This will start the process of warping the image using the GCPs and creating the target raster.
img <- readPNG("/Users/calvingaye/Desktop/png/Picture19.png")
grid.raster(img)

- Once the process finishes, you will see the georeferenced layer loaded in QGIS. Loaded image
img <- readPNG("/Users/calvingaye/Desktop/png/Picture20.png")
grid.raster(img)

- The georeferencing is now complete. But as always, it’s a good practice to verify your work. How do we check if our georeferencing is accurate? In this case, compare the georeferenced image and loaded Liberia’s boundaries Shapefile. Check both images such that one is superimposed on the other. The images are perfectly matched. Excellent work, bravo!!!
img <- readPNG("/Users/calvingaye/Desktop/png/Picture21.png")
grid.raster(img)

Reference: http://www.qgistutorials.com/en/docs/georeferencing_basics.html