Transferring and inspection unit of a group of elongated elements that are rod-shaped for smoking articles, comprising: - a forming pocket, having a longitudinal axis, which is provided with a hollow housing suitable for housing a group of elongated elements to be inspected; - a transporting conveyor of the forming pocket which is configured to advance the pocket along an advancing path through a first inspection position, characterised in that it comprises: - a first tridimensional inspecting optical assembly (15, 16) configured to perform in successive scanning instants a plurality of first tridimensional optical scans by projecting a first light blade over a first head face of the group, during the advancing of the pocket through the first inspection position; - a processing device configured to obtain, for each first tridimensional scan, a respective first scanning line associated with the respective scanning instant and to reconstruct a first tridimensional profile of the first head face based on the plurality of the first scanning lines obtained, - in which each scanning line is positioned in the first tridimensional profile in a respective first reference position indicating a corresponding zone of the first head face of the group inspected at the scanning instant, and in which - the pocket comprises a first front face that comprises a first shaped surface (28; 28'; 44); and in which moreover - the first optical assembly (15, 16) is configured to perform simultaneously with each first tridimensional scan of the first head face also a respective first tridimensional scan of the first shaped surface (28; 28'; 44) to obtain a respective further scanning line; and - the processing device is in addition configured to calculate the reference position of each first scanning line analysing the respective further scanning line. - a forming pocket, having a longitudinal axis, which is provided with a hollow housing suitable for housing a group of elongated elements to be inspected; - a transporting conveyor of the forming pocket which is configured to advance the pocket along an advancing path through a first inspection position, characterised in that it comprises: - a first tridimensional inspecting optical assembly (15, 16) configured to perform in successive scanning instants a plurality of first tridimensional optical scans by projecting a first light blade over a first head face of the group, during the advancing of the pocket through the first inspection position; - a processing device configured to obtain, for each first tridimensional scan, a respective first scanning line associated with the respective scanning instant and to reconstruct a first tridimensional profile of the first head face based on the plurality of the first scanning lines obtained, - in which each scanning line is positioned in the first tridimensional profile in a respective first reference position indicating a corresponding zone of the first head face of the group inspected at the scanning instant, and in which - the pocket comprises a first front face that comprises a first shaped surface (28; 28'; 44); and in which moreover - the first optical assembly (15, 16) is configured to perform simultaneously with each first tridimensional scan of the first head face also a respective first tridimensional scan of the first shaped surface (28; 28'; 44) to obtain a respective further scanning line; and - the processing device is in addition configured to calculate the reference position of each first scanning line analysing the respective further scanning line.