How to make a scatter plot from 2 images [closed]

How can two images be used to create a scatter plot, image 1 being the x axis, image 2 being the y axis, and the color of each plot point being the bin count?

-

closed as unclear what you're asking by Kuba, Yves Klett, halirutan, Mr.Wizard♦Sep 18 '13 at 22:10

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Can you explain further, please? Do you have an example? Do you have any code? – Dr. belisarius Sep 18 '13 at 1:24
Something like this post ? – Vitaliy Kaurov Sep 18 '13 at 3:13
@sak please clarify exactly what you mean by "image 1 being the x axis". Assuming color images how do you propose to map a color value to a scalar? – george2079 Sep 18 '13 at 12:54

Something like this?

First, I Import the pictures, in this case a stereogram pair from Wikipedia (so that I have reasonably similar images; this to make the exercise somewhat interesting). I split them using ImagePartition and then extract the Hue information using a color space conversion and successive extraction of the H part of the HSB representation of the image pixels. SmoothDensityHistogram does the rest.

fileLoc="http://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Asiatic_hybrid_lilium_stereogram_flipped.jpg/800px-Asiatic_hybrid_  lilium_stereogram_flipped.jpg"
{pic1, pic2} =
Flatten[
ImageData[
ColorConvert[#, "HSB"]][[1]]
] & /@ Flatten@ImagePartition[#, ImageDimensions [#] {1/2, 1}] &@Import[fileLoc];

SmoothDensityHistogram[
Transpose[{pic1, pic2}],
Method -> {"DistributionAxes" -> "SmoothHistogram"},
ColorFunction -> ColorData["SunsetColors"]
]


Original picture:

-
Assume image1 and image2 contain gray scale intensity values 0..255. To create the scatter plot, take corresponding pixels from each image at row,col, then use the value from image1 as the cartesian x coordinate, and the value from image2 as the cartesian y coordinate, and plot the point on a graph, binning the results like a 3D histogram to show population and add false color showing bins with high counts. – sak Sep 18 '13 at 22:24
@sak I trust you will be able to easily adapt the answer above to the demands of your homework assignment. Please be more specific in your question next time. I note you refer to the color of the pictures whereas they happen to be B/W now. – Sjoerd C. de Vries Sep 19 '13 at 13:50
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2647339105606079, "perplexity": 1502.9251915729162}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-18/segments/1461860122420.60/warc/CC-MAIN-20160428161522-00217-ip-10-239-7-51.ec2.internal.warc.gz"}