The 2019 coronavirus disease began in Wuhan, China, and spread worldwide. This pandemic was concerning, given its significant and worrying impact on human health. Strategies to manage the disease begin with diagnosing the infection, often using the real-time reverse transcription polymerase chain reaction (RT-PCR) assay. However, this process is time intensive. Therefore, alternative rapid methods to diagnose the coronavirus with high accuracy are needed. X-ray and computerized tomography (CT) scans are reasonable solutions for rapid coronavirus diagnosis. The dataset of 500 patients was tested, including 286 uninfected patients and 214 infected with COVID-19. Clinical parameters, including heart rate (HR), temperature (T), blood oxygen level, D-dimer, and CT scan, including red-green-blue (RGB) pixel values of the left and right lungs, were collected from 500 patients and used to train an artificial neural network (ANN) to diagnose coronavirus. The ANN was hybridized with a particle swarm optimization (PSO) algorithm to improve diagnosis accuracy. The results show that the proposed PSO-ANN method significantly improved diagnosis accuracy (98.93%), sensitivity (100%), and specificity (98.13%). The effectiveness of the proposed method was confirmed by comparing the findings with those of previous studies.