friggin awesome! you do things and show how they work from ground-up! i've never imagined that i would see webcam working in the CMD! Love it
@javidx97 жыл бұрын
Lol thanks Skyhorn! But I refer you to a previous comment "it is decidedly awe-less! :-D To Be Improved..."
@tophy435 жыл бұрын
Even though the colors are not perfect, it's most likely the craziest thing someone has ever done using the standard windows command promt. I love it, anyway.
@harleyspeedthrust40134 жыл бұрын
I was expecting bitshifting at 7:00, but I've never seen unions and I really like this way of doing it. Thanks David!
@andreaprovasi97864 жыл бұрын
TOTALLY expecting bit mask & shift too but been blown away by this union trick, Awesome!
@eformance6 жыл бұрын
A symbolic way of using a union to access the RGB values would be like this: struct _rgb { unsigned char x, r, g, b; }; union { int pixel; struct _rgb color; } RGB; Then use RGB.color.r to access red, RGB.color.g to access green, and RGB.color.b to access blue. This gives the pixel data symbolic format.
@nonchip4 жыл бұрын
btw HSV is hue/saturation/value, with luminance going all the way up to white along its axis of the cylindrical colour space, while value is only white where the saturation is 0. essentially max saturation of a colour would be at L=0.5 but V=1. so HSV cuts off the "upper half" of luminance where it begins to tint to white despite the saturation. wikipedia sums it up nicely: "HSV models how paints mix together, while HSL resembles perceptual colours" (as in: V=1 = more vibrant colour, L=1 = brighter light)
@andrewdunbar8285 жыл бұрын
Back in the late '90s I wrote a console GIF viewer. I can't remember how I chose the colours for each character block but I was taken aback by how convoluted your method was. I'm guessing I precomputed an RGB value for each character based on its black to white pixel ratio and used Euclidian distance to find the closest match from an image pixel colour to a possible character block colour pair and character. Then again I used to avoid square roots and I was using all printable characters, not just the five greyscale blocks.
@goshisanniichi5 жыл бұрын
I'd've gone backwards. Start w/ the console color and character and determine the resulting rgb color, i.e.: 25% Red + %75 Cyan = rgb( 63, 191, 191 ) and create a 3D lookup table and use some version k-nearest means or some similar classification algorithm to select the appropriate one.
@BrekMartin7 жыл бұрын
That’s cool :) More people would appreciate it than you’d think I reckon.
@javidx97 жыл бұрын
Hey Cheers Brek - It's daft that's for certain.
@BrekMartin7 жыл бұрын
Let’s say it’s not a candidate for Sony PSP :D plus I don’t have the camera again this time round.
@BrekMartin7 жыл бұрын
You got more subs than me, congrats! Got any tip for me on how to KZbin? :D Let’s see if I’m right again... >6K for you within 12 months, and I think the only way I’ll be wrong is if it explodes suddenly.
@javidx97 жыл бұрын
Thanks buddy. Let's see now, tips, oh yes - Get lucky and hope that some other great and frankly eccentric youtuber finds your channel early on and motivates you enough to keep on going. :-D
@BrekMartin7 жыл бұрын
Lol after ten years I don’t need that advice :D Actually I know very well how to do it. Just look at the commonality of the videos that get some thousands of views (and they certainly do have something in common), but then I’d not be doing what I enjoy, which has always been more important to me than YT ;)
@spjewkes7 жыл бұрын
Nice video. I like the idea of getting three colours into just a foreground and background colour. I was wondering if you'd considered spreading the RGB values across more than one 'pixel'? Although I guess the resolution of the console is so low that the eye wouldn't really blend anything together in the way I'd expect. Hopefully, you'll post up a future video when/if you improve your algorithm.
@javidx97 жыл бұрын
Thanks Steve. Yeah I think resolution is the limitation - I also tried flashing alternate combinations of colours between frames for different durations, but that just made me feel sick.
@sfl19864 жыл бұрын
i shed a tear over the Grim Fandango poster
@MrJackojc907 жыл бұрын
Great video as always!
@javidx97 жыл бұрын
Thanks Jack - I'm less sure about this one, it feels incomplete.
@MrJackojc907 жыл бұрын
You're your own worst critic :P
@strayling14 жыл бұрын
When you're calculating the dominant colours @21:00-.ish have you tried using the RGB scaling from the greyscale luminance function, or something similar? 40% blue might win over 50% yellow for example. BTW, beware unions and endianness
@Kitulous6 жыл бұрын
8:00 is union and char thingy faster than bitwise shifting the integer color value to needed? for example, color = 0xRRGGBB r = color >> 16 & 0xFF g = color >> 8 & 0xFF b = color & 0xFF
@javidx96 жыл бұрын
Hi Craftist, I would expect the union to perhaps be a bit faster than bit shifting, but the performance gain would be pretty much negilible. I think it is certainly clearer than bit shifting, and less prone to error.
@Kitulous6 жыл бұрын
javidx9 thank you for your answer! I really appreciate that!
@EtherealIntellect7 жыл бұрын
Silly question, but why not build a massive rgb lookup table of all the possible color (and black/white) and dither combinations from 2 colors and then search against that (just rgb nearest neighbour or convert to hsv and nearest neighbour and back or whatever)? That's basically what the black/white code does already, it was just simpler to code all the combinatorics by hand
@javidx97 жыл бұрын
Hi Ethereal, it's not a silly question at all, and in fact was one of my first approaches, but its quite a large and complex table! It would be easier to work backwards and try all the character combinations and calculate which RGB it approximates. It gets tricky as you need to include luminance, which starts to add discontinuities into the colour space when converting to characters. Even more frustrating is MS in their wisdom did not consider representing their luminance options linearly. Hey, give it a go, I'd love to just use a lookup table - I could play with palette effects and other tricks!
@Hunter725R4 жыл бұрын
Just tried to do this with PixelGameEngine 2 and was able to completely skip the symbols implementation. Though it just looks like a regular webcam feed now.
@Ozuqam6 жыл бұрын
15:18 That's very nice we can see quite a number of shades of gray. ( May be 50 ?)
@javidx96 жыл бұрын
lol
@germimonte4 жыл бұрын
probably wrong, but coudn't you train a small neural network ro convert the 3 input nodes(r,g,b) into 37 output nodes(32 for bg and fg colors and 5 for char), or maybe calculate the rgb equivalent of all bg/fg/char colors and then simply find the closest one for each pixel(may be more computationally intensive, idk how you would even find the closest in 3d space
@javidx94 жыл бұрын
Possibly, but in order to train the network, I would need the results anyway, and its likely that the training data would be generated algorithmically, in which case I could just use that.
@burntt9993 жыл бұрын
9:30 - marker i keep getting some 3 lines of text so small that i can only make out the last one and its "press any key to exit ...." in the windows terminal when I hit debug in VS. at the marker i just put down and I also loaded up the finished product .cpp file from the github and it does the same thing. on both my desktop and laptop. (usually things work better on my laptop for some reason. so yes i'm not sure whats going on. little bummed that even the finished one from javidx9's github has the same problem. give me absolutely no direction to head in with this project. boo :) oh well guess ill code along with a different video
@javidx93 жыл бұрын
If you powered up your debugger it would quickly reveal that your monitor is insufficient to display the size of console you are requesting. It's trying it's best to squeeze in the font onto your display and can't as the resolution of your monitor is too low, or the resolution of the console you are creating is too high. Try halving fontw and fonth values in ConstructConsole function. This will likely allow it to fit on the screen, at a sensible font size.
@anonymoussloth66874 жыл бұрын
Hi, I was following your 8 bits of image processing video and you used escapi there as well, so I found this video to see how to set escapi up. For some reason, I still cant manage to make it work. When I run the program, it just shows a terminal with "Press any key to close the window..." and my webcam doesn't turn on. I downloaded the binaries of escapi, and added the escapi.cpp and escapi.h files to my project. Am I missing anything or doing something wrong?
@javidx94 жыл бұрын
Sounds like the console you are making is too large to fit on your display. Try halving the fontw and fonth arguments in ConstructConsole()
@anonymoussloth66874 жыл бұрын
@@javidx9 I solved this. It was because I was missing the dll files.
@Otakutaru6 жыл бұрын
what if you made a huuuuuuge lookup table?
@javidx96 жыл бұрын
Hi Otakutaru, lol yes, you could create a huge one, but in fact you dont need too! Firstly there are far fewer combinations of characters than there are colours in 24-bit space, so you should be able to reduce the table pretty quickly. In fact some viewers did, if you check out my Community Showcase 2018 #1 video I demonstrate some of the awesome algorithms created by this community to solve the problem
@gavinwhite77815 жыл бұрын
@@javidx9 Why do you never link the videos you mention in your comments?
@johnvonhorn29424 жыл бұрын
"He has the power!" C Man! @ castle grayscale
@il_moddo4 жыл бұрын
My setupESCAPI returns NULL, even though I have a built in webcam in my computer and another external one connected to it. What might be the cause of this?
@javidx94 жыл бұрын
Have you put the dll file in your working directory/project folder?
@il_moddo4 жыл бұрын
@@javidx9 Yes, I tried putting the x64 .dll file in the directory and also putting the entire path of the file in the escapi.cpp file but it didn't work. I have now tried to put the Win32 dll file instead and it seems to work. Thank you anyway for helping me
@hallakim1847 жыл бұрын
Have you considered changing CONSOLE_SCREEN_BUFFER_INFOEX.ColorTable?
@javidx97 жыл бұрын
Hi Halla, I could, but I don't see what advantage I could gain. I still only have 16 "colours" to choose from, though perhaps there are better combinations. However, I'm unsure if you're able to set the colour table for each character drawn. It's messy, but I've not tested doing that. I think the colour table is applied across the output console.
@hallakim1847 жыл бұрын
Yes you're correct. If you change ColorTable[0] to RGB(100, 100, 100) and print out "AAA" with color 0 and then you change ColorTable[0] to RGB(255, 0, 0), eventually previous "AAA" will have color RGB(255, 0, 0). I was thinking it would be nice if one can find the 'mostly used color range' and modify color table to achieve the best output though still your solution looks great enough. Thanks for nice tutorial!
@dimitrykachkovski55134 жыл бұрын
Any chance you have a suggestion as to why my results are running at 6-8fps vs your 30? I have an Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz, so I don't see a reason why this would be happening... Looking at the profiler, seems my CPU usage is minimal, too...
@MuradBeybalaev4 жыл бұрын
But you kinda do have 3 output variables: Background color, foreground color and the visual density of the dithering character. Mapping brightness AND saturation to them is still a tall order still, since both require dithering with only prime hues available. Either way, what you should've probably done is upsample and dither for real.
@VenomousCamel5 жыл бұрын
With only a limited knowledge of image processing, I presume you could increase the "feel" of the image by interleaving your color-grayscale with a pure greyscale. Theoretically that would put an emphasis on the luminance and increase the number of possible shades. Though if you do this as full frames, you might get a nasty 15-30 Hz flicker. But as alternating interlaced scanlines, that could work.
@devgamez85272 жыл бұрын
Thanks, i'm learning a lot from your videos. And here i found some interesting i have bit of trouble with classic Console engine every time i stop my program, so i'm using GL version instead. one difference is that its PIXEL_SOLID is more like 95% solid, that gives more color options. 8 shades between color, and in total 28 grayscale colors. Rest of solid and partially solid characters ar also bit different, so if i switch between classic and GL i get different and in this case incorrect results.
@Bonfra045 жыл бұрын
when i call the initCapture function the program just hold forever.. what can i do?
@aburipon82794 жыл бұрын
Which Webcam did you use for this video, that show quite clearly your command line? name and model of that webcam pls.
@theairaccumulator71445 жыл бұрын
This is the greatest bodge in console game engine history.
@orocimarosay14476 жыл бұрын
the initCapture function is not working for me :(
@javidx96 жыл бұрын
Escapi requires a few things on your system which perhaps you dont have, such DirectMedia
@orocimarosay14476 жыл бұрын
what is that ?
@landsgevaer4 жыл бұрын
This begs for some dithering across pixels, I think, a topic very much up your video series' alley. Not too complicated when done on RGB channels separately, for instance Floyd-Steinberg. en.m.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering
@javidx94 жыл бұрын
You're right Dave, and in fact the community went on to do this with fantastic results, they also implemented gamma correction too XD the results can be seen in the community showcase video that follows this one.
@jonathanmaynard25516 жыл бұрын
I know I am commenting about this a lot later, but do we need to add the dll to our project inside of Visual Studio itself along with the cpp file and the h file, because I have tried both, and whenever I type in SimpleCamParams, it comes up with a error
@javidx96 жыл бұрын
Hi Mokizel, you only need to include the h and cpp files into your project. What compiler error are you getting? Also make sure the files are in the same folder as your main program code.
@jonathanmaynard25516 жыл бұрын
I get a error saying whenever I type in 'SimpleCapParams capture;' "identifier "SimpleCapParams" is undefined". Also thank you for responding to my comment and helping me.
@javidx96 жыл бұрын
do you #include "escapi.h" in your source file?
@jonathanmaynard25516 жыл бұрын
No, and now that I incorporated it, it did it worked. I can't believe I forgot to put that in, and thank you for helping me.
@anonymoussloth66874 жыл бұрын
did we need to add the dll file also? if so, how do we add it? Do we just copy paste it in the explorer of the project? Please help me because I have been trying to get this to work for a long time.
@AdvancedSoul6 жыл бұрын
christ, why not use bit shifting to extract the values? it's a more portable way of getting the specific color components (you can even use CHAR_BIT if you feel like it)
@javidx96 жыл бұрын
Hmmm. The problem here is not extracting colour values, it's deriving a sufficient mapping between the two colour spaces, one of which is contiguous and the other is not. The limited palette of the command prompt requires mixing with shade characters that means you can only form full spectrum by summation of two colours at discrete spectral intervals.
@arf204 жыл бұрын
Hey, I just done that yesterday not even knowing this video was going to be uploaded! But I did it with OLC:: PGE. And I also used ESCAPI
@arf204 жыл бұрын
I posted in the show your stuff channel in your discord. I also did it in a client/server architecture, that was the main point, an uncompressed video stream. (With sockets). And the colors were messed up, but not in the way of this video, the color channel were mixed in some way xD
@imranrajjad70284 жыл бұрын
great content, too bad I was not able to make the olcConsoleGameEngine work on Code Blocks + MSYS2/MinGW, as it goes looking for SDL
@javidx94 жыл бұрын
You grabbed the wrong one then. CGE original does not use sdl
@imranrajjad70284 жыл бұрын
@@javidx9 thats odd, is this not the right one? github.com/OneLoneCoder/videos/blob/master/olcConsoleGameEngine.h the build failes at github.com/OneLoneCoder/videos/blob/master/olcConsoleGameEngine.h#L1147 with error undefined reference to `__imp_waveOutOpen' Could I have assessed the problem incorrectly?
@TravelingMooseMedia4 жыл бұрын
Wonder what this looks like in pixel game engine
@javidx94 жыл бұрын
Lol. It just looks like a webcam 😂
@TravelingMooseMedia4 жыл бұрын
@@javidx9 Nice, gonna try and implement it :)
@LiamSwiftTheDog5 жыл бұрын
I skipped through the video so you probably mentioned it, but a dithering algorithm could make this look much much better and closer to the source material
@marcus_w05 жыл бұрын
Yeah, you skipped thru it. Around 11:00 minutes in, he describes the dithering.
@abrarmasumabir38092 жыл бұрын
this guy makes me go all out?
@jsflood6 жыл бұрын
Great video :-)
@TheChodex7 жыл бұрын
Are you alien? :O This is awesome! :D
@javidx97 жыл бұрын
Thanks Danilo! as far as I know, I'm from this planet.
@delofon4 жыл бұрын
@@javidx9 we can't be 100% sure...
@zoltans34666 жыл бұрын
May I ask your help please? Got stuck in the beginning - at the first try on black and white testing. The #include "escapi.h" is there, the header and the cpp added to the project. The problem occurs on startup, when escapi cannot load in the setup the escapi.dll (HMODULE capdll = LoadLibraryA("escapi.dll"); Do I need to add something else?
@javidx96 жыл бұрын
Do you have escapi.dll in your project folder on disk?
@zoltans34666 жыл бұрын
Ok, sorry was a bit tired - copied into the wrong folder. Thank you :)
@glowiever4 жыл бұрын
lol nice. looks paletted. remind me of good ol dos gamw
@jean-naymar6027 жыл бұрын
wow, that's fucking awesowe !
@javidx97 жыл бұрын
Cheers Jean-Nay! However, I respectfully disagree - it is decidedly awe-less! :-D To Be Improved...
@jean-naymar6027 жыл бұрын
But using the console to display a webcam video is an idea that has to be praised !
@grftaNitro5 жыл бұрын
I can barely make running code and then I see people creating this...
@javidx95 жыл бұрын
Everyone has gotta start somewhere buddy!
@nguyenucnghia93045 жыл бұрын
i have an error said CL.exe excited with code 2
@witnnileUnity4 жыл бұрын
You are crazy
@dorjderemnamsraijav51825 жыл бұрын
Why you don't use linux?
@javidx95 жыл бұрын
I do, just dont find it as fluid as windows.
@0xoldschool172 жыл бұрын
Next Step: implementing this in ms dos ega graphics
@BrekMartin7 жыл бұрын
I didn’t get YT notification. Something broke :( Anyone else?
@javidx97 жыл бұрын
I think so - I've been missing a few too. One of yours too actually Parts 4 & 5 didn't get announced. Still watched 'em though :)
@BrekMartin7 жыл бұрын
Cool :D I knew conceptually how a retro computer worked with it’s address & data bus, but it took someone else’s practical project to really turn the light on. So now I’ve already ordered a 68030 40MHz CPU for an accelerator, salvaged 2Mb RAM from a bung mainboard, and have already started the parallel port. I’ll keep making a stack till something breaks. I don’t think it’s all YT material though.
@seditt51467 жыл бұрын
Brek, they changed the YT Algorithm to display based on time frame between last time a video was watched from that person, so if a longer time span has gone by they will show you other videos or just not display a notification at all. There has been a lot of bitching about it across the board from YT creators. Game Theory did a decent video on the Algorithm changes and there are some other videos out there explaining it as well.