asfenmgmt.blogg.se

Python simpleimage
Python simpleimage










  1. #PYTHON SIMPLEIMAGE FULL#
  2. #PYTHON SIMPLEIMAGE CODE#

In essence, I was only quantifying part of the rotated, oblong pills hence my strange results.

#PYTHON SIMPLEIMAGE FULL#

Here you can see a round pill being rotated a full 360 degrees without an issue: Figure 1: Rotating a circular pill doesn’t reveal any obvious problems.īut for oblong pills, they would be “cut off” in the rotation process, like this: Figure 2: However, rotating oblong pills using the OpenCV’s standard cv2.getRotationMatrix2D and cv2.warpAffine functions caused me some problems that weren’t immediately obvious. Since round pills have are approximately square in their aspect ratio, the rotation bug wasn’t a problem for them. It turns out that during the image preprocessing phase, I was rotating my images incorrectly. While I might have been ashamed to admit this as a graduate student, the problem was the latter: Or was it something else entirely… like a problem with my image preprocessing. Was I not matching the features correctly? Was there a flaw in the logic of my feature extraction algorithm? My method was only working with round, circular pills - I was getting completely nonsensical results for oblong pills. I was able to extract features from my dataset of pills, index them, and then identify my test set of pills regardless of how they were oriented… Regardless of how the pill was rotated, I wanted the output feature vector to be (approximately) the same (the feature vectors will never be to completely identical in a real-world application due to lighting conditions, camera sensors, floating point errors, etc.).Īfter the first week I was making fantastic progress. Since my school obligations were essentially nil, I started experimenting with (automatically) identifying prescription pills in images, something I know a thing or two about (but back then I was just getting started with my research).Īt the time, my research goal was to find and identify methods to reliably quantify pills in a rotation invariant manner. I had taken all of my exams early and all my projects for the semester had been submitted.

python simpleimage

It was the end of my second semester of coursework. Let me tell you an embarrassing story of how I wasted three weeks of research time during graduate school six years ago.

python simpleimage

#PYTHON SIMPLEIMAGE CODE#

Click here to download the source code to this post












Python simpleimage