0
$\begingroup$

I want to start with image processing (image classification). I installed opencv and plan to use it with Python. Being starter at this, I am looking for references regarding trivial issues like: I just saved some images and want to get their pixel values as features , hoewever when I try loading it in opencv, I am getting differently shaped 3-dimmensional objects. Some references or suggestion regarding this issue will be highly appreciated.

$\endgroup$
1
$\begingroup$

Your numpy arrays are 3-dimensional because they are colored images. The first dimension is the y-dimension, the second dimension is your x-dimension and the third dimension is the different color channels. What order they are in depends on your reader, but I think OpenCV uses BGR (check the documentation here). A lot of the feature extraction methods only work on grayscale arrays which are mapped back to two dimensions, any of the well known image packages can do this for you (OpenCV, scikit-image).

| improve this answer | |
$\endgroup$
  • $\begingroup$ I think OpenCV uses BGR $\endgroup$ – Raghuram Aug 25 '16 at 8:06
  • $\begingroup$ @Raghuram You are right. OpenCv uses BGR $\endgroup$ – enterML Nov 23 '16 at 8:37
0
$\begingroup$

Adding to the answer given by @Jan van der Vegt, I would recommend you to go through the basics of gray scale imaging and of color palettes and how those are represented in matrices in python or in general. Simultaneously work on python scipy to see how images are being represented. Going through some basics like resizing, histograms etc. in theory will be very helpful for a better understanding and representation of imaging before you put yourself into coding something.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.