analyzing certain color patterns in Lab View 
Author Message
 analyzing certain color patterns in Lab View

Hi,

I was wondering how I would go about

    1) reading in a .jpeg,
    2) discerning whether a pixel is a certain color (ie, red) and
    3) outputting that coordinate to a text file?

I have been trying to find help on how to read actual pixel points and their
corresponding properties (ie, color, x, y), unfortunately, I haven't been
able to search any online literature.

Thanks for taking your time to read through this message.

Thanks,
Paul

--

Paul Rigor

Go Bruins!!!
"attack each problerm with as much passion as you would pleasure" -anon
anime?
_____



Sat, 07 Feb 2004 08:12:46 GMT  
 analyzing certain color patterns in Lab View

Quote:
> I was wondering how I would go about

>     1) reading in a .jpeg,
>     2) discerning whether a pixel is a certain color (ie, red) and
>     3) outputting that coordinate to a text file?

> I have been trying to find help on how to read actual pixel points and their
> corresponding properties (ie, color, x, y), unfortunately, I haven't been
> able to search any online literature.

If you read the JPEG in using the Picture VIs, the output will contain
all of the data uncompressed into a packed binary format of bytes.
The bytes come in triplets and are the R, G, and B.  You can check this
by checking the array size.  It should be approximately 3x the width
times the height of the bitmap.

Anyway, this should get you close once you figure out how to compute
the index.

Greg McKaskle



Sun, 08 Feb 2004 11:01:06 GMT  
 analyzing certain color patterns in Lab View
The first soluiton I'am thinking of is to code a litlle activeX
control to do this task (in Visual Basic you have Point to get
information about the color of a x,y point).


Sun, 08 Feb 2004 20:35:23 GMT  
 analyzing certain color patterns in Lab View
To read a .jpeg image file, you can use "Read JPEG File.vi", located
in the Functions pallette:

Graphics & Sounds -> Graphic Formats

To display the image, use "Draw Flattened Pixmap.vi", located also in
the Functions pallette:

Graphics & Sounds -> Picture Functions

The way the pixels are represented in the picture depend on the
"depth" of your image. The image is stored in the "flattened image
data" output of the "Read JPEG File" vi. 4 to 8 bits depth images need
a color table. For images with those depth, the value in the
"flattened image data" array indicate the address of the color in the
color table. For example, if the first value is 23, it means that the
color of that pixel is located in the position 23 of the color table.

1 and 24 bits depth image include the color information in the image
itself. In a 24 bits depth image, three consecutive values indicate
the color of the pixel.

You can simplify the search of the pixel value by converting the
"flattened image data" array into a 2D array. To do that, use
"Unflatten pixmap.vi", located in:

Graphics & Sounds -> Graphic Formats

Now, you will have the image in a 2D array, where each cell contain
the actual value of the pixel.

Remeber that the value of the pixel is in RGB format: you need to
convert the pixel into hexagesimal to read the RGB components. In a 24
bits depth image, three consecutive numbers (cells) correspond to the
R, G and B values of the color of a single pixel.

To display the color, you can use a color indicator. I don't know
where is the color indicator in the Controls pallette. To create one,
what I do is that I open "Draw Circle by Radius.vi", right-click the
color input and select "Create Indicator". The indicator diplay the
color of the pixel, not the value, but you can manipulate its value as
it is an unsigned long.

Best regards;
Enrique Vargas



Sun, 08 Feb 2004 21:53:16 GMT  
 analyzing certain color patterns in Lab View
A short note: Another way of getting a color indicator is to use a
Framed Color Box in the Numerics pallette and change it to an
indicator. /Mikael


Sun, 08 Feb 2004 22:18:44 GMT  
 analyzing certain color patterns in Lab View
All this time and I never look there!!

Thanks a lot Mikael!



Sun, 08 Feb 2004 22:29:12 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Analyzing Data [finding irregular patterns]

2. how looks a table of Ignore Color Spectra of Learn Color Pattern

3. Printing certain lines after matching a pattern

4. How to make a command run again and again until it sees a certain pattern

5. can i simulate electronic circuits using lab view

6. How do I contact a Advantech PCL-724 card with Lab View

7. full version of lab view!

8. LAB VIEW & DAQ

9. How to poll a text file with lab view

10. Using Dma and Lab View

11. open txt file to excel in Lab view !

12. I want LAB VIEW

 

 
Powered by phpBB® Forum Software