Live data from Hacker News

3D scatterplot of an image

alexander.engineering

71–78 of 78 posts

Re: 3D scatterplot of an image

#71
post #24

In the late '90s I was asked to do image segmentation of multispectral data of brightfield microscope data. That is, given a picture of a bunch of cells, find all of the cells. There were two problems: image segmentation of sick cells is really hard (they're very blobby & fragmented), and the computer I had available took more than 20 minutes per image. It was literally both cheaper and faster to have a grad student…

Sorry if this is a stupid question, but can't you do this without converting the image into an RGB 3D space? (i.e. iterate through the pixels and count the ones within a certain range of what you want)

You don't have to actually reify the conversion (as in, create a data structure that holds the new representation in memory). When they say that they converted the image into RGB 3D space, it was probably mainly conceptually, to give meaning to "nearness." I'd guess the only data they kept track of as the image streamed off the camera were two integer counts.

I wish I had more examples of algorithms where it is best explained as acting on a data structure that is not actually present, but all I can think of right now is using generators to represent a list.

Re: 3D scatterplot of an image

#72

Earlier quoted context omitted.

Sorry if this is a stupid question, but can't you do this without converting the image into an RGB 3D space? (i.e. iterate through the pixels and count the ones within a certain range of what you want)

How would you determine if they were within the range? That's effectively converting it into a 3D space.

A few plane equation evaluations—then a few ands, and a sum. Plenty of horsepower on a pentium pro to do that.

Re: 3D scatterplot of an image

#73

This is really cool! I'm a painter and have spent a long time doing gamut analysis of paintings. Thank you for including both HSV and HSL. Not enough people appear to understand/care about the difference between the two, and for painters the distinction is everything .

Both are absolutely terrible for painting (or any other human purpose, especially things like this scatterplot), and should be replaced with some perceptually relevant model.

(Disclaimer: I largely wrote the wikipedia article about HSL and HSV, years ago.)

Re: 3D scatterplot of an image

#74

Earlier quoted context omitted.

But I'd expect to see distinct clumps, not a straight plane...

Imagine you have a flat red piece of card in a photographed scene. If the lighting is just right and the card is matt, you could get all the pixels of the card in the image to be the exact same colour. That would be a single point in the colour space. Now imagine you rolled the card into a cylinder. The result would depend on the lighting, but most likely you'd be able to see some shading across the object, so that t…

But the demos all form planes in RGB... look at them - most are basically thin cylinders.

Re: 3D scatterplot of an image

#75
post #12
post #2

Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?

The answer is quite obvious. You could start off with a grayscale 2D image on one side, and a pretty dotted 3D object on the other side. You'd then read the coordinates of the 3D object in a specific color space to obtain color values which you can pretty randomly (or even judiciously) apply to the grayscale image. Now I would pose another question: would it be possible to make a human-recognizable 3D-object in all t…

Clever to start out with a greyscale image! But it still poses some constraints, let's say if we start with an all black image for an edge case to demonstrate the limitations, we can only have a 2D pattern in the 3D space, right?

However the luminance component of the image could probably be adjusted within certain error margins and vice versa. Perhaps by some form of bruteforce!

To know for sure I suppose coding is needed!

Re: 3D scatterplot of an image

#76
post #2

Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?

Well, there's another neat thing that you can do if you want to generate an interesting 2D -> 2D representation: * Take fourier transform of the image for each color R, G, B * Randomly scramble the phase of the transformed image. * Perform the fourier inverse of that scrambled phase image. The result is another 2D image with the same colors AND spatial frequencies as the original image. It looks like you took the ori…

Yes yes fourier transforms is what make mathematicians go mad and or religious.

Re: 3D scatterplot of an image

#77
post #2

Would it be possible to make a human recognizable 3D-object in the colorspace that also is a pretty picture in 2D?

Yes, another way : take a colored picture, sample as many points as there are pixels on the surface of the 3D-object, then for each pixel of your picture pick without replacement its closest remaining color in your 3d object 'color palette'. The looping order still grants some artistic liberties.

It just struck me that the resolution of the image can be modified, if more or less voxels are needed!

Let's say if we have a 4096 times 4096 image we can reach and fill all values in the 3d representation, if we want to!

Re: 3D scatterplot of an image

#78
post #72

Earlier quoted context omitted.

How would you determine if they were within the range? That's effectively converting it into a 3D space.

A few plane equation evaluations—then a few ands, and a sum. Plenty of horsepower on a pentium pro to do that.

Those plane equations are describing the pixel in 3D space.
Post reply on HN