Magic Tool - PIX4Dfields

This article introduces the Magic Tool in PIX4Dfields, an Artificial Intelligence (AI)- assisted selection tool for quickly detecting and selecting weed nests, damage, and other anomalies in orthomosaics and index layers.

Tip: Watch the tutorial video about the Magic Tool on the Pix4D agriculture youtube channel and register for a free 15 days trial to test it with our Example use cases.

How to access the Magic Tool

Access the tool by clicking the Bunny_for_Jose.png Magic icon located next to the index_map.png Index icon.

[1] Layer selection

  • There is always a possibility to show or hide previous annotations that may help when using this tool.
  • Select the Source layer where Magic Tool will run on top. 
  • Select a Boundary of the area from the Source layer where the Magic Tool will work.
  • Select Obstacles if needed. These zones will be discarded by the Magic Tool.

[2] Grid creation

A grid needs to be created for classification purposes when using the Magic Tool. The definition of the grid is based on the following aspects:

  • Cell size: Select a cell size that roughly represents the structures that need to be detected on the map. When planning a herbicide spot spraying mission, the cell size could match the implements section or working width.
  • Rotation: With the rotation slider, the orientation of the grid can be changed. It is recommended to use the same orientation as the crop-row or the main driving direction.
  • Horizontal offset: The grid can be shifted horizontally if needed. The mouse wheel can be used to fine-tune each value in smaller steps.
  • Vertical offset: The grid can be shifted vertically if needed. The mouse wheel can be used to fine-tune each value in smaller steps.

Once finished with setting the appropriate values for the grid generation, click Start Magic. It usually takes just a few seconds while the AI learns about the structure of the data.

Note: Results can be reverted by clicking the revert button on the top-right side.



[3] Labeling

In this step, Wanted and Not wanted cells are labeled in order for the AI to start working.

  • At least three Wanted cells need to be marked.
  • After selecting the Wanted cells, continue with marking the Not wanted cells, as this is a necessary step. They can be selected via the sidebar or by holding the Shift key to invert the mode temporarily.
  • With three labels for each type of cell (Wanted, Not wanted) the Magic Tool will start tracking down similar areas on the whole field instantly.
  • More labels can be introduced to train the Magic Tool further and improve its detection performance.
  • Once finished with this step, continue with the Cleanup step.


[4] Cleanup

Corrections to the results are made during the Cleanup step:

  • Select from the Brush section to Add or Delete cells from the selection and adjust the brush size.
  • Hold Crtl key, click and drag the cursor to paint multiple cells in a row.
  • Hold Shift + Ctrl to invert the mode.
  • The Buffer function allows to add or subtract from the selection systematically.
  • There is also the option to click on the revert button, on the top-right side of the menu, to return to the initial selection.


[5] Convert

The detections can be converted to:

  • Area annotation: The detections will be saved as area annotations. This is useful when detecting weed nests, damage in crops, measuring areas, etc.
  • Boundary: the detections will be saved as a boundary. This is useful when trying to mark the field boundary by using the Magic tool.
  • Obstacle: the detections will be saved as obstacles. This is useful when using the Magic Tool to detect trees that should be avoided in the mission.
  • It is recommended that One sub polygon per grid cell be toggled off. Cells will be merged, resulting in a simpler geometry.
  • Give a descriptive Annotation name.
  • Toggle on Learn based on my data to give the Magic Tool the option to learn from your data. This data will be anonymized training data for more magic in the future!
  • Click Convert.



After saving the results, these can be exported from the Export menu.
When the detections will be used in farm machinery, they should be used as Targeted Operation input.
When saving areas as annotations, these can be identified as one zone to be sprayed for example.
Boundaries and Obstacles can also be used to determine the area of the operation and define obstacles.
After using Magic Tool outputs in Targeted Operation, files will be ready to be used in tractors, ground sprayers, spraying drones, and more.


  • If the Magic Tool is taking too long to process, reprocess the dataset with a reduced GSD or export the existing layer with the 50% scale option selected and reimport it into the project
  • If there is no detection, export the layer as RGB, reimport it into the project and restart the Magic Tool with it.
  • R00018: The annotations have an invalid format. This error could be caused by special characters in the user's name (accent mark, middle dash)