LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to detect red frame in a series of images using web cam?

Solved!
Go to solution
Solution
Accepted by topic author armank

Hi armank,

 

I'm not sure that your code is doing what you think it is.   You are writing a black circle of no radius to a JPG file then reading that file and comparing it to your image.  The image you are reading does not contain the color red.  In fact, it is a null image since you wrote a circle of zero radius to it.  Also, your acquired image is a grayscale image, which makes it impossible to determine if it contains the color red.  Have you tried looking at the ColorLearn and ColorMatching Examples in Example Finder in LabVIEW?  You can get to Example Finder by selecting Help»Find Examples....

Stephen Meserve
National Instruments
0 Kudos
Message 11 of 23
(1,564 Views)


i have made the code for the threshold valueS of RGB.I have first implemented it on a pic that is snapped by the web camera.
1)two temporary memory locations are created(IMAQ CREATE) one for the source image and other for the destination image.
The source image is of 24 bit depth as aquired by the web cam and for the individual red/blue/green color we need an 8bit image.thats why the temp memory for storing the destination image is of 8 bits.

2)the source image as well as the image from the temp mem are adjusted according to their threshold range(IMAQ THRESHOLD)
3)The output comes out to be good enough to categorize the particular values for the RGB.

I have also implemented the same algo on pic grabbing.its also working perfectly

I am a bit confused about setting the threshold values for RGB.kINDLY CAN U GIVE ME SOME advice

As  now i have to display that red colored image which comes across the camera...how can i do that???i am attaching ma vi too..
thnx

0 Kudos
Message 12 of 23
(1,547 Views)

Hi armank,

 

I have attached an image showing my setting for pulling certain shades of the color red from an image.  The settings will depend on your particular images.  I would suggest playing with the slider bars to determine the particular shade of red that you need.

 

You also want to make sure that you select your palette for the destination image as binary by right-clicking on the display and selecting Palette»Binary.

 

 

Stephen Meserve
National Instruments
0 Kudos
Message 13 of 23
(1,534 Views)

hey thnx alot for ur rgb values=))

but u r unable to undesrtand ma question.what i want to do is.

as u know that ma web cam is continously seeing the images and not snaping it.

i want that if any image(would be one of the images from the continuously seeing images by web cam) that comes across the web cam

and it has the threshold value between 139-255(as specified by u in ur attachment) then that image is snapped by ma web cam and displayed...hence a red colored frame in the video is captured automatically...

plz guide me soon as ma submission date is approaching

=(

thnx

0 Kudos
Message 14 of 23
(1,524 Views)
also one more thing u said to change the palette of display to binary one...can u xplain that for what reason we have to do it??why cant we select some other palette???
0 Kudos
Message 15 of 23
(1,523 Views)

i had made a code and attached the vi too.kindly check it.

i dont thnk it is working correctly.plz provide me some guidance 

0 Kudos
Message 16 of 23
(1,512 Views)

Hi armank,

 

You can use a case structure to make a decision about whether or not to save an image.  You can use a histogram to get the values of pixels in the image.  You have to select binary as the palette type because this is the palette used for thresholded imges, since they only have 2 possible values.

Stephen Meserve
National Instruments
0 Kudos
Message 17 of 23
(1,501 Views)
hey i a hve succeded in doig aht i wanted to.thnx to u.i am stuk at a last step.couldnt find any way out.kindly tell me tht how could i snap a pic whle the camera is in grabbing condition.actually i want that in the front pannel there are three image display-one displaying the video-the second one displaying the rgb values and the last displaying the so called captured image(after going through a number of comparisons..).i am attaching ma vi too.kindly give me the block diagram if any 1 has.... rep soon
0 Kudos
Message 18 of 23
(1,478 Views)

hey,

plz reply..need your help

also ive found a way of snapping a frame from a continuos series of frames.read about the configuration with maxx and the .icd files..

i have a usb camera KMC-88i... need an answer soon..i dont have an ieee cam or a daq.its a minor project so kindly tell me the detail procedure for the aquisition of images through the web cam in max

looking foward for ur help

also if u know some other way for ma question posted in the previous post then do tell me but sooon ma submission date is approaching and this step is ma last step of the project,help me out.

thnx 

0 Kudos
Message 19 of 23
(1,467 Views)

Hi armank,

 

I'm not sure that I understand what you mean to snap while grabbing.  If you could explain, I could help better.  Also, your USB webcam will not show up in MAX because USB cameras are not supported by National Instruments.

Stephen Meserve
National Instruments
0 Kudos
Message 20 of 23
(1,444 Views)