|
These things need to be banned and anyone who deploys them executed for treason against the human race. It's bad enough that we have stand off weapons where the person doesn't see the carnage that results from their actions, but having fully autonomous weapon systems is a nightmare scenario.
|
|
|
|
|
I gave up on the article in the first paragraph as it accused Musk of being a thinker!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Something I run into a lot with IoT is things that seem simple become complicated quickly due to having to run in a constrained environment.
Take running a jpeg slideshow off an SD card on a 320kB system with a 320x240 display.
Wire up the SD and an ST7789 or ILI9341 and bob's your uncle, one might think.
Except for one small wrinkle - a camera produces images in the megapixel range. That display is only .0768 megapixels if my math is right.
That means you have to do some sort of resizing on most images. Well, it's all well and good to do bicubic or bilinear resampling of an image if you can access the entire uncompressed image data in a frame buffer, but again, a 320kB system. Good luck.
Images must be progressively loaded and then blted more or less directly to the display as it loads - since the display hardware has its own 320x240 display memory on the chip. How that happens depends on the underlying image format. For BMP files progressive loading means going from bottom to top, scanline by scanline. For JPEGS it means getting 8x8 squares of the image at a time, left to right, top to bottom, etc.
The issue here is when you're resampling you need to use matrix computations on *overlapping* regions of the image in order to get a proper result, meaning you can't just resize those 8x8 chunks to 6x6 for example and call it good. It would create artifacts every 6 pixels where it wasn't "blended" properly at the edges with the next pixel.
So suddenly you need something like maybe a 12x12 intermediary buffer so you can progressively resample, which makes a simple algorithm suddenly messy.
And this is just an example.
All this for a slideshow.
Real programmers use butterflies
|
|
|
|
|
I see....
Nothing that would stop a code witch extraordinaire though, is it?!
|
|
|
|
|
*cracks knuckles*
*grabs wand*
Nothing an eye of newt won't solve.
Real programmers use butterflies
|
|
|
|
|
The post title deserves an upvote all by itself. And a fun problem too.
Here's a thought. If and only if, you have fast random-access reads to your SD, you could shift your 6x6 convolution window one pixel horizontally at a time, reading a new vertical column of 6 input pixels for each output pixel. This would mean that for the next output row you would read 5/6ths of the same pixels again. Each pixel would be read 6 times.
But TBH I would first try discarding pixels, and subjectively examining those results. With such a low res display I would assume the display to have a lower dynamic range as well, and that would help masking the artifacts from an unmathematical downsampling.
Or a hybrid, reading 2x2, and discarding.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
I can't shift one pixel horizontally at a time because JPEGs are compressed in 8x8 chunks left to right, top to bottom.
Now, I could resize those, but like i said I'd get artifacts. I need to overlap. It's easy enough to do horizontally, but vertically is a problem because I need to store 2ximage_widthx2 bytes worth of pixels to do bicubic sampling vertically. That's a huge problem RAM wise, and it complicates the algorithm significantly.
My other option, and I'm not 100% sure about this, is to do two passes over the image, and do the "in betweens" vertically on the second pass. I'm not even sure this will work as so far I only have a vague sketch of the concept in my head, but if possible it will probably be the route I go.
Real programmers use butterflies
|
|
|
|
|
If you can read those 8x8-chunks with random access, would you really need to keep a whole row of chunks in memory?
If I've "seen" your challenge correctly you would only need to keep twobytwo of those 8x8-chunks in memory at any time. But with the downside that each chunk (except edge chunks) would have to be read, I think, 2x8 times. And ofc I have no idea how expensive those reads are...
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
They're compressed. There is no random access possibility in JPEGs unless I'm mistaken.
Adding, I don't really care about load times when it comes to resizing.
Real programmers use butterflies
|
|
|
|
|
What if you create an index of all chunks in initial indexing pass?
chunk[x, y] => addr
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
There's an idea. The only thing I'm not sure about is the huffman table. If it stores its compression table progressively I won't be able to seek exactly - I'll have to decompress up to the requested point. I have a feeling i may need to do that anyway.
One thing I was thinking of doing is opening the file twice, and scanning through them in tandem with one ahead of the other by one row of 8x8s.
Real programmers use butterflies
|
|
|
|
|
Hi, I use WinDirStat to evaluate the amount of space in each folder on my local drives, but WinDirStat doesn't work with NAS devices.
Can you suggest a utility that lets you view the full folder tree along with how much space is taken up by each folder/file?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I'm using version 1.1.2 and it works if I select it as a network folder.
EDIT: also works if network drive is mapped.
Mircea
|
|
|
|
|
Thanks for your suggestion.
I tried it, but I can't map a folder that's contained in a NAS. It's not a Windows share.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Have you tried the option to open a folder and set folder name to something like \\nas\share\folder ?
Seems to be working for me.
Mircea
|
|
|
|
|
You're right. It works when I directly enter the folder path into the folder box. But it doesn't work if I browse for the folder using the drive/folder browser.
Thanks!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Not sure about NAS access but TreeSize Free | JAM Software[^] used to be my go to tool for this type of info.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Thanks for the suggestion. I appreciate you responding to my post.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Out of curiosity, if you have time, could you try what happens with Directory size browser .
I don't have NAS drives I could play with so it would be interesting to know how this behaves...
|
|
|
|
|
I'm using Total Commander for that. Total Commander - home[^]
Simply use arrows to place the "Cursor" over the folder you want the size of and tap the spacebar to select. And it will tell you the size of the folder.
Or, go to Files -> Calculate Occupied Space (ctrl+L) and it will tell you a lot more, including actual space used considering cluster size, as well as space needed on target drive, also considering cluster size.
|
|
|
|
|
Use the Dir command? (Folders, file counts, files and sizes, sorted on size)
cd ..
dir /s /os > dir.txt
more < dir.txt
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
The final aim being to build some new kitchen cupboard doors - and hand routing that many mortices and tenons is a recipe for large piles of scrap wood. So I've repurposed one of my routers into the table.
So I bought a set of mortice and tenon bits and after a quick try to make my own tenon - Yay! It worked! - I tried the morticing bit and it worked well, though a slightly different size to my tenon, but I wasn't trying for a specific size this time.
So I loaded the tenoning bit ... and turned it on. Horrible noise, horrible smell, turn it off quick. Maybe it's too heavy - it's a physically large bit?
Nope. The bit has moved in the router and isn't running "true". It's caught the aluminium mounting plate which is were the noise and smell came from. But why?
Long story short the shank diameter is out of tolerance: about 0.2mm too narrow, and that's way outside what the collet can comfortably adapt to with a heavy bit. So when spinning at 20,000 rpm it goes out of balance and ... nasty and dangerous. The morticing one is pretty much spot on, so I guess that's Chinese manufacturing for you, again ...
Oh well, it'll take longer to do them all "by hand" but at least I can do the mortices in one pass.
I'm still happy the table worked!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Coincidently I just finished making a kitchen island with 2 narrow pull outs with fronts that match the cabinets we installed a few months back.
I bought a set of Yonico 1/4" shank bits and they were junk, tore the oak wood I am using up. I adjusted the speed of the router I have on my table but it was of no use, the bits are just junk...Chinese!
So I bit the bullet and bought so good (expensive) bits and the faces turned out awesome.
We bought a bunch of 2-1/2" x 3/4" oak flooring and I ran it through a surface plane and ripped the tongue and groove off and used it for the Island top and book shelf counters. Turned out very nice and a heck of a lot cheaper than buying the oak from the lumber yard.
|
|
|
|
|
Can you wrap the shank in a piece of paper and get it into the collet? Average paper thickness is about 0.1mm per a quick googling. Probably difficult to do, if possible, without crinkling the paper. There are probably other reasons not to attempt this monkey-wrench technique... Or get some shim stock cut to size...
|
|
|
|
|
I don't see that as an option, at 20K RPM even the slightest deviation in the thickness of the paper could cause real problems.
I bought a cheap router without speed control and the bit worked loose and shot all the way across the shop. When I found it the shaft was badly bend. Needless to say I was lucky that the bit was thrown away from me. That router is now at the county dump!
I replaced it with this Milwaukee Router[^]
|
|
|
|