Probleem is dus dat hij een fout geeft aan lijn 15 contour(image_name); In de helpdesk vind ik niets over het commando dusja en het is wel degelijk zo oorspronkelijk.
De bedoeling is dus dat hij een ster isoleert van een hemelfoto... Maar vraag is hoe breng ik zo'n foto in en welke naam moet ik die geven, in welke map moet ik die plaatsen. Wat moet ik daar dus juist aan veranderen... En hoe zal hij dan de foto weergeven na het proces?
Als er nog fouten in zouden staan die erna komen corrigeren hé want zal waarschijnlijk toch oplossing niet vinden
Ben nog Matlabnoob
so
aan diegene die mij een oplossing kan geven.
code:
--------------------------------------------------------------------------------
1 function star_image = isolate_star( image_name, box_size, tolerance )
2 % ISOLATE_STAR - Isolate a star on a known field and get its image
3 %
4 % ISOLATE_STAR( IMAGE, BOX_SIZE, TOLERANCE )
5 % - IMAGE is the grayscale image that the star is to be taken from
6 % - BOX_SIZE is the number of pixels in each direction that the box
7 % around the star should encompass
8 % - TOLERANCE is the pixel intensity which should be regarded as
9 % background noise
10 %
11 % NOTE: It is recommended that the tolerance be taken from a dark frame
12 % that has been run through PROCESS_IMAGE.
13
14 % Plot the entire image
15 contour(image_name);
16
17 % Give the user a chance to zoom in on the star they want to use
18 fprintf(1,'Press any key after zooming...\n');
19 pause;
20
21 % Capture the click location, then close the figure
22 spot = ginput(1);
23 close(gcf);
24
25 % Round off the point selected to an integer
26 spot = round(spot);
27
28 % Extract a box around the selected point of the selected size
29 star_image = image_name( spot(2)-box_size:spot(2)+box_size,...
30 spot(1)-box_size:spot(1)+box_size );
31
32 % Zero out values below the tolerance
33 for i=1:(box_size*2+1)
34 for j=1:(box_size*2+1)
35 if ( star_image(i,j) < tolerance )
36 star_image(i,j) = 0;
37 end
38 end
39 end
40
41 % Plot the resulting star
42 surface(star_image);
--------------------------------------------------------------------------------
De bedoeling is dus dat hij een ster isoleert van een hemelfoto... Maar vraag is hoe breng ik zo'n foto in en welke naam moet ik die geven, in welke map moet ik die plaatsen. Wat moet ik daar dus juist aan veranderen... En hoe zal hij dan de foto weergeven na het proces?
Als er nog fouten in zouden staan die erna komen corrigeren hé want zal waarschijnlijk toch oplossing niet vinden
so
code:
--------------------------------------------------------------------------------
1 function star_image = isolate_star( image_name, box_size, tolerance )
2 % ISOLATE_STAR - Isolate a star on a known field and get its image
3 %
4 % ISOLATE_STAR( IMAGE, BOX_SIZE, TOLERANCE )
5 % - IMAGE is the grayscale image that the star is to be taken from
6 % - BOX_SIZE is the number of pixels in each direction that the box
7 % around the star should encompass
8 % - TOLERANCE is the pixel intensity which should be regarded as
9 % background noise
10 %
11 % NOTE: It is recommended that the tolerance be taken from a dark frame
12 % that has been run through PROCESS_IMAGE.
13
14 % Plot the entire image
15 contour(image_name);
16
17 % Give the user a chance to zoom in on the star they want to use
18 fprintf(1,'Press any key after zooming...\n');
19 pause;
20
21 % Capture the click location, then close the figure
22 spot = ginput(1);
23 close(gcf);
24
25 % Round off the point selected to an integer
26 spot = round(spot);
27
28 % Extract a box around the selected point of the selected size
29 star_image = image_name( spot(2)-box_size:spot(2)+box_size,...
30 spot(1)-box_size:spot(1)+box_size );
31
32 % Zero out values below the tolerance
33 for i=1:(box_size*2+1)
34 for j=1:(box_size*2+1)
35 if ( star_image(i,j) < tolerance )
36 star_image(i,j) = 0;
37 end
38 end
39 end
40
41 % Plot the resulting star
42 surface(star_image);
--------------------------------------------------------------------------------