Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OT Pin
ThatsAlok11-May-06 21:53
ThatsAlok11-May-06 21:53 
GeneralRe: OT Pin
Eytukan11-May-06 22:02
Eytukan11-May-06 22:02 
GeneralRe: OT Pin
ThatsAlok11-May-06 22:29
ThatsAlok11-May-06 22:29 
GeneralRe: [Message Deleted] Pin
led mike11-May-06 8:43
led mike11-May-06 8:43 
GeneralRe: [Message Deleted] Pin
Anu_Bala11-May-06 17:51
Anu_Bala11-May-06 17:51 
QuestionRAS API Pin
subramanyeswari11-May-06 2:04
subramanyeswari11-May-06 2:04 
AnswerRe: RAS API Pin
led mike11-May-06 6:28
led mike11-May-06 6:28 
QuestionWebcam Image Manipulation Pin
Lessthannovice11-May-06 2:00
Lessthannovice11-May-06 2:00 
Greetings.

I have modified the code from the Simultaneous Previewing & Video Capture using DirectShow written by Sivasagar K.R in www.codeguru.com (see below). When I run it, it uses the *ptr pointer to render the pixels on screen, but I want to analyse the pixels for each frame, rendering the analysed pixels.

In essence, I want to save the pixels (as I do in the array CurImaArr) and then do some analysis on them, maybe change some values, and then render them. Any ideas on how to do so?

Your help would be very much appreciated.

bool CVMR_Capture::Convert24Image(BYTE *p32Img, BYTE *p24Img,DWORD dwSize32)<br />
{<br />
<br />
	if(p32Img != NULL && p24Img != NULL && dwSize32>0)<br />
	{<br />
<br />
		DWORD dwSize24;<br />
<br />
		dwSize24=(dwSize32 * 3)/4;<br />
<br />
		BYTE *pTemp,*ptr;<br />
		//pTemp=p32Img + sizeof(BITMAPINFOHEADER); ;<br />
		pTemp=p32Img;<br />
<br />
		ptr=p24Img + dwSize24-1 ;<br />
<br />
		int ival = 0;<br />
		int count = 0;<br />
		int witth = 1;<br />
		int hite = 0;<br />
		int hites = 120;<br />
		int greens = 0;<br />
		for (DWORD index = 0; index < dwSize32/4 ; index++)<br />
		{									<br />
			unsigned char r = *(pTemp++);<br />
			unsigned char g = *(pTemp++);<br />
			unsigned char b = *(pTemp++);<br />
			(pTemp++);//skip alpha<br />
			if ((witth <= 320) && (hite < 240))<br />
			{<br />
                               CurImaArr [witth-1][hite] = g;<br />
			}<br />
			else<br />
			{<br />
				return false;<br />
			}		<br />
			<br />
<br />
					<br />
			<br />
<br />
                 if (g > 150)<br />
			{<br />
				greens++;<br />
			}<br />
			<br />
					<br />
			*(ptr--)= 0; //blue   <br />
			*(ptr--)= CurImaArr [witth-1][hite]; //g; //green<br />
			*(ptr--)= 0; //yellow 		<br />
			<br />
			witth++;<br />
			<br />
			if (witth >= 320)<br />
			{<br />
				witth = 1;<br />
				hite++;<br />
			}<br />
			<br />
			<br />
		}<br />
		<br />
		<br />
	}<br />
	else<br />
	{<br />
		return false;<br />
    }<br />
<br />
return true;<br />
}

AnswerRe: Webcam Image Manipulation Pin
Justin Tay11-May-06 4:51
Justin Tay11-May-06 4:51 
QuestionRe: Webcam Image Manipulation Pin
Lessthannovice11-May-06 5:34
Lessthannovice11-May-06 5:34 
AnswerRe: Webcam Image Manipulation Pin
Justin Tay11-May-06 6:02
Justin Tay11-May-06 6:02 
QuestionRe: Webcam Image Manipulation Pin
Lessthannovice11-May-06 6:45
Lessthannovice11-May-06 6:45 
AnswerRe: Webcam Image Manipulation Pin
Justin Tay11-May-06 7:15
Justin Tay11-May-06 7:15 
QuestionRe: Webcam Image Manipulation Pin
Lessthannovice11-May-06 7:35
Lessthannovice11-May-06 7:35 
AnswerRe: Webcam Image Manipulation Pin
Justin Tay11-May-06 8:05
Justin Tay11-May-06 8:05 
GeneralRe: Webcam Image Manipulation Pin
Lessthannovice11-May-06 9:44
Lessthannovice11-May-06 9:44 
GeneralRe: Webcam Image Manipulation Pin
Justin Tay11-May-06 11:02
Justin Tay11-May-06 11:02 
GeneralRe: Webcam Image Manipulation Pin
surfman1911-May-06 13:12
surfman1911-May-06 13:12 
GeneralRe: Webcam Image Manipulation Pin
Lessthannovice11-May-06 20:53
Lessthannovice11-May-06 20:53 
GeneralRe: Webcam Image Manipulation Pin
Lessthannovice11-May-06 20:52
Lessthannovice11-May-06 20:52 
GeneralRe: Webcam Image Manipulation Pin
Justin Tay11-May-06 21:44
Justin Tay11-May-06 21:44 
GeneralRe: Webcam Image Manipulation Pin
Lessthannovice12-May-06 6:12
Lessthannovice12-May-06 6:12 
GeneralRe: Webcam Image Manipulation Pin
Justin Tay12-May-06 14:53
Justin Tay12-May-06 14:53 
QuestionRe: Webcam Image Manipulation Pin
Lessthannovice13-May-06 0:44
Lessthannovice13-May-06 0:44 
AnswerRe: Webcam Image Manipulation Pin
Justin Tay13-May-06 16:47
Justin Tay13-May-06 16:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.