The time from exposure to onset of symptoms is typically around five days but may range from two to fourteen days. While the majority of cases result in mild symptoms, some progress to viral pneumonia and multi-organ failure. To make this project I was inspired by the next work: https://www.pyimagesearch.com/2020/03/16/detecting-covid-19-in-x-ray-images-with-keras-tensorflow-and-deep-learning/
- 1 --> Make the Classifier: covid-x-ray.xml
- 2 --> Make the Classifier: covid-virus.xml
- 3 --> Testing the Classifiers on the PC
- 4 --> Testing the Classifiers on the Raspberry Pi 3B+
- 5 --> Testing the Classifiers on the NVIDIA Jetson Nano Kit
1.- Make the Classifier: covid-x-ray.xml
We can make our own classifiers for recognition of lungs damaged by COVID-19 virus cells. Following are the steps covered in the next sections to be successful in your classifier.
- A --> Collecting Image Database
- B --> Arranging Negative Images
- C --> Crop & Mark Positive Images
- D --> Creating a vector of positive images
- E --> Haar-Training
- F --> Creating the XML File
Notes: 1) In the download section you can get all the files that I will mention below, or you can do click here: https://github.com/guillengap/covid-19-opencv ; and 2) Once downloaded, we will use the files shown in the folder: Y-ray
--> Step A: Collecting Image Database
I recommend you to collect 100 positive images and 100 negative images at last. I suggest you check out https://github.com/ieee8023/covid-chestxray-dataset
The positive images are those images that contain the object (e.g. lungs damaged), and negatives are those ones which do not contain the object . Having more number of positive and negative images will normally cause a more accurate classifier.
--> Step B: Arranging Negative Images
Put your background images in folder …\training\negative and run the batch file:
Running this batch file, you will get a text file each line looks as below:
Later, we need this negative data file for training the classifier.
--> Step C: Crop & Mark Positive Images
We continue with Objectmaker which is straight forward.
In folder ..\training\positive\rawdata put you positive images
In folder ..\training\positive there is a file
objectmaker.exe that we need it for marking the objects in positive images.
How to mark objects? Running the file objectmaker.exe you will see two windows like below: one shows the loaded image, and the other one shows the image name.
Click at the top left corner of the object area, and hold the mouse left-key down. While keeping the left-key down, drag the mouse to the bottom right corner of the object.
Now you could be able to see a rectangle that surrounds the object. If you are not happy with your selection press any key (except Spacebar and Enter) to undo your selection, and try to draw another rectangle again.
If you are happy with the selected rectangle, press SPACE. After that, the rectangle position and its size will appear on the left window.
Repeat steps if there are multiple objects in the current folder. When you finished with the current image, press ENTER to load the next image.
Repeat steps until the entire positive images load one by one, and finished, and a file named info.txt would be created. Within the
info.txt there would be some information like below:
--> Step D: Creating a vector of positive images
The next step is packing the object images into a vector-file....Read more »