whether route summarization can be achieved through filters during redistribution

Question:
Regarding whether route summarization can be achieved through filters during redistribution:

For example, in a topology where:
R1 (OSPF instance 0) ---- (OSPF instance 0) R2 (OSPF instance 1) ---- (OSPF instance 0) R3

Redistribution is configured on ​R2.
R1 advertises the following routes (all in Area 0, not sub-areas):

10.1.0.0/24
10.1.1.0/24
10.1.2.0/24
172.16.4.0/24
172.16.5.0/24
172.16.6.0/24
Can R2 use route filters to summarize these routes as

​10.1.0.0/22
​172.16.0.0/21(or 172.16.4.0/22)
before advertising them to ​R3?

thanks for your help