How to extract particular pixel values from an image?
25 views (last 30 days)
I'm doing project on image processing, and in one of my module i need to extract the particular bunch of the pixels.I know the values of that pixel but i'm not getting how exactly to extract that values. so please help me to get out of this!
Walter Roberson on 24 Dec 2012
[PixelRows, PixelColumns] = find( YourImage(:,:,1) == RedValue & YourImage(:,:,2) == GreenValue & YourImage(:,:,3) == BlueVaue );
Image Analyst on 24 Dec 2012
- You have a binary image (which means value of 0 and 1)
- You know the values in the particular bunch (either 0, 1, or both of course)
- You need to extract their values (which will again be either 0 or 1 or both)
So the question remains,
- Do you know the locations of the "particular bunch" of pixels?
- If you already know their values then what exactly does it mean that you need to extract their values? You mean you want a vector that is the length of the "particular bunch" and has the 0 or 1 values in the vector? Like your image is 1 megapixel but you want a vector of pixel values from a small 1000 pixel chunk in the image?
Anuradhi Umayangani on 14 Sep 2016
Hi, I have a matrix with only 0's & 1 's .I actually it is a square devided in to 9 equal squares some are coloured in black and some quares are white.this master square is printed in a white background.it has a black outline.I want to crop the square from the white background.do u know a way to do that. i need to write the program to identify the margine by itself